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 15, 2024
1 parent 45aec83 commit 3a60aad
Show file tree
Hide file tree
Showing 25 changed files with 922 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ 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 check
- run: npm run format:check
- run: npm run lint
- name: check stackblitz angular lockfile
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build code-coverage core
- run: npm run build:coverage
- run: npm run e2e -- --shard=${{ matrix.shard }}/${{ strategy.job-total}}
- id: check_lcov
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dist.tar.gz
.nyc_output/
.idea
style-bootstrap/css/
generated
generated
.wireit
49 changes: 45 additions & 4 deletions angular/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,54 @@
"type": "module",
"scripts": {
"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",
"dev": "wireit",
"dev:coverage": "wireit",
"build": "wireit",
"build:coverage": "wireit",
"watch": "ng build --watch --configuration development",
"preview": "node scripts/preview.cjs dist --port 4200 --single"
},
"wireit": {
"dev": {
"command": "ng serve",
"dependencies": [
"../headless:generate:exports"
],
"service": true
},
"dev:coverage": {
"command": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/@angular/cli/bin/ng.js serve",
"dependencies": [
"../../code-coverage:build",
"../headless:generate:exports"
],
"service": true
},
"build": {
"command": "ng build",
"dependencies": [
"../lib:build",
"../../style-bootstrap:build"
],
"files": [
"src/**",
"angular.json",
"tsconfig.json",
"webpack.cjs"
],
"output": [
"dist/**"
]
},
"build:coverage": {
"command": "node --import @agnos-ui/code-coverage/interceptReadFile ../../node_modules/@angular/cli/bin/ng.js build --configuration=coverage",
"dependencies": [
"../lib:build",
"../../style-bootstrap:build",
"../../code-coverage:build"
]
}
},
"dependencies": {
"@agnos-ui/angular-headless": "",
"@agnos-ui/angular": "",
Expand Down
75 changes: 70 additions & 5 deletions angular/headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,79 @@
},
"scripts": {
"ng": "ng",
"build": "run-s generate:exports build:*",
"generate:exports": "node ../../scripts/generateExports.js angular/headless core @agnos-ui/core",
"build:src": "ng build",
"build:pkg": "node ../../scripts/buildPackageJson.js dist dist .",
"build": "wireit",
"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": {
"generate:exports": {
"command": "node ../../scripts/generateExports.js angular/headless core @agnos-ui/core",
"files": [
"src/**",
"../../core/src/**",
"!src/generated/**",
"../../scripts/generateExports.js"
],
"output": [
"src/generated/**"
]
},
"build:src": {
"command": "ng build",
"dependencies": [
"generate:exports",
"../../core:build"
],
"files": [
"src/**",
"!src/generated/**",
"tsconfig.json",
"angular.json",
"ng-package.json"
],
"output": [
"dist/**",
"!dist/README.md",
"!dist/package.json"
]
},
"build:pkg": {
"command": "node ../../scripts/buildPackageJson.js . dist",
"dependencies": [
"build:src"
],
"files": [
"../../scripts/buildPackageJson.js",
"package.json",
"README.md"
],
"output": [
"dist/README.md",
"dist/package.json"
]
},
"build": {
"dependencies": [
"build:pkg"
]
},
"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
42 changes: 41 additions & 1 deletion angular/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,47 @@
},
"scripts": {
"ng": "ng",
"build": "ng build && node ../../scripts/buildPackageJson.js dist dist ."
"build": "wireit"
},
"wireit": {
"build:src": {
"command": "ng build",
"dependencies": [
"../headless:build"
],
"files": [
"src/**",
"!src/generated/**",
"tsconfig.json",
"angular.json",
"ng-package.json"
],
"output": [
"dist/**",
"!dist/README.md",
"!dist/package.json"
]
},
"build:pkg": {
"command": "node ../../scripts/buildPackageJson.js . dist",
"dependencies": [
"build:src"
],
"files": [
"../../scripts/buildPackageJson.js",
"package.json",
"README.md"
],
"output": [
"dist/README.md",
"dist/package.json"
]
},
"build": {
"dependencies": [
"build:pkg"
]
}
},
"peerDependencies": {
"@angular/common": "*",
Expand Down
44 changes: 40 additions & 4 deletions base-po/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,46 @@
"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:rollup": "tsc && vite build",
"build:dts": "tsc -p tsconfig.d.json",
"build:api-extractor": "api-extractor run"
"build": "wireit"
},
"wireit": {
"build:src": {
"command": "vite build",
"files": [
"lib/**",
"vite.config.ts"
],
"output": [
"dist/lib/index.js",
"dist/lib/index.mjs"
]
},
"build:dts": {
"command": "tsc -p tsconfig.d.json",
"files": [
"lib/**",
"tsconfig.json",
"tsconfig.d.json"
],
"output": [
"dist/dts/**"
]
},
"build": {
"command": "api-extractor run",
"dependencies": [
"build:src",
"build:dts"
],
"files": [
"lib/**",
"tsconfig.json",
"tsconfig.d.json"
],
"output": [
"dist/lib/index.d.ts"
]
}
},
"peerDependencies": {
"@playwright/test": "*"
Expand Down
2 changes: 1 addition & 1 deletion code-coverage/lib/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
export const rootFolder = path.join(__dirname, '..', '..', '..');

export const filter = createFilter(
['core/**/*', 'angular/{headless,lib}/src/**/*', 'react/{headless,lib}/**/*', 'svelte/{headless,lib}/**/*'],
['core/src/**/*', 'angular/{headless,lib}/src/**/*', 'react/{headless,lib}/src/**/*', 'svelte/{headless,lib}/src/**/*'],
['node_modules', '**/*.spec.ts', '**/__mocks__/**'],
{
resolve: rootFolder,
Expand Down
18 changes: 15 additions & 3 deletions code-coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,21 @@
"vite": "^5.0.11"
},
"scripts": {
"build": "npm run build:rollup && npm run build:dts",
"build:rollup": "tsc && vite build",
"build:dts": "tsc -p tsconfig.d.json"
"build": "wireit"
},
"wireit": {
"build": {
"command": "vite build && tsc -p tsconfig.d.json",
"files": [
"lib/**",
"tsconfig.json",
"tsconfig.d.json",
"vite.config.ts"
],
"output": [
"dist/**"
]
}
},
"type": "module",
"exports": {
Expand Down
Loading

0 comments on commit 3a60aad

Please sign in to comment.