diff --git a/README.md b/README.md index 8c3b60a..2c7d9c5 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ If you would like to propose a challenge, this project is open source, so feel f
nx +Create harness + ## Contributors ✨ @@ -86,7 +88,7 @@ If you would like to propose a challenge, this project is open source, so feel f - +
Thomas Laforge
Thomas Laforge

24 🧩
Thomas Laforge
Thomas Laforge

25 🧩
diff --git a/apps/anchor-scrolling/README.md b/apps/anchor-scrolling/README.md index dad19bb..a6778c6 100644 --- a/apps/anchor-scrolling/README.md +++ b/apps/anchor-scrolling/README.md @@ -15,7 +15,7 @@ You begin with an application that has basic navigation and anchor navigation in 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve anchor-scrolling` 5. _...work on it_ 6. Commit your work diff --git a/apps/context-outlet-type/README.md b/apps/context-outlet-type/README.md index 106de4f..fe7a0a2 100644 --- a/apps/context-outlet-type/README.md +++ b/apps/context-outlet-type/README.md @@ -36,7 +36,7 @@ But in this part, we can pass to ListComponent, a list of **any object**. And we 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve context-outlet-type** 5. _...work On it_ 6. Commit your work diff --git a/apps/create-harness/README.md b/apps/create-harness/README.md index 8557ea2..ab57cae 100644 --- a/apps/create-harness/README.md +++ b/apps/create-harness/README.md @@ -41,7 +41,7 @@ Good luck !!! šŸ’Ŗ 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve create-harness` 5. _...work on it_ 6. Commit your work diff --git a/apps/crud/README.md b/apps/crud/README.md index e2d9b2f..ec34df2 100644 --- a/apps/crud/README.md +++ b/apps/crud/README.md @@ -26,10 +26,7 @@ What you will need to do: this.todos[todoUpdated.id - 1] = todoUpdated; // Prefer something like this, but need to be improved because we still want the same order -this.todos = [ - ...this.todos.filter((t) => t.id !== todoUpdated.id), - todoUpdated, -]; +this.todos = [...this.todos.filter((t) => t.id !== todoUpdated.id), todoUpdated]; ``` - Use **ChangeDectection.OnPush** @@ -53,7 +50,7 @@ this.todos = [ 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve crud** 5. _...work On it_ 6. Commit your work diff --git a/apps/declarative-to-reactive/README.md b/apps/declarative-to-reactive/README.md index 0a58b02..9c5e152 100644 --- a/apps/declarative-to-reactive/README.md +++ b/apps/declarative-to-reactive/README.md @@ -18,7 +18,7 @@ 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve declarative-to-reactive** 5. _...work on it_ 6. Commit your work diff --git a/apps/di/README.md b/apps/di/README.md index ba15b83..45fa7c4 100644 --- a/apps/di/README.md +++ b/apps/di/README.md @@ -23,7 +23,7 @@ One way to achieve this is by adding a second argument to the pipe, but this is 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve di` 5. _...work on it_ 6. Commit your work diff --git a/apps/ngfor-enhancement/README.md b/apps/ngfor-enhancement/README.md index 0af7791..33bb772 100644 --- a/apps/ngfor-enhancement/README.md +++ b/apps/ngfor-enhancement/README.md @@ -38,7 +38,7 @@ The goal is to **improve the ngFor directive** 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve ngfor-enhancement** 5. _...work On it_ 6. Commit your work diff --git a/apps/ngrx-1/README.md b/apps/ngrx-1/README.md index 26baea1..b82f542 100644 --- a/apps/ngrx-1/README.md +++ b/apps/ngrx-1/README.md @@ -28,7 +28,7 @@ In NgRx, **selectors** is a very powerful tool often **misused**. You should use 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve ngrx-1** 5. _...work On it_ 6. Commit your work diff --git a/apps/ngrx-notification/README.md b/apps/ngrx-notification/README.md index 99fa4be..fccf7a8 100644 --- a/apps/ngrx-notification/README.md +++ b/apps/ngrx-notification/README.md @@ -29,7 +29,7 @@ the application contain a root route, a lazy loaded route and a component with a 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve ngrx-notification** 5. _...work on it_ 6. Commit your work diff --git a/apps/overload/README.md b/apps/overload/README.md index e035657..1123dd7 100644 --- a/apps/overload/README.md +++ b/apps/overload/README.md @@ -20,7 +20,7 @@ To achieve this, we will use overload functions. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **`npx nx serve overload`** 5. _...work on it_ 6. Commit your work diff --git a/apps/permissions/README.md b/apps/permissions/README.md index 4e03d9f..f6ede3e 100644 --- a/apps/permissions/README.md +++ b/apps/permissions/README.md @@ -51,7 +51,7 @@ In **Routes.ts**, route all user to the correct **DashboardComponent** using **C 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve permissions** 5. _...work on it_ 6. Commit your work diff --git a/apps/pipe-easy/README.md b/apps/pipe-easy/README.md index f39542e..66ceee9 100644 --- a/apps/pipe-easy/README.md +++ b/apps/pipe-easy/README.md @@ -18,7 +18,7 @@ In this first exercice, you add calling a simple function inside your template. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve pipe-easy` 5. _...work on it_ 6. Commit your work diff --git a/apps/pipe-hard/README.md b/apps/pipe-hard/README.md index 6888e74..b64c5e0 100644 --- a/apps/pipe-hard/README.md +++ b/apps/pipe-hard/README.md @@ -18,7 +18,7 @@ In this third exercice, you want to access utils functions. Currently we cannot 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve pipe-hard` 5. _...work on it_ 6. Commit your work diff --git a/apps/pipe-intermediate/README.md b/apps/pipe-intermediate/README.md index cc8dbd0..0e8786c 100644 --- a/apps/pipe-intermediate/README.md +++ b/apps/pipe-intermediate/README.md @@ -19,7 +19,7 @@ The goal is to create a `wrapFn` pipe to wrap your callback function though a pi 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve pipe-intermediate` 5. _...work on it_ 6. Commit your work diff --git a/apps/projection/README.md b/apps/projection/README.md index 83de6fb..a49ad12 100644 --- a/apps/projection/README.md +++ b/apps/projection/README.md @@ -18,7 +18,7 @@ Implement the City card. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve projection** 5. _...work on it_ 6. Commit your work diff --git a/apps/router-input/README.md b/apps/router-input/README.md index 52d8a67..e38d128 100644 --- a/apps/router-input/README.md +++ b/apps/router-input/README.md @@ -10,7 +10,7 @@ In this small application, you can pass data though routing to `TestComponent`. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve router-input` 5. _...work on it_ 6. Commit your work diff --git a/apps/rxjs-pipe-bug/README.md b/apps/rxjs-pipe-bug/README.md index 02eb546..9f06555 100644 --- a/apps/rxjs-pipe-bug/README.md +++ b/apps/rxjs-pipe-bug/README.md @@ -26,7 +26,7 @@ The QA team reports a **bug**. The UI shows **All [topic] have been deleted** al 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve rxjs-pipe-bug` 5. _...work on it_ 6. Commit your work diff --git a/apps/rxjs-race-condition/README.md b/apps/rxjs-race-condition/README.md index 577dc25..78d92c2 100644 --- a/apps/rxjs-race-condition/README.md +++ b/apps/rxjs-race-condition/README.md @@ -24,7 +24,7 @@ WATCH MODE : `npx nx component-test rxjs-race-condition --watch` 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve rxjs-race-condition` 5. _...work on it_ 6. Commit your work diff --git a/apps/scroll-cd/README.md b/apps/scroll-cd/README.md index c1f87b6..870285b 100644 --- a/apps/scroll-cd/README.md +++ b/apps/scroll-cd/README.md @@ -27,7 +27,7 @@ You cannot opt-out of zone.js. If this code is part of a large project and you o 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve scroll-cd** 5. _...work on it_ 6. Commit your work diff --git a/apps/styling/README.md b/apps/styling/README.md index 6ee7074..1652a72 100644 --- a/apps/styling/README.md +++ b/apps/styling/README.md @@ -18,7 +18,7 @@ In this challenge, you will need to use both CSS variables and :host-context to 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. **nx serve styling** 5. _...work on it_ 6. Commit your work diff --git a/apps/testing-forms/README.md b/apps/testing-forms/README.md index d32c235..5ebaa60 100644 --- a/apps/testing-forms/README.md +++ b/apps/testing-forms/README.md @@ -22,7 +22,7 @@ I created some `it` blocks but feel free to add more test if you like to. --> 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-forms` to play with the application 5. `npx nx test testing-forms` to test your application with Testing Library 6. `npx nx component-test testing-forms --watch` to test your application with Cypress diff --git a/apps/testing-harness/README.md b/apps/testing-harness/README.md index 75182b8..957b76a 100644 --- a/apps/testing-harness/README.md +++ b/apps/testing-harness/README.md @@ -17,7 +17,7 @@ Documentation for Angular Material component is [here](https://material.angular. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-harness` to play with the application 5. `npx nx test testing-harness` to test your application with Testing Library 6. _...work on it_ diff --git a/apps/testing-input-output/README.md b/apps/testing-input-output/README.md index 32bf866..e7d4be5 100644 --- a/apps/testing-input-output/README.md +++ b/apps/testing-input-output/README.md @@ -19,7 +19,7 @@ I created some `it` blocks but feel free to add more test if you like to. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-input-output` to play with the application 5. `npx nx test testing-input-output` to test your application with Testing Library 6. `npx nx component-test testing-input-output --watch` to test your application with Cypress diff --git a/apps/testing-modal/README.md b/apps/testing-modal/README.md index f02d9f4..597351e 100644 --- a/apps/testing-modal/README.md +++ b/apps/testing-modal/README.md @@ -22,7 +22,7 @@ I created some `it` blocks but feel free to add more test if you like to. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-modal` to play with the application 5. `npx nx test testing-modal` to test your application with Testing Library 6. `npx nx component-test testing-modal --watch` to test your application with Cypress diff --git a/apps/testing-nested/README.md b/apps/testing-nested/README.md index 5640e28..9710d04 100644 --- a/apps/testing-nested/README.md +++ b/apps/testing-nested/README.md @@ -20,7 +20,7 @@ I created some `it` blocks but feel free to add more test if you like to. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-nested` to play with the application 5. `npx nx test testing-nested` to test your application with Testing Library 6. `npx nx component-test testing-nested --watch` to test your application with Cypress diff --git a/apps/testing-router-outlet/README.md b/apps/testing-router-outlet/README.md index 6f44eb7..e0d62af 100644 --- a/apps/testing-router-outlet/README.md +++ b/apps/testing-router-outlet/README.md @@ -26,7 +26,7 @@ I created some `it` blocks but feel free to add more test if you like to. 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-router-outlet` to play with the application 5. `npx nx test testing-router-outlet` to test your application with Testing Library 6. `npx nx component-test testing-router-outlet --watch` to test your application with Cypress diff --git a/apps/testing-table/README.md b/apps/testing-table/README.md index 440a5f8..978debe 100644 --- a/apps/testing-table/README.md +++ b/apps/testing-table/README.md @@ -22,7 +22,7 @@ I created some `it` blocks but feel free to add more test if you like to. --> 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-table` to play with the application 5. `npx nx test testing-table` to test your application with Testing Library 6. `npx nx component-test testing-table --watch` to test your application with Cypress diff --git a/apps/testing-todos-list/README.md b/apps/testing-todos-list/README.md index 4968961..4bffc68 100644 --- a/apps/testing-todos-list/README.md +++ b/apps/testing-todos-list/README.md @@ -22,7 +22,7 @@ I created some `it` blocks but feel free to add more test if you like to. --> 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve testing-todos-list` to play with the application 5. `npx nx test testing-todos-list` to test your application with Testing Library 6. `npx nx component-test testing-todos-list --watch` to test your application with Cypress diff --git a/example.README.md b/example.README.md index b955833..e0fbfee 100644 --- a/example.README.md +++ b/example.README.md @@ -25,7 +25,7 @@ 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve {project app name}` 5. _...work on it_ diff --git a/libs/cli/src/generators/app/files/readme/README.md__tmpl__ b/libs/cli/src/generators/app/files/readme/README.md__tmpl__ index e0dfb5c..cf7a0a6 100644 --- a/libs/cli/src/generators/app/files/readme/README.md__tmpl__ +++ b/libs/cli/src/generators/app/files/readme/README.md__tmpl__ @@ -18,7 +18,7 @@ 1. Fork the project 2. clone it -3. npm install +3. npm ci 4. `npx nx serve <%= projectName %>` 5. _...work on it_ 6. Commit your work diff --git a/libs/custom-plugin/.eslintrc.json b/libs/custom-plugin/.eslintrc.json new file mode 100644 index 0000000..99664e5 --- /dev/null +++ b/libs/custom-plugin/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["./package.json", "./generators.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/nx-plugin-checks": "error" + } + } + ] +} diff --git a/libs/custom-plugin/README.md b/libs/custom-plugin/README.md new file mode 100644 index 0000000..7ff976b --- /dev/null +++ b/libs/custom-plugin/README.md @@ -0,0 +1,11 @@ +# custom-plugin + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build custom-plugin` to build the library. + +## Running unit tests + +Run `nx test custom-plugin` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/custom-plugin/generators.json b/libs/custom-plugin/generators.json new file mode 100644 index 0000000..29d90c7 --- /dev/null +++ b/libs/custom-plugin/generators.json @@ -0,0 +1,9 @@ +{ + "generators": { + "lib": { + "factory": "./src/generators/custom-library/generator", + "schema": "./src/generators/custom-library/schema.json", + "description": "extends library from nx/cli" + } + } +} diff --git a/libs/custom-plugin/jest.config.ts b/libs/custom-plugin/jest.config.ts new file mode 100644 index 0000000..58812f2 --- /dev/null +++ b/libs/custom-plugin/jest.config.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +export default { + displayName: 'custom-plugin', + preset: '../../jest.preset.js', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/custom-plugin', +}; diff --git a/libs/custom-plugin/package.json b/libs/custom-plugin/package.json new file mode 100644 index 0000000..1a5cb57 --- /dev/null +++ b/libs/custom-plugin/package.json @@ -0,0 +1,6 @@ +{ + "name": "@angular-challenges/custom-plugin", + "version": "0.0.1", + "type": "commonjs", + "generators": "./generators.json" +} diff --git a/libs/custom-plugin/project.json b/libs/custom-plugin/project.json new file mode 100644 index 0000000..5128c49 --- /dev/null +++ b/libs/custom-plugin/project.json @@ -0,0 +1,66 @@ +{ + "name": "custom-plugin", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/custom-plugin/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/custom-plugin", + "main": "libs/custom-plugin/src/index.ts", + "tsConfig": "libs/custom-plugin/tsconfig.lib.json", + "assets": [ + "libs/custom-plugin/*.md", + { + "input": "./libs/custom-plugin/src", + "glob": "**/!(*.ts)", + "output": "./src" + }, + { + "input": "./libs/custom-plugin/src", + "glob": "**/*.d.ts", + "output": "./src" + }, + { + "input": "./libs/custom-plugin", + "glob": "generators.json", + "output": "." + }, + { + "input": "./libs/custom-plugin", + "glob": "executors.json", + "output": "." + } + ] + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/custom-plugin/**/*.ts", + "libs/custom-plugin/package.json", + "libs/custom-plugin/generators.json" + ] + } + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/custom-plugin/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + } + }, + "tags": [] +} diff --git a/libs/custom-plugin/src/generators/custom-library/README.md b/libs/custom-plugin/src/generators/custom-library/README.md new file mode 100644 index 0000000..3de4a77 --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/README.md @@ -0,0 +1,64 @@ +

Create a generator to extends @nx/angular-lib

+ +> Author: Thomas Laforge + +### Information + +Welcome to the marvelous world of Nx generators. + +Generators are awesome tools that can help you and your team generate code more quickly, especially for pieces of code that you use frequently. While using Nx, you create libraries regularly, but sometimes the default generator doesn't perfectly meet your needs. + +### Statement + +The goal of this challenge is to create a generator that extends the default library generator of Nx. You will need to override the default `jest.config.ts` and a `eslintrc.json` with a custom one. + +You can either use all the default parameters of the Nx library generator or choose to modify some and keep others as defaults. The choice is yours. + +### Constraints: + +You should only override the jest configuration is the `unitTestRunner` option is set at `JEST`, and you should only update the eslint configuration if the `linter` is set to `eslint`. + +--- + +`jest.config.ts` + +```ts +/* eslint-disable */ +export default { + displayName: '< libName >', // šŸ‘ˆ lib name + preset: '../../../jest.preset.js', // šŸ‘ˆ be careful with the path + setupFilesAfterEnv: ['/src/test-setup.ts'], + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!(.*\\.mjs$|lodash-es))'], +}; +``` + +--- + +`eslintrc.json` + +add this rule `"@typescript-eslint/member-ordering": "off"` inside the rules properties of ts files. + +### Submitting your work + +1. Fork the project +2. clone it +3. npm ci +4. _...work on it_ +5. Commit your work +6. Submit a PR with a title beginning with **Answer:25** that I will review and other dev can review. + +extends-lib +extends-lib solution author + + + +_You can ask any question on_ twitter diff --git a/libs/custom-plugin/src/generators/custom-library/files/src/index.ts.template b/libs/custom-plugin/src/generators/custom-library/files/src/index.ts.template new file mode 100644 index 0000000..877d430 --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/files/src/index.ts.template @@ -0,0 +1 @@ +const variable = "<%= name %>"; \ No newline at end of file diff --git a/libs/custom-plugin/src/generators/custom-library/generator.spec.ts b/libs/custom-plugin/src/generators/custom-library/generator.spec.ts new file mode 100644 index 0000000..dc5ccae --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/generator.spec.ts @@ -0,0 +1,20 @@ +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree, readProjectConfiguration } from '@nx/devkit'; + +import { customLibraryGenerator } from './generator'; +import { CustomLibraryGeneratorSchema } from './schema'; + +describe('custom-library generator', () => { + let tree: Tree; + const options: CustomLibraryGeneratorSchema = { name: 'test' }; + + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + }); + + it('should run successfully', async () => { + await customLibraryGenerator(tree, options); + const config = readProjectConfiguration(tree, 'test'); + expect(config).toBeDefined(); + }); +}); diff --git a/libs/custom-plugin/src/generators/custom-library/generator.ts b/libs/custom-plugin/src/generators/custom-library/generator.ts new file mode 100644 index 0000000..bcc18ab --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/generator.ts @@ -0,0 +1,25 @@ +import { + addProjectConfiguration, + formatFiles, + generateFiles, + Tree, +} from '@nx/devkit'; +import * as path from 'path'; +import { CustomLibraryGeneratorSchema } from './schema'; + +export async function customLibraryGenerator( + tree: Tree, + options: CustomLibraryGeneratorSchema +) { + const projectRoot = `libs/${options.name}`; + addProjectConfiguration(tree, options.name, { + root: projectRoot, + projectType: 'library', + sourceRoot: `${projectRoot}/src`, + targets: {}, + }); + generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options); + await formatFiles(tree); +} + +export default customLibraryGenerator; diff --git a/libs/custom-plugin/src/generators/custom-library/schema.d.ts b/libs/custom-plugin/src/generators/custom-library/schema.d.ts new file mode 100644 index 0000000..1534ae4 --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/schema.d.ts @@ -0,0 +1,3 @@ +export interface CustomLibraryGeneratorSchema { + name: string; +} diff --git a/libs/custom-plugin/src/generators/custom-library/schema.json b/libs/custom-plugin/src/generators/custom-library/schema.json new file mode 100644 index 0000000..1fe1377 --- /dev/null +++ b/libs/custom-plugin/src/generators/custom-library/schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/schema", + "$id": "CustomLibrary", + "title": "", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "", + "$default": { + "$source": "argv", + "index": 0 + }, + "x-prompt": "What name would you like to use?" + } + }, + "required": ["name"] +} diff --git a/libs/custom-plugin/src/index.ts b/libs/custom-plugin/src/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/libs/custom-plugin/tsconfig.json b/libs/custom-plugin/tsconfig.json new file mode 100644 index 0000000..19b9eec --- /dev/null +++ b/libs/custom-plugin/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs" + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/custom-plugin/tsconfig.lib.json b/libs/custom-plugin/tsconfig.lib.json new file mode 100644 index 0000000..33eca2c --- /dev/null +++ b/libs/custom-plugin/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/libs/custom-plugin/tsconfig.spec.json b/libs/custom-plugin/tsconfig.spec.json new file mode 100644 index 0000000..9b2a121 --- /dev/null +++ b/libs/custom-plugin/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 17b5ccd..a929902 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -16,6 +16,7 @@ "baseUrl": ".", "paths": { "@angular-challenges/cli": ["libs/cli/src/index.ts"], + "@angular-challenges/custom-plugin": ["libs/custom-plugin/src/index.ts"], "@angular-challenges/ngrx-notification/backend": [ "libs/ngrx-notification/backend/src/index.ts" ],