{"id":18878677,"url":"https://github.com/nowzoo/ngx-library-starter","last_synced_at":"2026-05-01T18:31:59.008Z","repository":{"id":93412633,"uuid":"135312365","full_name":"nowzoo/ngx-library-starter","owner":"nowzoo","description":"This is a Angular Library starter built with Angular CLI with some useful changes meant to make it easier to develop both a library and a GitHub hosted demo site simultaneously.","archived":false,"fork":false,"pushed_at":"2018-06-06T17:59:34.000Z","size":207,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-31T05:31:27.297Z","etag":null,"topics":["angular","angular6","demo","library","wallaby"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nowzoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-29T14:57:22.000Z","updated_at":"2018-06-06T17:59:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a718de0-c8d8-43d0-953b-31620954df85","html_url":"https://github.com/nowzoo/ngx-library-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nowzoo/ngx-library-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowzoo%2Fngx-library-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowzoo%2Fngx-library-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowzoo%2Fngx-library-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowzoo%2Fngx-library-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowzoo","download_url":"https://codeload.github.com/nowzoo/ngx-library-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowzoo%2Fngx-library-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular6","demo","library","wallaby"],"created_at":"2024-11-08T06:29:03.671Z","updated_at":"2026-05-01T18:31:58.985Z","avatar_url":"https://github.com/nowzoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AngularLibraryStarter\n\nThis is an Angular library starter built with [Angular CLI](https://github.com/angular/angular-cli).\n\nIncluded are some useful changes meant to make it easier to simultaneously develop an Angular library and a GitHub-hosted demo site for that library.\n\n- The default app in `src/app` is the demo site. It is built to `docs` - making it easy to publish on Github.\n- There's a sample library, `@nowzoo/ngx-library-starter`, in `projects/ngx-library-starter`.\n- Wallaby has been set up to test the library. (You don't have to use Wallaby, though.)\n\n## Quick Start\n\n\n```bash\n# clone this repo into your-library-name\ngit clone https://github.com/nowzoo/ngx-library-starter.git your-repo-name\ncd your-library-name\n# install the deps...\nnpm i\n# build the sample library...\nng build ngx-library-starter\n# run the demo app\nng serve --open\n```\n\n## Adding a real library\nGenerate...\n\n```bash\nng g library your-lib --prefix your-lib\n```\n### Optional step: add your NPM org namespace ...\nEdit `projects/your-lib/package.json`. Add the namespace to the `name` field:\n```json\n{\n  \"name\": \"@your-org/your-lib\",\n  \"version\": \"0.0.1\",\n  \"peerDependencies\": {\n    \"@angular/common\": \"^6.0.0-rc.0 || ^6.0.0\",\n    \"@angular/core\": \"^6.0.0-rc.0 || ^6.0.0\"\n  }\n}\n```\nEdit `tsconfig.json` in the root directory. Under `compilerOptions.paths` change the keys from...\n\n```js\n{\n\n  \"paths\": {\n    \"your-lib\": [\n      \"dist/your-lib\"\n    ],\n    \"your-lib/*\": [\n      \"dist/your-lib/*\"\n    ]\n  }\n}\n```\n...to...\n```js\n{\n\n  \"paths\": {\n    \"@your-org/your-lib\": [\n      \"dist/your-lib\"\n    ],\n    \"@your-org/your-lib/*\": [\n      \"dist/your-lib/*\"\n    ]\n  }\n}\n```\n\n\n### Optional step: add Wallaby support for the new library\n\n#### Copy the library Wallaby files to the new library...\n```bash\n# the wallaby.js\ncp projects/ngx-library-starter/wallaby.js projects/your-lib/\n\n# the wallaby-specific tsconfig for the library...\ncp projects/ngx-library-starter/tsconfig.wallaby.spec.json projects/your-lib/\n\n# wallabyTest.ts\ncp projects/ngx-library-starter/src/wallabyTest.ts projects/your-lib/src/\n```\n\n#### Exclude `wallabyTest.ts` from `tsconfig.lib.json`\nIn `projects/your-lib/tsconfig.lib.json`...\n```js\n{\n  // ... other stuff...\n  \"exclude\": [\n    \"src/test.ts\",\n    \"src/wallabyTest.ts\",\n    \"**/*.spec.ts\"\n  ]\n}\n\n```\n- copy `projects/ngx-library-starter/wallaby.js` to `projects/your-lib/wallaby.js`\n- copy `projects/ngx-library-starter/tsconfig.wallaby.spec.json` to `projects/your-lib/tsconfig.wallaby.spec.json`\n- copy `projects/ngx-library-starter/src/wallabyTest.ts` to `projects/your-lib/src/wallabyTest.ts`\n- edit `projects/your-lib/tsconfig.lib.json`. Add `src/wallabyTest.ts` to `exclude`.\n\n\n#### Add an alias for the new library to the main `wallaby.js`\nIf your demo app uses the library, you may want to add an alias in the main `wallaby.js` config. In the config you pass to `wallabyWebpack()`, add an entry to `resolve.alias`:\n\n```js\nvar webpackPostprocessor = wallabyWebpack({\n  // other stuff...\n  resolve: {\n    //other stuff...\n    alias: {\n      '@nowzoo/ngx-library-starter': path.resolve(wallaby.localProjectDir,  'dist', 'ngx-library-starter'),\n      // add...\n      'your-lib': path.resolve(wallaby.localProjectDir, 'dist', 'your-lib'),\n      // or with an NPM org...\n      '@your-org/your-lib': path.resolve(wallaby.localProjectDir, 'dist', 'your-lib')\n    }\n    // other stuff\n  }\n});\n\n```\n\n## Running unit tests for the library\n\nAngular CLI:\n```bash\nng test your-lib\n```\nWallaby: select `projects/your-lib/wallaby.js` as the config file.\n\n## Running unit tests for the demo app\nWhen unit testing the demo app remember to build the latest version of your library first:\n\n```bash\nng build your-lib --prod\n```\n\nAngular CLI:\n```bash\nng test your-lib\n```\nWallaby: just select `wallaby.js` in the root directory as the config file.\n\n## Publishing to NPM\n\nEdit `projects/your-lib/package.json`.\n - Update the version.\n - Provide a description, keywords, etc.\n\nBuild the library...\n```bash\nng build your-lib --prod\n```\nCopy `LICENSE` and `README.md` into the distribution.\n```bash\ncp LICENSE README.md dist/your-lib\n```\n\nPublish...\n```bash\n# change into the distribution directory...\ncd dist/your-lib\n\n# publish...\nnpm publish --access public\n\n# change back...\ncd ../..\n```\n\n## Publishing the demo app to GitHub pages\n\nIf you haven't done so already, create a repo on GitHub and update the remotes...\n\n```bash\ngit remote remove origin\ngit remote add origin git@github.com:you/your-lib.git\n```\n\nBuild the demo app. Make sure to set the base href to whatever the name of your repo is.\n```bash\nng build --aot --prod --base-href /your-lib/\n```\n\nThis puts the demo app into the `docs` directory, ready for publishing on GitHub.\n```bash\ngit add -A\ngit commit -m 'demo app built'\ngit push origin master\n```\n\nOn GitHub, go to the repo's settings page. Under GitHub Pages, set the source to be **Master branch docs folder**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowzoo%2Fngx-library-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowzoo%2Fngx-library-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowzoo%2Fngx-library-starter/lists"}