Skip to content

Commit

Permalink
feat: setup wireit
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinderoubaix committed Jan 8, 2024
1 parent b537404 commit ef444a5
Show file tree
Hide file tree
Showing 21 changed files with 459 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npx playwright install --with-deps
- uses: google/wireit@setup-github-actions-caching/v1
- run: npm run syncpack:check
- run: |
git config --global user.name github-actions
Expand All @@ -47,7 +48,7 @@ jobs:
git commit -a -m v${{ inputs.version }}
git tag v${{ inputs.version }}
git show HEAD
- run: npm run build
- run: npm run build:ci
- run: npm run format:check
- run: npm run lint
- name: check stackblitz angular lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build code-coverage core
- uses: google/wireit@setup-github-actions-caching/v1
- run: npm run build:coverage
- run: npm run e2e -- --shard=${{ matrix.shard }}/${{ strategy.job-total}}
- id: check_lcov
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ dist.tar.gz
.nyc_output/
.idea
style-bootstrap/css/
generated
generated
.wireit
.eslintcache
36 changes: 34 additions & 2 deletions angular/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,43 @@
"ng": "ng",
"dev": "ng serve",
"dev:coverage": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/@angular/cli/bin/ng.js serve",
"build": "ng build",
"build:coverage": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/@angular/cli/bin/ng.js build --configuration=coverage",
"build": "wireit",
"build:coverage": "wireit",
"watch": "ng build --watch --configuration development",
"preview": "node scripts/preview.cjs dist --port 4200 --single"
},
"wireit": {
"build": {
"command": "ng build",
"dependencies": [
"../lib:build",
"../../style-bootstrap:build"
],
"files": [
"src/**",
"tsconfig.json",
"angular.json"
],
"output": [
"dist/**"
]
},
"build:coverage": {
"command": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/@angular/cli/bin/ng.js build --configuration=coverage",
"dependencies": [
"../../code-coverage:build"
],
"files": [
"src/**",
"tsconfig.json",
"tsconfig.dev.json",
"angular.json"
],
"output": [
"dist/**"
]
}
},
"dependencies": {
"@agnos-ui/angular-headless": "",
"@agnos-ui/angular": "",
Expand Down
36 changes: 34 additions & 2 deletions angular/headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,46 @@
},
"scripts": {
"ng": "ng",
"build": "run-s generate:exports build:*",
"build": "wireit",
"generate:exports": "node ../../scripts/generateExports.js angular/headless core @agnos-ui/core",
"build:src": "ng build",
"build:pkg": "node ../../scripts/buildPackageJson.js dist dist .",
"test": "vitest run",
"tdd": "vitest",
"tdd:ui": "vitest --ui",
"test:coverage": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/vitest/vitest.mjs run --coverage"
"test:coverage": "wireit"
},
"wireit": {
"build": {
"command": "run-s generate:exports build:*",
"dependencies": [
"../../core:build"
],
"files": [
"src/**",
"!src/generated",
"tsconfig.json",
"angular.json"
],
"output": [
"dist/**"
]
},
"test:coverage": {
"command": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/vitest/vitest.mjs run --coverage",
"dependencies": [
"../../code-coverage:build"
],
"files": [
"src/**",
"!src/generated",
"tsconfig.spec.json",
"vitest.config.ts"
],
"output": [
"coverage/**"
]
}
},
"peerDependencies": {
"@angular/common": "*",
Expand Down
18 changes: 17 additions & 1 deletion angular/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,23 @@
},
"scripts": {
"ng": "ng",
"build": "ng build && node ../../scripts/buildPackageJson.js dist dist ."
"build": "wireit"
},
"wireit": {
"build": {
"command": "ng build && node ../../scripts/buildPackageJson.js dist dist .",
"dependencies": [
"../headless:build"
],
"files": [
"src/**",
"tsconfig.json",
"angular.json"
],
"output": [
"dist/**"
]
}
},
"peerDependencies": {
"@angular/common": "*",
Expand Down
16 changes: 15 additions & 1 deletion base-po/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,25 @@
"module": "dist/lib/index.mjs",
"types": "dist/lib/index.d.ts",
"scripts": {
"build": "npm run build:rollup && npm run build:dts && npm run build:api-extractor",
"build": "wireit",
"build:rollup": "tsc && vite build",
"build:dts": "tsc -p tsconfig.d.json",
"build:api-extractor": "api-extractor run"
},
"wireit": {
"build": {
"command": "npm run build:rollup && npm run build:dts && npm run build:api-extractor",
"files": [
"lib/**",
"tsconfig.json",
"tsconfig.d.json",
"vite.config.ts"
],
"output": [
"dist/**"
]
}
},
"peerDependencies": {
"@playwright/test": "*"
},
Expand Down
16 changes: 15 additions & 1 deletion code-coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,24 @@
"vite": "^5.0.11"
},
"scripts": {
"build": "npm run build:rollup && npm run build:dts",
"build": "wireit",
"build:rollup": "tsc && vite build",
"build:dts": "tsc -p tsconfig.d.json"
},
"wireit": {
"build": {
"command": "npm run build:rollup && npm run build:dts",
"files": [
"lib/**",
"tsconfig.json",
"tsconfig.d.json",
"vite.config.ts"
],
"output": [
"dist/**"
]
}
},
"type": "module",
"exports": {
"./vitePlugin": {
Expand Down
31 changes: 28 additions & 3 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,41 @@
}
},
"scripts": {
"build": "run-s clean:dist build:*",
"clean:dist": "node ../scripts/rm.js dist",
"build": "wireit",
"build:src": "tsc",
"build:pkg": "node ../scripts/buildPackageJson.js . dist",
"build:api-extractor": "api-extractor run",
"check:tests": "tsc -p tsconfig.tests.json",
"test": "npm run check:tests && vitest run",
"tdd": "vitest",
"tdd:ui": "vitest --ui",
"test:coverage": "node --import @agnos-ui/code-coverage/interceptReadFile ../node_modules/vitest/vitest.mjs run --coverage"
"test:coverage": "wireit"
},
"wireit": {
"build": {
"command": "run-s build:*",
"files": [
"src/**",
"tsconfig.json"
],
"output": [
"dist/**"
]
},
"test:coverage": {
"command": "node --import @agnos-ui/code-coverage/interceptReadFile ../node_modules/vitest/vitest.mjs run --coverage",
"dependencies": [
"../code-coverage:build"
],
"files": [
"src/**",
"tsconfig.tests.json",
"vitest.config.ts"
],
"output": [
"coverage/**"
]
}
},
"dependencies": {
"@amadeus-it-group/tansu": "0.0.24"
Expand Down
50 changes: 48 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,59 @@
"type": "module",
"scripts": {
"dev": "npm run generate:doc && vite dev",
"build": "npm run generate:doc && npm run build:demo && npm run svelte-check",
"build:coverage": "npm run generate:doc && npm run build:demo",
"build": "wireit",
"build:coverage": "wireit",
"build:demo": "vite build",
"generate:doc": "ts-node --project ../scripts/doc/tsconfig.json ../scripts/doc/generate-docs.ts",
"preview": "vite preview",
"svelte-check": "svelte-check"
},
"wireit": {
"build": {
"command": "npm run generate:doc && npm run build:demo && npm run svelte-check",
"dependencies": [
"../angular/demo:build",
"../react/demo:build",
"../svelte/demo:build"
],
"files": [
"src/**",
"static/**",
"svelte.config.js",
"vite.config.ts",
"vite-env.d.ts",
"tsconfig.json",
"tsconfig.sw.json"
],
"output": [
"dist/**",
".svelte-kit/**",
"generated/**"
]
},
"build:coverage": {
"command": "npm run generate:doc && npm run build:demo",
"dependencies": [
"../angular/demo:build:coverage",
"../react/demo:build:coverage",
"../svelte/demo:build:coverage"
],
"files": [
"src/**",
"static/**",
"svelte.config.js",
"vite.config.ts",
"vite-env.d.ts",
"tsconfig.json",
"tsconfig.sw.json"
],
"output": [
"dist/**",
".svelte-kit/**",
"generated/**"
]
}
},
"dependencies": {
"@floating-ui/dom": "^1.5.4",
"highlight.js": "^11.9.0"
Expand Down
29 changes: 27 additions & 2 deletions eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,35 @@
"svelte-eslint-parser": "^0.33.1"
},
"scripts": {
"build": "tsc && vite build",
"build": "wireit",
"tdd": "vitest",
"tdd:ui": "vitest --ui",
"test": "vitest run",
"test:coverage": "vitest run --coverage"
"test:coverage": "wireit"
},
"wireit": {
"build": {
"command": "tsc && vite build",
"files": [
"src/**",
"tsconfig.json",
"vite.config.ts"
],
"output": [
"dist/**"
]
},
"test:coverage": {
"command": "vitest run --coverage",
"files": [
"src/**",
"test/**",
"tsconfig.json",
"vitest.config.ts"
],
"output": [
"coverage/**"
]
}
}
}
Loading

0 comments on commit ef444a5

Please sign in to comment.