Skip to content

Commit

Permalink
Merge pull request #64 from aziontech/stage
Browse files Browse the repository at this point in the history
Release 1.10
  • Loading branch information
jotanarciso authored Nov 6, 2024
2 parents 48f1c9c + 87b6d12 commit 4c9cd19
Show file tree
Hide file tree
Showing 48 changed files with 1,219 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.10.0-stage.1](https://github.com/aziontech/lib/compare/v1.9.0...v1.10.0-stage.1) (2024-11-06)


### Features

* presets ([71d9835](https://github.com/aziontech/lib/commit/71d983587e49295829406c1654600ac054c3d46b))

## [1.9.0](https://github.com/aziontech/lib/compare/v1.8.2...v1.9.0) (2024-10-28)


Expand Down
21 changes: 18 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azion",
"version": "1.9.0",
"version": "1.10.0-stage.1",
"description": "Azion Packages for Edge Computing.",
"bin": {
"azion": "./bin/azion",
Expand Down Expand Up @@ -82,6 +82,11 @@
"import": "./packages/client/dist/index.mjs",
"types": "./packages/client/dist/index.d.ts"
},
"./presets": {
"require": "./packages/presets/dist/index.js",
"import": "./packages/presets/dist/index.mjs",
"types": "./packages/presets/dist/index.d.ts"
},
"./ai": {
"require": "./packages/ai/dist/index.js",
"import": "./packages/ai/dist/index.mjs",
Expand Down Expand Up @@ -153,6 +158,9 @@
"ai": [
"./packages/ai/dist/index.d.ts"
],
"presets": [
"./packages/presets/dist/index.d.ts"
],
"application": [
"./packages/application/dist/index.d.ts"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"isolatedModules": true,
"resolveJsonModule": true
}
Expand Down
2 changes: 2 additions & 0 deletions packages/presets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
10 changes: 10 additions & 0 deletions packages/presets/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
displayName: 'Utils',
preset: 'ts-jest',
transform: {
'^.+\\.(t|j)s?$': '@swc/jest',
},
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
testEnvironment: 'node',
};
36 changes: 36 additions & 0 deletions packages/presets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@lib/presets",
"version": "1.0.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"scripts": {
"compile": "tsup --config ../../tsup.config.json",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "jest --clearCache && jest -c jest.config.js .",
"test:watch": "jest -c jest.config.js . --watch",
"test:coverage": "jest --clearCache && jest -c jest.config.js . --coverage",
"prettier": "prettier --write .",
"prettier:check": "prettier --check ."
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"author": "aziontech",
"license": "MIT",
"files": [
"dist",
"package.json"
],
"devDependencies": {
"ajv": "^8.17.1",
"ajv-errors": "^3.0.0",
"ajv-keywords": "^5.1.0"
}
}
65 changes: 65 additions & 0 deletions packages/presets/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import Angular from './presets/angular/index';
import Astro from './presets/astro/index';
import Docusaurus from './presets/docusaurus/index';
import Eleventy from './presets/eleventy/index';
import Emscripten from './presets/emscripten/index';
import Gatsby from './presets/gatsby/index';
import Hexo from './presets/hexo/index';
import Html from './presets/html/index';
import Hugo from './presets/hugo/index';
import JavaScript from './presets/javascript/index';
import Jekyll from './presets/jekyll/index';
import Next from './presets/next/index';
import Nuxt from './presets/nuxt/index';
import React from './presets/react/index';
import RustWasm from './presets/rustwasm/index';
import Svelte from './presets/svelte/index';
import TypeScript from './presets/typescript/index';
import VitePress from './presets/vitepress/index';
import Vue from './presets/vue/index';

const presets = {
Angular,
Astro,
Docusaurus,
Eleventy,
Emscripten,
Gatsby,
Hexo,
Html,
Hugo,
JavaScript,
Jekyll,
Next,
Nuxt,
React,
RustWasm,
Svelte,
TypeScript,
VitePress,
Vue,
};

export {
Angular,
Astro,
Docusaurus,
Eleventy,
Emscripten,
Gatsby,
Hexo,
Html,
Hugo,
JavaScript,
Jekyll,
Next,
Nuxt,
React,
RustWasm,
Svelte,
TypeScript,
VitePress,
Vue,
};

export default presets;
50 changes: 50 additions & 0 deletions packages/presets/src/presets/angular/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { defineConfig } from 'azion/config';

const config = defineConfig({
build: {
preset: {
name: 'angular',
},
},
origin: [
{
name: 'origin-storage-default',
type: 'object_storage',
},
],

rules: {
request: [
{
name: 'Set Storage Origin for All Requests',
match: '^\\/',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
},
},
{
name: 'Deliver Static Assets',
match: '.(css|js|ttf|woff|woff2|pdf|svg|jpg|jpeg|gif|bmp|png|ico|mp4|json|xml|html)$',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
deliver: true,
},
},
{
name: 'Redirect to index.html',
match: '^\\/',
behavior: {
rewrite: `/index.html`,
},
},
],
},
});

export default config;
9 changes: 9 additions & 0 deletions packages/presets/src/presets/angular/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AzionBuildPreset } from '../../types';
import config from './config';
// import handler from './handler';
// import prebuild from './prebuild';
// import postbuild from './postbuild';

const preset: AzionBuildPreset = { config };

export default preset;
56 changes: 56 additions & 0 deletions packages/presets/src/presets/astro/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { defineConfig } from 'azion/config';

const config = defineConfig({
build: {
preset: {
name: 'astro',
},
},
origin: [
{
name: 'origin-storage-default',
type: 'object_storage',
},
],
rules: {
request: [
{
name: 'Set Storage Origin for All Requests',
match: '^\\/',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
},
},
{
name: 'Deliver Static Assets',
match: '.(css|js|ttf|woff|woff2|pdf|svg|jpg|jpeg|gif|bmp|png|ico|mp4|json|xml|html)$',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
deliver: true,
},
},
{
name: 'Redirect to index.html',
match: '.*/$',
behavior: {
rewrite: '${uri}index.html',
},
},
{
name: 'Redirect to index.html for Subpaths',
match: '^(?!.*\\/$)(?![\\s\\S]*\\.[a-zA-Z0-9]+$).*',
behavior: {
rewrite: '${uri}/index.html',
},
},
],
},
});

export default config;
9 changes: 9 additions & 0 deletions packages/presets/src/presets/astro/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AzionBuildPreset } from '../../types';
import config from './config';
// import handler from './handler';
// import prebuild from './prebuild';
// import postbuild from './postbuild';

const preset: AzionBuildPreset = { config };

export default preset;
Loading

0 comments on commit 4c9cd19

Please sign in to comment.