Skip to content
Snippets Groups Projects
Unverified Commit 56faee0b authored by Thuc Pham's avatar Thuc Pham Committed by GitHub
Browse files

fix: fix windows e2e (#13)

parent abb74888
No related branches found
No related tags found
No related merge requests found
---
"create-llama": patch
---
Add windows e2e tests
...@@ -17,7 +17,7 @@ jobs: ...@@ -17,7 +17,7 @@ jobs:
matrix: matrix:
node-version: [18, 20] node-version: [18, 20]
python-version: ["3.11"] python-version: ["3.11"]
os: [macos-latest] #, windows-latest] os: [macos-latest, windows-latest]
defaults: defaults:
run: run:
shell: bash shell: bash
...@@ -47,7 +47,7 @@ jobs: ...@@ -47,7 +47,7 @@ jobs:
run: pnpm run build run: pnpm run build
working-directory: . working-directory: .
- name: Install - name: Install
run: pnpm run install-local run: pnpm run pack-install
working-directory: . working-directory: .
- name: Run Playwright tests - name: Run Playwright tests
run: pnpm run e2e run: pnpm run e2e
......
...@@ -45,3 +45,6 @@ e2e/cache ...@@ -45,3 +45,6 @@ e2e/cache
# intellij # intellij
**/.idea **/.idea
# build artifacts
create-llama-*.tgz
...@@ -32,10 +32,10 @@ To install it, call: ...@@ -32,10 +32,10 @@ To install it, call:
pnpm exec playwright install --with-deps pnpm exec playwright install --with-deps
``` ```
Then you can first install the `create-llama` command locally: Then you can create a global `create-llama` command (used by the e2e tests) that is linked to your local dev environment (if you update the build, you don't need to re-link):
``` ```
pnpm run install-local pnpm link --global
``` ```
And then finally run the tests: And then finally run the tests:
......
#!/usr/bin/env node
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import { execSync } from "child_process"; import { execSync } from "child_process";
import Commander from "commander"; import Commander from "commander";
......
...@@ -24,15 +24,15 @@ ...@@ -24,15 +24,15 @@
"format": "prettier --ignore-unknown --cache --check .", "format": "prettier --ignore-unknown --cache --check .",
"format:write": "prettier --ignore-unknown --write .", "format:write": "prettier --ignore-unknown --write .",
"dev": "ncc build ./index.ts -w -o dist/", "dev": "ncc build ./index.ts -w -o dist/",
"build": "npm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register", "build": "bash ./scripts/build.sh",
"lint": "eslint . --ignore-pattern dist --ignore-pattern e2e/cache", "lint": "eslint . --ignore-pattern dist --ignore-pattern e2e/cache",
"e2e": "playwright test", "e2e": "playwright test",
"prepare": "husky", "prepare": "husky",
"install-local": "pnpm link --global",
"release": "pnpm run build && changeset publish", "release": "pnpm run build && changeset publish",
"new-version": "pnpm run build && changeset version", "new-version": "pnpm run build && changeset version",
"release-snapshot": "pnpm run build && changeset publish --tag snapshot", "release-snapshot": "pnpm run build && changeset publish --tag snapshot",
"new-snapshot": "pnpm run build && changeset version --snapshot" "new-snapshot": "pnpm run build && changeset version --snapshot",
"pack-install": "bash ./scripts/pack.sh"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.41.1", "@playwright/test": "^1.41.1",
......
#!/usr/bin/env bash
# build dist/index.js file
npm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register
# add shebang to the top of dist/index.js (space after shebang is to fix windows issue)
echo '#!/usr/bin/env node ' | cat - dist/index.js > temp && mv temp dist/index.js
\ No newline at end of file
#!/usr/bin/env bash
pnpm pack && npm install -g $(pwd)/$(ls ./*.tgz | head -1)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment