feat: scaffold template-lib-angular as a single Angular library project - #10
Merged
Conversation
Run `ng generate library` to add @dnd-mapp/template-lib-angular under projects/, built via ng-packagr, with a placeholder `add` function and its test as the public API surface. Wire its build/test/lint targets to match the repo's existing conventions (coverage thresholds, reporters, vitest runner), and add it to the root tsconfig's project references. The app project stays in place for now; it's removed next.
Drop src/main.ts, src/index.html, src/core/**, src/styles.scss, and tsconfig.app.json/tsconfig.spec.json, and drop the "app" project and its now-dead @/core path aliases now that template-lib-angular is the repo's only project. The library's own tsconfig.spec.json now carries vitest.config.ts in its "files" list (as the removed root tsconfig.spec.json used to), keeping it covered by typed linting.
package.json's name still said template-app-angular; align it and the Vitest project name with the library this repo now scaffolds.
@angular/cdk, @angular/forms, and @angular/router were only needed by the removed app.routes.ts, forms usage, and CDK test harness — nothing in the library or its tests references them.
The design-system SCSS layer and the app's global styles.scss are both gone, so `stylelint "**/*.scss"` matches nothing and hard-fails. --allow-empty-input keeps the script a no-op instead of removing Stylelint outright, since a future component in this library may still want it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructure this repo from the
template-app-angularapplication clone into a library-only workspace, per the "Angular Library Template" map's destination. Redo of #8 (closed unmerged): that attempt left the rootpackage.json's name unchanged and shipped theng generate libraryboilerplate README as-is (Karma/e2e references that don't apply here).ng generate libraryto scaffold@dnd-mapp/template-lib-angularunderprojects/, with a placeholderaddfunction and its test as the public API surfacesrc/main.ts,src/index.html,src/core/**,src/styles.scss) and the now-orphanedtsconfig.app.json/tsconfig.spec.jsonappproject fromangular.json, and wired the library's build/test/lint targets to match the repo's existing vitest/coverage conventionspackage.json'snameto@dnd-mapp/template-lib-angular@angular/cdk,@angular/forms, and@angular/router, which were only needed by the removed app bootstrap--allow-empty-input) now that no.scssfiles remain in the repo, rather than removing it outrightOut of scope here: CI (
.github/actions/ci/action.ymlstill callspnpm lint-css, fine since it's now a no-op) and docs (README.md,docs/guides/dev/usage.md) still reference the old app-based workflow, since those belong to "Rewrite CI for npm publish" and "Rewrite docs and package metadata", both blocked on this PR.Related issues
Resolves #2
Checklist