Skip to content

Commit

Permalink
Chore(tests): Update Turbo + Github actions to run everything
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jul 9, 2024
1 parent 55ae385 commit b43cd2d
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 27 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
node-version: 20
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Typescript
run: yarn turbo tsc
- name: Typescript - packages
run: yarn tsc
- name: Typescript - test files
run: yarn tsc:test
- name: Eslint
run: yarn eslint .
- name: Validate package setup
Expand Down Expand Up @@ -63,7 +65,7 @@ jobs:
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- name: Typescript
run: yarn turbo tsc
run: yarn tsc
- name: Integration tests
run: yarn node --test integration/

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ yarn prettier --write .
## Type checking

```sh
yarn turbo tsc
yarn tsc
```

## Running demos

```sh
# First you need to build the prompts; and every time you change code.
yarn turbo tsc
# This command will launch tsc in watch mode
yarn dev

# Then run the demos
yarn node packages/demo
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@
"prepare": "husky && turbo tsc attw",
"setup": "node ./tools/setup-packages.mjs",
"pretest": "eslint . && turbo tsc",
"test": "vitest --run packages && node --test integration/**/*.test.*"
"test": "vitest --run packages && node --test integration/**/*.test.*",
"dev": "turbo tsc:watch --concurrency 17",
"tsc": "turbo tsc",
"tsc:test": "tsc -p tsconfig.test.json",
"tsc:watch": "tsc -p tsconfig.test.json --watch"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/confirm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/expand/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/figures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/inquirer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/number/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/password/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/prompts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rawlist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/type/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"dev": "tsc -p ./tsconfig.json --watch",
"tsc:watch": "tsc -p ./tsconfig.json --watch",
"attw": "attw --pack"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion tools/setup-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ paths.forEach(async (pkgPath) => {
'tsc:esm': 'rm -rf dist/esm && tsc -p ./tsconfig.json',
'tsc:cjs':
'rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs',
dev: 'tsc -p ./tsconfig.json --watch',
'tsc:watch': 'tsc -p ./tsconfig.json --watch',
attw: emitDeclaration ? 'attw --pack' : undefined,
};

Expand Down
12 changes: 8 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"attw": {
"dependsOn": ["tsc"],
"outputs": []
},
"tsc": {
"dependsOn": ["^tsc"],
"outputs": ["dist/**"],
"inputs": ["$TURBO_DEFAULT$", "../../tools/fix-ext.mjs", "../../tsconfig.json"]
},
"attw": {
"dependsOn": ["tsc"],
"outputs": []
"tsc:watch": {
"cache": false,
"persistent": true
},
"dev": {
"//#tsc:watch": {
"cache": false,
"persistent": true
}
Expand Down

0 comments on commit b43cd2d

Please sign in to comment.