diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 373a6d6..0408f49 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -4,9 +4,9 @@ on: push: branches: - main - pull_request: - branches: - - main + paths: + - 'src/**' + - 'package-lock.json' workflow_dispatch: jobs: diff --git a/.husky/pre-commit b/.husky/pre-commit index f409ca8..9cc4a90 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/usr/bin/env sh -set -euo pipefail +set -eu +if (set -o pipefail) 2>/dev/null; then :; fi npx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push index 30968cb..9e36a84 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,6 @@ #!/usr/bin/env sh -set -euo pipefail +set -eu +if (set -o pipefail) 2>/dev/null; then :; fi npm run prettier:check npm run lint diff --git a/README.md b/README.md index 8ffbb23..ecda302 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ A runtime JSX template tag backed by the [`oxc-parser`](https://github.com/oxc-p - [Next.js integration](#nextjs-integration) - [Browser usage](#browser-usage) - [Testing & demos](#testing) +- [CLI setup](docs/cli.md) ## Installation @@ -34,12 +35,14 @@ npm install @knighted/jsx > [!NOTE] > Planning to use the React runtime (`@knighted/jsx/react`)? Install `react@>=18` and `react-dom@>=18` alongside this package so the helper can create elements and render them through ReactDOM. -The parser automatically uses native bindings when it runs in Node.js. To enable the WASM binding for browser builds you also need the `@oxc-parser/binding-wasm32-wasi` package. Because npm enforces the `cpu: ["wasm32"]` flag you must opt into the install explicitly: +The parser automatically uses native bindings when it runs in Node.js. To enable the WASM binding for browser builds you also need the `@oxc-parser/binding-wasm32-wasi` package. The quickest path is: ```sh -npm_config_ignore_platform=true npm install @oxc-parser/binding-wasm32-wasi +npx @knighted/jsx init ``` +See [docs/cli.md](docs/cli.md) for flags, dry runs, and package-manager overrides. If you prefer manual install, run `npm_config_ignore_platform=true npm install @oxc-parser/binding-wasm32-wasi`. + > [!TIP] > Public CDNs such as `esm.sh` or `jsdelivr` already publish bundles that include the WASM binding, so you can import this package directly from those endpoints in `