-
Notifications
You must be signed in to change notification settings - Fork 51
feat(angular)!: migrate to signal inputs and ng-packagr #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8642665
7ed6344
2a648c9
2ed5833
e0068c2
7334ce9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
| "version": 1, | ||
| "cli": { | ||
| "packageManager": "pnpm" | ||
| }, | ||
| "newProjectRoot": "projects", | ||
| "projects": { | ||
| "comark-angular": { | ||
| "projectType": "library", | ||
| "root": "src", | ||
| "sourceRoot": "src", | ||
| "prefix": "comark", | ||
| "architect": { | ||
| "build": { | ||
| "builder": "@angular/build:ng-packagr", | ||
| "options": { | ||
| "project": "ng-package.json" | ||
| }, | ||
| "configurations": { | ||
| "production": { | ||
| "tsConfig": "tsconfig.lib.prod.json" | ||
| }, | ||
| "development": { | ||
| "tsConfig": "tsconfig.lib.json" | ||
| } | ||
| }, | ||
| "defaultConfiguration": "production" | ||
| }, | ||
| "test": { | ||
| "builder": "@angular/build:unit-test", | ||
| "options": { | ||
| "tsConfig": "tsconfig.spec.json", | ||
| "runnerConfig": "vitest.config.ts", | ||
| "include": [ | ||
| "../test/**/*.d.ts", | ||
| "../test/**/*.test.ts" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "$schema": "./node_modules/ng-packagr/ng-package.schema.json", | ||
| "dest": "./dist", | ||
| "lib": { | ||
| "entryFile": "src/index.ts" | ||
| }, | ||
| "allowedNonPeerDependencies": ["comark"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||
| { | ||||||||||||||||||||
| "name": "@comark/angular", | ||||||||||||||||||||
| "version": "0.7.0", | ||||||||||||||||||||
| "sideEffects": false, | ||||||||||||||||||||
| "description": "Angular renderer for Comark. Render Markdown with components at runtime, with streaming support for AI output.", | ||||||||||||||||||||
| "keywords": [ | ||||||||||||||||||||
| "ai", | ||||||||||||||||||||
|
|
@@ -20,47 +21,22 @@ | |||||||||||||||||||
| "type": "git", | ||||||||||||||||||||
| "url": "git+https://github.com/comarkdown/comark.git" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "files": [ | ||||||||||||||||||||
| "dist" | ||||||||||||||||||||
| ], | ||||||||||||||||||||
| "type": "module", | ||||||||||||||||||||
| "sideEffects": false, | ||||||||||||||||||||
| "main": "./dist/index.js", | ||||||||||||||||||||
| "module": "./dist/index.js", | ||||||||||||||||||||
| "types": "./dist/index.d.ts", | ||||||||||||||||||||
| "exports": { | ||||||||||||||||||||
| ".": "./dist/index.js", | ||||||||||||||||||||
| "./plugins/*": "./dist/plugins/*.js", | ||||||||||||||||||||
| "./utils": "./dist/utils/index.js" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "publishConfig": { | ||||||||||||||||||||
| "access": "public" | ||||||||||||||||||||
| "access": "public", | ||||||||||||||||||||
| "directory": "dist" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "scripts": { | ||||||||||||||||||||
| "stub": "node ../../scripts/stub.mjs", | ||||||||||||||||||||
| "build": "ngc -p tsconfig.json && ngc -p tsconfig.json --removeComments true --declaration false && node scripts/verify-build.mjs", | ||||||||||||||||||||
| "dev": "ngc -p tsconfig.json --watch", | ||||||||||||||||||||
| "test": "vitest run", | ||||||||||||||||||||
| "ng": "ng", | ||||||||||||||||||||
| "build": "ng build", | ||||||||||||||||||||
| "dev": "ng build --watch --configuration development", | ||||||||||||||||||||
| "test": "ng test", | ||||||||||||||||||||
| "prepack": "pnpm run build", | ||||||||||||||||||||
| "release": "release-it" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "dependencies": { | ||||||||||||||||||||
| "comark": "workspace:*" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "devDependencies": { | ||||||||||||||||||||
| "@angular/common": "^22.1.7", | ||||||||||||||||||||
| "@angular/compiler": "catalog:", | ||||||||||||||||||||
| "@angular/compiler-cli": "catalog:", | ||||||||||||||||||||
| "@angular/core": "^22.1.7", | ||||||||||||||||||||
| "@angular/platform-browser": "^22.1.7", | ||||||||||||||||||||
| "@angular/platform-server": "catalog:", | ||||||||||||||||||||
| "typescript": "catalog:", | ||||||||||||||||||||
| "vitest": "catalog:" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "peerDependencies": { | ||||||||||||||||||||
| "@angular/common": ">=17.0.0 <22.0.0", | ||||||||||||||||||||
| "@angular/core": ">=17.0.0 <22.0.0", | ||||||||||||||||||||
| "@angular/platform-browser": ">=17.0.0 <22.0.0", | ||||||||||||||||||||
| "@angular/common": ">=19.0.0 <23.0.0", | ||||||||||||||||||||
| "@angular/core": ">=19.0.0 <23.0.0", | ||||||||||||||||||||
|
Comment on lines
37
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: sed -n '1,120p' packages/comark-angular/package.json
sed -n '1,80p' packages/comark-angular/tsconfig.lib.prod.json
sed -n '135,155p' pnpm-workspace.yaml
rg -n 'Angular 19|angular@19|peerDependencies|compilationMode|partial' packages/comark-angular .github package.json pnpm-workspace.yamlRepository: comarkdown/comark Length of output: 3282 🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
🏁 Script executed: set -eu
printf '%s\n' '--- Angular-related files ---'
git ls-files | rg '(^|/)(angular\.json|package\.json|pnpm-workspace\.yaml|.*(test|spec|compat|matrix).*)$' | rg '(^|/)(packages/comark-angular|\.github|package\.json|pnpm-workspace\.yaml)' | head -200
printf '%s\n' '--- Angular package workspace files ---'
find packages/comark-angular -maxdepth 3 -type f -print | sort
printf '%s\n' '--- package and workspace references ---'
rg -n -C 3 'compilationMode|ng-packagr|`@angular/`(common|core|compiler|compiler-cli|cli)|Angular (19|20|21|22)|angularVersion|matrix|peerDependencies' packages/comark-angular .github package.json pnpm-workspace.yaml --glob '!**/node_modules/**' --glob '!**/dist/**' | head -300
printf '%s\n' '--- Angular workspace config ---'
while IFS= read -r f; do
echo "### $f"
sed -n '1,220p' "$f"
done < <(find packages/comark-angular -maxdepth 2 -type f \( -name 'angular.json' -o -name 'tsconfig*.json' \) -print | sort)Repository: comarkdown/comark Length of output: 18667 🏁 Script executed: set -eu
printf '%s\n' '--- packages/comark-angular/angular.json ---'
cat -n packages/comark-angular/angular.json
printf '%s\n' '--- packages/comark-angular/ng-package.json ---'
cat -n packages/comark-angular/ng-package.json
printf '%s\n' '--- package TypeScript configs ---'
for f in packages/comark-angular/tsconfig.json packages/comark-angular/tsconfig.lib.json packages/comark-angular/tsconfig.lib.prod.json packages/comark-angular/tsconfig.spec.json packages/comark-angular/vitest.config.ts; do
echo "### $f"
cat -n "$f"
done
printf '%s\n' '--- repository Angular compatibility references ---'
rg -n -i -C 2 'angular (19|20|21|22)|`@angular/`(common|core).*(19|20|21|22)|matrix|compatib|partial.?ivy|compilationMode|ng-packagr' --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!pnpm-lock.yaml' .github packages/comark-angular examples/2.vite/angular package.json pnpm-workspace.yaml 2>/dev/null | head -400
printf '%s\n' '--- lockfile importer and Angular package versions ---'
rg -n -A 45 -B 3 '^ packages/comark-angular:|^ packages/comark-angular$|`@angular/`(common|compiler|compiler-cli|core|cli):|ng-packagr:' pnpm-lock.yaml | head -250Repository: comarkdown/comark Length of output: 19303 Align the peer range with the Angular build version. The production build uses Angular 22 and The package currently admits Angular 19–21, although the repository builds and tests it with Angular 22. Build and test with Angular 19 to support the full range, or narrow the peer range: Proposed fix- "`@angular/common`": ">=19.0.0 <23.0.0",
- "`@angular/core`": ">=19.0.0 <23.0.0",
+ "`@angular/common`": ">=22.0.0 <23.0.0",
+ "`@angular/core`": ">=22.0.0 <23.0.0",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| "beautiful-mermaid": "catalog:", | ||||||||||||||||||||
| "katex": "catalog:", | ||||||||||||||||||||
| "shiki": "catalog:" | ||||||||||||||||||||
|
|
@@ -75,5 +51,27 @@ | |||||||||||||||||||
| "katex": { | ||||||||||||||||||||
| "optional": true | ||||||||||||||||||||
| } | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "dependencies": { | ||||||||||||||||||||
| "comark": "workspace:*", | ||||||||||||||||||||
| "tslib": "^2.3.0" | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "devDependencies": { | ||||||||||||||||||||
| "@angular-devkit/build-angular": "catalog:", | ||||||||||||||||||||
| "@angular/cli": "catalog:", | ||||||||||||||||||||
|
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Inspect declared builder packages and workspace linking settings without running repository code.
rg -n -C 3 '"`@angular/build`"|"`@angular-devkit/build-angular`"|node-linker|public-hoist-pattern|shamefully-hoist' package.json packages/comark-angular/package.json pnpm-workspace.yaml .npmrc packages/comark-angular/.npmrc 2>/dev/null || trueRepository: comarkdown/comark Length of output: 1332 🏁 Script executed: #!/bin/bash
printf '%s\n' '--- angular workspace builders ---'
cat -n packages/comark-angular/angular.json
printf '%s\n' '--- package manifest ---'
cat -n packages/comark-angular/package.json
printf '%s\n' '--- lockfile importer ---'
rg -n -A 45 -B 5 '^ packages/comark-angular:' pnpm-lock.yaml
printf '%s\n' '--- locked package metadata ---'
rg -n -A 35 -B 3 '(^|/)`@angular-devkit/build-angular`@|(^|/)`@angular/build`@' pnpm-lock.yaml | head -n 180Repository: comarkdown/comark Length of output: 7489 🏁 Script executed: #!/bin/bash
printf '%s\n' '--- all lockfile references ---'
rg -n -F '`@angular-devkit/build-angular`' pnpm-lock.yaml
rg -n -F '`@angular/build`' pnpm-lock.yaml
printf '%s\n' '--- package entries near the exact versions ---'
rg -n -A 45 -B 4 '^ [^[:space:]].*angular-devkit/build-angular|^ [^[:space:]].*angular/build' pnpm-lock.yaml
printf '%s\n' '--- lockfile header and package-section markers ---'
sed -n '1,25p' pnpm-lock.yaml
rg -n '^packages:|^snapshots:' pnpm-lock.yamlRepository: comarkdown/comark Length of output: 24567 Declare
Suggested fix "devDependencies": {
+ "`@angular/build`": "catalog:",
"`@angular-devkit/build-angular`": "catalog:",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| "@angular/common": "catalog:", | ||||||||||||||||||||
| "@angular/compiler": "catalog:", | ||||||||||||||||||||
| "@angular/compiler-cli": "catalog:", | ||||||||||||||||||||
| "@angular/core": "catalog:", | ||||||||||||||||||||
| "@angular/platform-browser": "catalog:", | ||||||||||||||||||||
| "@angular/platform-browser-dynamic": "catalog:", | ||||||||||||||||||||
| "@angular/platform-server": "catalog:", | ||||||||||||||||||||
| "@angular/router": "catalog:", | ||||||||||||||||||||
| "happy-dom": "^20.14.5", | ||||||||||||||||||||
| "ng-packagr": "catalog:", | ||||||||||||||||||||
| "rxjs": "catalog:", | ||||||||||||||||||||
| "typescript": "catalog:", | ||||||||||||||||||||
| "vitest": "catalog:", | ||||||||||||||||||||
| "zone.js": "catalog:" | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export * from 'comark/plugins/binding' | ||
| export { default as binding } from 'comark/plugins/binding' | ||
| export { Binding } from './binding.component' | ||
| export { If } from './if.component' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "$schema": "../../../node_modules/ng-packagr/ng-entrypoint.schema.json", | ||
| "lib": { | ||
| "entryFile": "index.ts" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export * from 'comark/plugins/math' | ||
| export { default as math } from 'comark/plugins/math' | ||
| export { Math } from './math.component' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Use one publish-directory setting.
npm.publishPathmakes release-it publish fromdist, whilepackages/comark-angular/package.jsonalso setspublishConfig.directorytodist.ng-packagr22 copies that setting intodist/package.json. The release command can therefore targetdist/dist; publishing fromdistalso leaves the generatedcomark: "workspace:*"dependency outside its workspace resolution context. RemovepublishPathand publish from the package root using itspublishConfig.directorysetting. (github.com)🤖 Prompt for AI Agents