Skip to content

Commit 14554e0

Browse files
nartceneajaho
andauthored
feat: add local plugin with a generator to add new library (#53)
* feat: add local plugin with a generator to add new library * Update plugin/src/generators/new-lib/generator.ts Co-authored-by: Enea Jahollari <[email protected]> --------- Co-authored-by: Enea Jahollari <[email protected]>
1 parent 1ce67d0 commit 14554e0

37 files changed

+4608
-860
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
},
41+
{
42+
"files": "*.json",
43+
"parser": "jsonc-eslint-parser",
44+
"rules": {}
45+
}
46+
]
47+
}

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage

.vscode/extensions.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"recommendations": [
33
"angular.ng-template",
4+
"nrwl.angular-console",
45
"esbenp.prettier-vscode",
5-
"nrwl.angular-console"
6+
"dbaeumer.vscode-eslint",
7+
"firsttris.vscode-jest-runner"
68
]
79
}

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"editor.formatOnSave": true
2+
"editor.formatOnSave": true,
3+
"eslint.validate": ["json"]
34
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# [Angular Libraries Support](https://ngx-libs.com) ⛱️ [![Netlify Status](https://api.netlify.com/api/v1/badges/b9665d5e-fb50-4f81-892c-7f47640abac0/deploy-status)](https://app.netlify.com/sites/ngx-libs/deploys)
1+
# [Angular Libraries Support](https://ngx-libs.com) ⛱️ [![Netlify Status](https://api.netlify.com/api/v1/badges/b9665d5e-fb50-4f81-892c-7f47640abac0/deploy-status)](https://app.netlify.com/sites/ngx-libs/deploys)
22

33
![Angular Libraries Support](https://github.com/eneajaho/ngx-libs/assets/25394362/97bdd713-4058-4034-b257-94a6602dab69)
44

5-
65
While ng updating Angular projects, it is important to know if a library has added support for the new Angular version. This project is supposed to solve this problem by providing a list of libraries and their support for different Angular versions.
76

87
## How to use
@@ -22,4 +21,5 @@ If you want to add a library, please create a pull request with the following ch
2221
- Run `npm start`
2322

2423
## License
24+
2525
MIT

jest.config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getJestProjects } from '@nx/jest';
2+
3+
export default {
4+
projects: getJestProjects(),
5+
};

jest.preset.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nx/jest/preset').default;
2+
3+
module.exports = { ...nxPreset };

libs/models/project.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "libs-models",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/models/src",
5+
"projectType": "library",
6+
"targets": {},
7+
"tags": []
8+
}

libs/models/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib-support.interface';

libs/models/tsconfig.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noPropertyAccessFromIndexSignature": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true
11+
},
12+
"files": [],
13+
"include": [],
14+
"references": [
15+
{
16+
"path": "./tsconfig.lib.json"
17+
}
18+
]
19+
}

libs/models/tsconfig.lib.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"declaration": true,
6+
"types": ["node"]
7+
},
8+
"include": ["src/**/*.ts"],
9+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
10+
}

nx.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
"production": [
1717
"default",
1818
"!{projectRoot}/tsconfig.spec.json",
19-
"!{projectRoot}/**/*.spec.[jt]s"
19+
"!{projectRoot}/**/*.spec.[jt]s",
20+
"!{projectRoot}/.eslintrc.json",
21+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
22+
"!{projectRoot}/jest.config.[jt]s",
23+
"!{projectRoot}/src/test-setup.[jt]s"
2024
]
2125
},
2226
"targetDefaults": {
@@ -25,7 +29,14 @@
2529
"inputs": ["production", "^production"]
2630
},
2731
"test": {
28-
"inputs": ["default", "^production"]
32+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
33+
},
34+
"lint": {
35+
"inputs": [
36+
"default",
37+
"{workspaceRoot}/.eslintrc.json",
38+
"{workspaceRoot}/.eslintignore"
39+
]
2940
}
3041
}
3142
}

0 commit comments

Comments
 (0)