diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bc96d03 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v5 + with: + node-version-file: .nvmrc + cache: npm + + - run: npm ci + + - name: Format + run: npm run format:check + + # `ng test` type-checks tsconfig.spec.json and `ng build` type-checks + # tsconfig.app.json *including templates* (strictTemplates), so every .ts + # file is already type-checked by the steps below. A separate + # `tsc --noEmit` step would be redundant. + - name: Test + run: npm run test:coverage + + - name: Build + run: npm run build diff --git a/.gitignore b/.gitignore index 854acd5..325d71e 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,11 @@ testem.log /typings __screenshots__/ +# Local secrets / machine-local settings +.env +.env.* +.claude/settings.local.json + # System files .DS_Store Thumbs.db diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9634284 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist/ +.angular/ +coverage/ +package-lock.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 925af83..f30a599 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,13 +8,6 @@ "request": "launch", "preLaunchTask": "npm: start", "url": "http://localhost:4200/" - }, - { - "name": "ng test", - "type": "chrome", - "request": "launch", - "preLaunchTask": "npm: test", - "url": "http://localhost:9876/debug.html" } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 244306f..c8663ee 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,25 +15,7 @@ "regexp": "Changes detected" }, "endsPattern": { - "regexp": "bundle generation (complete|failed)" - } - } - } - }, - { - "type": "npm", - "script": "test", - "isBackground": true, - "problemMatcher": { - "owner": "typescript", - "pattern": "$tsc", - "background": { - "activeOnStart": true, - "beginsPattern": { - "regexp": "Changes detected" - }, - "endsPattern": { - "regexp": "bundle generation (complete|failed)" + "regexp": "Application bundle generation (complete|failed)" } } } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f745c24 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 ng-signals-template contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/angular.json b/angular.json index 46d6df7..ea90764 100644 --- a/angular.json +++ b/angular.json @@ -25,9 +25,7 @@ "input": "public" } ], - "styles": [ - "src/styles.css" - ] + "styles": ["src/styles.css"] }, "configurations": { "production": { @@ -66,7 +64,17 @@ "defaultConfiguration": "development" }, "test": { - "builder": "@angular/build:unit-test" + "builder": "@angular/build:unit-test", + "options": { + "coverageExclude": ["src/main.ts", "**/*.spec.ts"], + "coverageReporters": ["text-summary", "lcovonly"], + "coverageThresholds": { + "statements": 90, + "branches": 90, + "functions": 85, + "lines": 95 + } + } } } } diff --git a/package-lock.json b/package-lock.json index 9a4df71..b6df114 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,11 @@ "": { "name": "ng-signals-template", "version": "0.0.0", + "license": "MIT", "dependencies": { "@angular/common": "^22.1.0", "@angular/compiler": "^22.1.0", "@angular/core": "^22.1.0", - "@angular/forms": "^22.1.0", "@angular/platform-browser": "^22.1.0", "@angular/router": "^22.1.0", "rxjs": "~7.8.0", @@ -26,6 +26,9 @@ "prettier": "^3.8.1", "typescript": "~6.0.2", "vitest": "^4.0.8" + }, + "engines": { + "node": "^22.22.3 || ^24.15.0 || >=26.0.0" } }, "node_modules/@acemir/cssom": { @@ -373,26 +376,6 @@ } } }, - "node_modules/@angular/forms": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-22.1.0.tgz", - "integrity": "sha512-nWlSM/pPp78Sx/fBM/tFEgZxdfZe50LkCE2/hkO22Fi1UM2maGc43LDsu/s6l0q9hFep4Wj+xa30KXDBS7Cn8A==", - "license": "MIT", - "dependencies": { - "@standard-schema/spec": "^1.0.0", - "tslib": "^2.3.0", - "zod": "^4.0.10" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0.0" - }, - "peerDependencies": { - "@angular/common": "22.1.0", - "@angular/core": "22.1.0", - "@angular/platform-browser": "22.1.0", - "rxjs": "^6.5.3 || ^7.4.0" - } - }, "node_modules/@angular/platform-browser": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-22.1.0.tgz", @@ -3418,6 +3401,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, "license": "MIT" }, "node_modules/@tybys/wasm-util": { @@ -8085,6 +8069,7 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index c790fbf..1e16fa8 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,19 @@ { "name": "ng-signals-template", "version": "0.0.0", + "license": "MIT", + "engines": { + "node": "^22.22.3 || ^24.15.0 || >=26.0.0" + }, "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", - "test": "ng test" + "test": "ng test", + "test:coverage": "ng test --coverage", + "format": "prettier --write .", + "format:check": "prettier --check ." }, "private": true, "packageManager": "npm@11.12.1", @@ -14,7 +21,6 @@ "@angular/common": "^22.1.0", "@angular/compiler": "^22.1.0", "@angular/core": "^22.1.0", - "@angular/forms": "^22.1.0", "@angular/platform-browser": "^22.1.0", "@angular/router": "^22.1.0", "rxjs": "~7.8.0", diff --git a/src/app/app.css b/src/app/app.css deleted file mode 100644 index e69de29..0000000