Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
steps:
- uses: actions/[email protected]
with:
allow-licenses: Apache-2.0, MIT, BSD-3-Clause, ISC, BSD-2-Clause, MIT OR (CC0-1.0 AND MIT), CC0-1.0 OR MIT OR (CC0-1.0 AND MIT), CC-BY-3.0, CC0-1.0, MIT OR Apache-2.0, MIT AND Apache-2.0, MIT OR WTFPL, BSD-2-Clause OR (MIT OR Apache-2.0), Python-2.0, ISC AND MIT, Apache-2.0 AND MIT, MIT/Apache-2.0, Apache-2.0 OR MIT, (Apache-2.0 OR MIT) AND BSD-3-Clause, Zlib OR Apache-2.0 OR MIT, MIT OR Apache-2.0 OR Zlib, MIT OR (Apache-2.0 OR Zlib), (Apache-2.0 WITH LLVM-exception), 0BSD, CC-BY-4.0, Unlicense, MPL-1.1
allow-licenses: Apache-2.0, MIT, BSD-3-Clause, ISC, BSD-2-Clause, MIT OR (CC0-1.0 AND MIT), CC0-1.0 OR MIT OR (CC0-1.0 AND MIT), CC-BY-3.0, CC0-1.0, MIT OR Apache-2.0, MIT AND Apache-2.0, MIT OR WTFPL, BSD-2-Clause OR (MIT OR Apache-2.0), Python-2.0, ISC AND MIT, Apache-2.0 AND MIT, MIT/Apache-2.0, Apache-2.0 OR MIT, (Apache-2.0 OR MIT) AND BSD-3-Clause, Zlib OR Apache-2.0 OR MIT, MIT OR Apache-2.0 OR Zlib, MIT OR (Apache-2.0 OR Zlib), (Apache-2.0 WITH LLVM-exception), 0BSD, CC-BY-4.0, Unlicense, MPL-1.1, LicenseRef-scancode-unicode AND MIT
fail-on-scopes: runtime
38 changes: 33 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ jobs:
with:
name: fastly-weval-ic-cache
- run: npm install
- name: Build CLI
run: npm run build:cli
- run: npm test

build-debug:
Expand All @@ -164,6 +166,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci
- name: Install Rust 1.81.0
run: |
rustup toolchain install 1.81.0
Expand All @@ -174,6 +181,8 @@ jobs:
with:
path: "/home/runner/.cargo/bin/wasm-tools"
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }}
- name: Build CLI
run: npm run build:cli
- name: Build with full debug info
run: npm run build:debug:info
- uses: actions/upload-artifact@v4
Expand All @@ -193,6 +202,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci
- name: Install Rust 1.81.0
run: |
rustup toolchain install 1.81.0
Expand All @@ -203,6 +217,8 @@ jobs:
with:
path: "/home/runner/.cargo/bin/wasm-tools"
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }}
- name: Build CLI
run: npm run build:cli
- name: Build
if: matrix.profile == 'release'
run: npm run build:release
Expand All @@ -229,9 +245,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v3
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci

- name: Download Engine
uses: actions/download-artifact@v4
Expand All @@ -250,8 +268,9 @@ jobs:
with:
path: "/home/runner/.cargo/bin/wasm-tools"
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }}

- run: npm install

- name: Build CLI
run: npm run build:cli

- name: Build WPT runtime
run: tests/wpt-harness/build-wpt-runtime.sh --debug-build
Expand All @@ -277,9 +296,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v3
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci

- name: Download Engine
uses: actions/download-artifact@v4
Expand All @@ -305,7 +326,8 @@ jobs:
path: "/home/runner/.cargo/bin/wasm-tools"
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }}

- run: npm install
- name: Build CLI
run: npm run build:cli

- name: Build WPT runtime
run: tests/wpt-harness/build-wpt-runtime.sh ${{matrix.profile == 'weval' && '--enable-experimental-aot' || matrix.profile == 'debug' && '--debug-build' || ''}}
Expand Down Expand Up @@ -378,6 +400,9 @@ jobs:
- name: Npm install
run: npm install && cd ./integration-tests/js-compute && npm install

- name: Build CLI
run: npm run build:cli

- name: Run Tests
run: SUFFIX_STRING=${{matrix.profile}} node integration-tests/js-compute/test.js --ci --skip-teardown${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.profile == 'weval' && ' --aot' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
env:
Expand Down Expand Up @@ -445,6 +470,9 @@ jobs:
- name: Npm install
run: npm install && cd ./integration-tests/js-compute && npm install

- name: Build CLI
run: npm run build:cli

- name: Run Tests
run: SUFFIX_STRING=debug node integration-tests/js-compute/test.js --ci --skip-teardown --debug-build${{ matrix.platform == 'viceroy' && ' --local' || '' }}${{ matrix.features == 'http-cache' && ' --http-cache' || '' }}
env:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- run: npm ci
- name: Install Rust 1.81.0
run: |
rustup toolchain install 1.81.0
Expand All @@ -99,6 +104,8 @@ jobs:
with:
path: "/home/runner/.cargo/bin/wasm-tools"
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }}
- name: Build CLI
run: npm run build:cli
- name: Build
if: ${{ matrix.profile == 'release' }}
run: npm run build:release
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# TypeScript build output
dist/

# Integration Tests build output
/integration-tests/**/fixtures/**/*.tar.gz
/integration-tests/**/fixtures/**/fastly.toml
Expand Down
12 changes: 6 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ To build from source, you need to have the following tools installed to successf
```sh
sudo apt install binaryen
```
- rust target wasm32-wasi
- rust target wasm32-wasip1
```sh
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
```
- [cbindgen](https://github.com/eqrion/cbindgen#quick-start)
```sh
Expand Down Expand Up @@ -87,9 +87,9 @@ npm run build
# then, restart shell or run:
source $HOME/.cargo/env
```
- rust target wasm32-wasi
- rust target wasm32-wasip1
```sh
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
```
- [cbindgen](https://github.com/eqrion/cbindgen#quick-start)
```sh
Expand Down Expand Up @@ -180,10 +180,10 @@ In addition the following flags can be added after the command (passed via `npm
A typical development test command is therefore something like:

```
npm run build:debug && npm run test:integration -- --debug-build --debug-log --local --bail /crypto
npm run build:cli && npm run build:debug && npm run test:integration -- --debug-build --debug-log --local --bail /crypto
```

Which would run a debug build, enable debugging logging, and then that build against all the crypto tests locally on Viceroy, throwing an error as soon as one is found.
Which would build the CLI TypeScript to JavaScript, run a debug build, enable debugging logging, and then that build against all the crypto tests locally on Viceroy, throwing an error as soon as one is found.

Some tests can only be run on Compute and not Viceroy and will be automatically skipped. A green tick is always shown for a test that ran successfully - if it is missing that means it did not run.

Expand Down
37 changes: 37 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// @ts-check

import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
{
files: ['src/**/*.{ts,tsx,js}'],
languageOptions: {
parserOptions: {
projectService: true,
},
},
extends: [
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
rules: {
'no-fallthrough': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
},
},
{
ignores: [
'ci/*',
'dist/*',
'documentation/*',
'integration-tests/*',
'runtime/*',
'tests/*',
'test-d/*',
]
},
]);
2 changes: 1 addition & 1 deletion integration-tests/cli/env.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'brittle';
import { EnvParser } from '../../src/env.js';
import { EnvParser } from '../../dist/env.js';

test('EnvParser should parse single key-value pair', function (t) {
const parser = new EnvParser();
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cli/output-path-is-not-a-file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('should return non-zero exit code', async function (t) {
ok(
stderr
.toString()
.startsWith('Error: The `output` path does not point to a file:'),
.startsWith('Error: The `output` path points to a directory:'),
);
ok(stderr.toString().endsWith('main.wasm'));
t.is(code, 1);
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/js-compute/fixtures/app/fastly.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "js-test-app"
service_id = ""

[scripts]
build = "node ../../../../js-compute-runtime-cli.js --env FASTLY_DEBUG_LOGGING,ACL_NAME,CONFIG_STORE_NAME,DICTIONARY_NAME,KV_STORE_NAME,SECRET_STORE_NAME,LOCAL_TEST,TEST=\"foo\" --enable-experimental-high-resolution-time-methods src/index.js"
build = "node ../../../../dist/cli/js-compute-runtime-cli.js --env FASTLY_DEBUG_LOGGING,ACL_NAME,CONFIG_STORE_NAME,DICTIONARY_NAME,KV_STORE_NAME,SECRET_STORE_NAME,LOCAL_TEST,TEST=\"foo\" --enable-experimental-high-resolution-time-methods src/index.js"

[local_server]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "js-test-app"
service_id = ""

[scripts]
build = "node ../../../../js-compute-runtime-cli.js --env FASTLY_DEBUG_LOGGING,ACL_NAME,CONFIG_STORE_NAME,DICTIONARY_NAME,KV_STORE_NAME,SECRET_STORE_NAME,LOCAL_TEST,TEST=\"foo\" --enable-experimental-high-resolution-time-methods --module-mode src/index.js"
build = "node ../../../../dist/cli/js-compute-runtime-cli.js --env FASTLY_DEBUG_LOGGING,ACL_NAME,CONFIG_STORE_NAME,DICTIONARY_NAME,KV_STORE_NAME,SECRET_STORE_NAME,LOCAL_TEST,TEST=\"foo\" --enable-experimental-high-resolution-time-methods --module-mode src/index.js"

[local_server]

Expand Down
Loading
Loading