Skip to content

Commit

Permalink
Release 1.6.0 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnunAVFAzion authored Sep 13, 2023
2 parents 4b4c42d + 136da9a commit fd5674c
Show file tree
Hide file tree
Showing 129 changed files with 22,783 additions and 4,590 deletions.
79 changes: 64 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"es2021": true,
"jest/globals": true
},
"plugins": ["jsdoc", "jest"],
"plugins": [
"jsdoc",
"jest"
],
"extends": [
"airbnb-base",
"plugin:jsdoc/recommended",
Expand All @@ -19,24 +22,70 @@
"import/resolver": {
"alias": {
"map": [
["#root/*", "./"],
["#lib/*", "./lib"],
["#utils", "./lib/utils/index.js"],
["#polyfills", "./lib/build/polyfills/index.js"],
["#build", "./lib/build/dispatcher/index.js"],
["#bundlers", "./lib/build/bundlers/index.js"],
["#notations/*", "./lib/notations"],
["#env", "./lib/env/index.js"],
["#platform", "./lib/platform/index.js"],
["#constants", "./lib/constants/index.js"],
["#edge", "./lib/platform/edgehooks/index.js"]
[
"#root/*",
"./"
],
[
"#lib/*",
"./lib"
],
[
"#utils",
"./lib/utils/index.js"
],
[
"#polyfills",
"./lib/env/polyfills/index.js"
],
[
"#build",
"./lib/build/dispatcher/index.js"
],
[
"#bundlers",
"./lib/build/bundlers/index.js"
],
[
"#notations/*",
"./lib/notations"
],
[
"#env",
"./lib/env/index.js"
],
[
"#platform",
"./lib/platform/index.js"
],
[
"#constants",
"./lib/constants/index.js"
],
[
"#edge",
"./lib/platform/edgehooks/index.js"
],
[
"#commands",
"./lib/commands/index.js"
]
],
"extensions": [".js", ".json"]
"extensions": [
".js",
".json"
]
}
}
},
"rules": {
"import/extensions": ["error", "always"],
"import/extensions": [
"error",
"always"
],
"no-console": "off"
},
"globals": {
"AZION_VERSION_ID": "readonly"
}
}
}
29 changes: 0 additions & 29 deletions .github/workflows/major.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/minor.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release
on:
push:
branches:
- main
- dev

permissions:
contents: read #

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: yarn install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ coverage
out
.temp
.edge
jsdoc
jsdoc
vulcan.env
.vulcan
wrangler.toml
31 changes: 31 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true,
"channel": "stage"
}
],
"analyzeCommits": {
"preset": "conventionalcommits",
"parserOpts": {
"headerPattern": "^(\\[ISSUE-.*])?\\s?(\\w+):\\s(.*)$",
"headerCorrespondence": ["scope", "type", "subject"]
}
},
"generateNotes": {
"preset": "conventionalcommits",
"parserOpts": {
"headerPattern": "^(\\[ISSUE-.*])?\\s?(\\w+):\\s(.*)$",
"headerCorrespondence": ["scope", "type", "subject"]
},
"options": {
"preset": {
"name": "conventionalchangelog",
"issuePrefixes": ["ISSUE-"],
"issueUrlFormat": "https://github.com/aziontech/vulcan/issues/{id}"
}
}
}
}
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

# Vulcan - Forging The Edge
![vulcan](https://github.com/aziontech/vulcan/assets/12740219/a5043e6f-11cb-4498-a300-5bdb617a9989)


Vulcan is a powerful tool designed to streamline the development and deployment of JavaScript applications and frameworks. This powerful utility automates polyfills for Edge Computing, significantly simplifying the process of creating Workers, particularly for the Azion platform.

Expand Down Expand Up @@ -45,6 +47,40 @@ Follow these steps to start using Vulcan:

5. Start developing: Once the project is set up, you can start developing your JavaScript applications or frameworks using the power of Vulcan. Leverage the automated polyfills, Worker creation assistance, and other features provided by Vulcan to enhance your development workflow.

## Using Vulcan

See some examples below:

* Build a JavaScript/Node project (back-end)

```shell
vulcan build
```

* Build a TypeScript/Node (back-end)

```shell
vulcan build --preset typescript
```

* Build a Static Next.js project

```shell
vulcan build --preset next --mode deliver
```

* Build a Static Astro.js project

```shell
vulcan build --preset astro --mode deliver
```

* Test your project locally (after build)

```shell
vulcan dev
```


## Docs
* [Overview](docs/overview.md)
Expand Down
3 changes: 2 additions & 1 deletion aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ export default [
['#root/*', './'],
['#lib/*', './lib'],
['#utils', './lib/utils/index.js'],
['#polyfills', './lib/build/polyfills/index.js'],
['#polyfills', './lib/env/polyfills/index.js'],
['#build', './lib/build/dispatcher/index.js'],
['#bundlers', './lib/build/bundlers/index.js'],
['#notations/*', './lib/notations'],
['#env', './lib/env/index.js'],
['#platform', './lib/platform/index.js'],
['#constants', './lib/constants/index.js'],
['#edge', './lib/platform/edgehooks/index.js'],
['#commands', './lib/commands/index.js'],
];
7 changes: 4 additions & 3 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Polyfills can be used to generate the worker(s) file(s).
Some configs can be passed to the builder but if user tries to override `azion worker configs` this passed configs will be ignored.

### Artifacts
Files generated to run in azion structure:
* js worker(s);
* Storage assets files;
The **'.edge'** folder will be generated representing the edge locally. Files generated to run on the infrastructure:
* JS worker(s) => '.edge/workers.js';
* Assets => '.edge/storage/*';
* Environment variables => '.edge/.env'.
24 changes: 18 additions & 6 deletions docs/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ Vulcan is an extensible platform that allows you to easily create new presets fo
To add a new preset, you need to create appropriate folders in two directories: `presets/default` or `presets/custom`. The folder representing your framework or library will automatically be included in the preset listings. Each preset has two modes, represented by folders of the same name: `compute` and `deliver`.


https://github.com/aziontech/vulcan/assets/12740219/84c7d7a1-4167-4e7e-993f-41a6eb653758


https://github.com/aziontech/vulcan/assets/12740219/06edb9a0-26cd-4055-bd2e-d400b6a06f3c



Expand All @@ -35,7 +36,7 @@ Each preset is made up of three primary files: `config.js`, `prebuild.js`, and `

- `getPackageManager`: This method returns the package manager relative to the user's project (can be yarn, npm, or pnpm).

- `copyDirectory`: This function is used to copy the resulting static files from the framework build to the local Edge environment (.edge/statics).
- `copyDirectory`: This function is used to copy the resulting static files from the framework build to the local Edge environment (.edge/storage).

- `feedback`: This interface is used to display messages during the process, if necessary, or in case of error.

Expand All @@ -54,7 +55,18 @@ Each preset is made up of three primary files: `config.js`, `prebuild.js`, and `

Here's a step-by-step guide on how to add a new preset in Vulcan:

1. ## **Create a folder inside `./lib/presets/custom`:**
## **Use the command to automatic creation:**

vulcan presets create

https://github.com/aziontech/vulcan/assets/12740219/9ca7371e-713a-4b29-a99b-c1a18d28bc67



### Or do it manually:


## 1. **Create a folder inside `./lib/presets/custom`:**
https://github.com/aziontech/vulcan/assets/12740219/abb1b2cc-5f74-473d-b731-c0b7157cb95e

- The name of this folder should represent the name of your framework or library.
Expand All @@ -65,7 +77,7 @@ Here's a step-by-step guide on how to add a new preset in Vulcan:

- **Deliver**: This mode should be used when you intend to use the worker only for routing requests and delivering static files that will be computed on the client side.

3. ## **Create the following files in your preset's folder:**
2. ## **Create the following files in your preset's folder:**

## handler.js
This file contains the code that is executed within the worker in the edge function. Essentially, it is the code that runs directly on the edge. In the context of the `deliver` mode, this may simply act as a router. However, in cases where computation is needed, it can be designed to perform more complex tasks. Remember, the capabilities of your handler.js are dependent on your use case and the mode of operation you've chosen for your preset.
Expand All @@ -83,7 +95,7 @@ Here's a step-by-step guide on how to add a new preset in Vulcan:
This file serves as an extension to the edge build. It enables the inclusion of polyfills, plugins, or any other procedures that relate to the build process executed on the edge. Although it is editable, we strongly advise against making changes to this file unless absolutely necessary. It's designed to ensure optimal operation, and modifications should be undertaken with careful consideration.

## prebuild.js
In this file, you should adapt the native build process of your framework or library. Usually, in the case of *deliver* presets, this file will be used to ensure that the generated static artifacts are placed in the *.edge/statics/* directory.
In this file, you should adapt the native build process of your framework or library. Usually, in the case of *deliver* presets, this file will be used to ensure that the generated static artifacts are placed in the *.edge/storage/* directory.
#### React (deliver) Example:

![prebuild](https://github.com/aziontech/vulcan/assets/12740219/85adc374-220b-4003-8c3e-6ec5b06a483f)
Expand Down Expand Up @@ -112,4 +124,4 @@ For `deliver` mode:

vulcan build --preset <name> --mode deliver

Replace `<name>` with the name of your preset. This will initiate Vulcan's build process for your preset, allowing you to verify its functionality.
Replace `<name>` with the name of your preset. This will initiate Vulcan's build process for your preset, allowing you to verify its functionality.
1 change: 0 additions & 1 deletion examples/angular-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@angular/cli": "~16.1.3",
"@angular/compiler-cli": "^16.1.0",
"@types/jasmine": "~4.3.0",
"edge-functions": "^0.0.1",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
Expand Down
Loading

0 comments on commit fd5674c

Please sign in to comment.