build: Cleanup

This commit is contained in:
Remko Tronçon 2024-02-22 21:10:04 +01:00
parent a07f283511
commit 0fb992e2cb
14 changed files with 3070 additions and 2031 deletions

View file

@ -1,6 +0,0 @@
public/waforth/dist
build/
dist/
src/web/benchmarks/sieve/sieve-c.js
src/standalone/wasm-micro-runtime

View file

@ -1,29 +0,0 @@
env:
browser: true
es2021: true
node: true
extends:
- 'eslint:recommended'
- 'plugin:react/recommended'
- 'plugin:react-hooks/recommended'
- 'plugin:@typescript-eslint/recommended'
parser: '@typescript-eslint/parser'
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 12
sourceType: module
plugins:
- prettier
- react
- '@typescript-eslint'
settings:
react:
version: detect
rules:
"prettier/prettier": "error"
react/display-name: 0
react/prop-types: 0
"@typescript-eslint/explicit-module-boundary-types": 0
"@typescript-eslint/no-explicit-any": 0
"@typescript-eslint/no-non-null-assertion": 0

View file

@ -5,7 +5,8 @@ runs:
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: 17 node-version: 17
cache: 'yarn' registry-url: 'https://registry.npmjs.org/'
cache: 'npm'
# - if: runner.os == 'macOS' # - if: runner.os == 'macOS'
# run: brew install wabt # run: brew install wabt
# shell: bash # shell: bash
@ -31,5 +32,5 @@ runs:
mv /tmp/wabt-1.0.31 /c/tools/wabt mv /tmp/wabt-1.0.31 /c/tools/wabt
cp /c/tools/wabt/bin/* /c/Windows/system32 cp /c/tools/wabt/bin/* /c/Windows/system32
shell: bash shell: bash
- run: yarnpkg --pure-lockfile - run: npm ci
shell: bash shell: bash

View file

@ -13,9 +13,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- run: yarnpkg build - run: npm run build
- run: yarnpkg lint - run: npm run lint
- run: yarnpkg test --coverage - run: npm test
- run: make -C src/web/notebook - run: make -C src/web/notebook
- run: ./dist/wafnb2html src/web/notebook/examples/drawing-with-forth.wafnb - run: ./dist/wafnb2html src/web/notebook/examples/drawing-with-forth.wafnb

View file

@ -14,6 +14,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- run: yarnpkg publish --non-interactive - run: npm publish
env: env:
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

View file

@ -6,19 +6,19 @@ WAT2WASM_FLAGS:=$(WAT2WASM_FLAGS) --debug-names
endif endif
all: all:
yarn -s build npm run build
dev: dev:
yarn -s dev npm run dev
check: check:
yarn -s test npm test
check-watch: check-watch:
yarn -s test-watch npm run test-watch
lint: lint:
yarn -s lint npm run lint
wasm: src/waforth.assembled.wat scripts/word.wasm.hex wasm: src/waforth.assembled.wat scripts/word.wasm.hex

View file

@ -264,23 +264,22 @@ Here are some of the goals (and non-goals) of WAForth:
The build uses the [WebAssembly Binary The build uses the [WebAssembly Binary
Toolkit](https://github.com/WebAssembly/wabt) for converting raw WebAssembly Toolkit](https://github.com/WebAssembly/wabt) for converting raw WebAssembly
text format into the binary format, and [Yarn](https://yarnpkg.com) (and therefore text format into the binary format, and [Node.JS](https://nodejs.org/en/) for
[Node.JS](https://nodejs.org/en/)) for
managing the build process and the dependencies of the shell. managing the build process and the dependencies of the shell.
brew install wabt yarn brew install wabt node
yarn npm install
### Building & Running ### Building & Running
To build everything: To build everything:
yarn build npm run build
To run the development server: To run the development server:
yarn dev npm run dev
### Testing ### Testing
@ -288,4 +287,4 @@ The tests are served from `/waforth/tests` by the development server.
You can also run the tests in Node.JS by running You can also run the tests in Node.JS by running
yarn test npm test

2999
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -51,5 +51,51 @@
"wasm", "wasm",
"compiler", "compiler",
"interpreter" "interpreter"
],
"eslintConfig": {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"prettier",
"react",
"@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"prettier/prettier": "error",
"react/display-name": 0,
"react/prop-types": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0
},
"ignorePatterns": [
"public/waforth/dist",
"build/",
"dist/",
"src/web/benchmarks/sieve/sieve-c.js",
"src/standalone/wasm-micro-runtime"
] ]
}
} }

View file

@ -1,4 +1,4 @@
#!/usr/bin/env yarn exec ts-node -- #!/usr/bin/env npx ts-node --
import * as process from "process"; import * as process from "process";
import * as fs from "fs"; import * as fs from "fs";

View file

@ -1,6 +1,6 @@
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
VERSION?=$(shell cat ../../package.json | grep '"version"' | sed -e 's/.*:.*"\(.*\)".*/\1/') VERSION?=$(shell cat ../../package.json | grep '"version"' | head -n 1 | sed -e 's/.*:.*"\(.*\)".*/\1/')
################################################ ################################################
# WebAssembly engine configuration # WebAssembly engine configuration

View file

@ -1,6 +1,6 @@
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
VERSION?=$(shell cat ../../package.json | grep '"version"' | sed -e 's/.*:.*"\(.*\)".*/\1/') VERSION?=$(shell cat ../../package.json | grep '"version"' | head -n 1 | sed -e 's/.*:.*"\(.*\)".*/\1/')
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
CXX = g++ CXX = g++

View file

@ -3,7 +3,7 @@ all:
.PHONY: install-deps .PHONY: install-deps
install-deps: install-deps:
yarn global add vsce npm install --global vsce
.PHONY: prepackage .PHONY: prepackage
prepackage: all LICENSE.txt icon.png prepackage: all LICENSE.txt icon.png

1971
yarn.lock

File diff suppressed because it is too large Load diff