Skip to content

Commit 266d655

Browse files
chore: init
1 parent 4b56252 commit 266d655

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3980
-1595
lines changed

.eslintrc.json

+43-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nx"],
3+
"ignorePatterns": [
4+
"**/*"
5+
],
6+
"plugins": [
7+
"@nx"
8+
],
59
"overrides": [
610
{
7-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
11+
"files": [
12+
"*.ts",
13+
"*.tsx",
14+
"*.js",
15+
"*.jsx"
16+
],
817
"rules": {
918
"@nx/enforce-module-boundaries": [
1019
"error",
@@ -14,29 +23,54 @@
1423
"depConstraints": [
1524
{
1625
"sourceTag": "*",
17-
"onlyDependOnLibsWithTags": ["*"]
26+
"onlyDependOnLibsWithTags": [
27+
"*"
28+
]
1829
}
1930
]
2031
}
2132
]
2233
}
2334
},
2435
{
25-
"files": ["*.ts", "*.tsx"],
26-
"extends": ["plugin:@nx/typescript"],
36+
"files": [
37+
"*.ts",
38+
"*.tsx"
39+
],
40+
"extends": [
41+
"plugin:@nx/typescript"
42+
],
2743
"rules": {}
2844
},
2945
{
30-
"files": ["*.js", "*.jsx"],
31-
"extends": ["plugin:@nx/javascript"],
46+
"files": [
47+
"*.js",
48+
"*.jsx"
49+
],
50+
"extends": [
51+
"plugin:@nx/javascript"
52+
],
3253
"rules": {}
3354
},
3455
{
35-
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
56+
"files": [
57+
"*.spec.ts",
58+
"*.spec.tsx",
59+
"*.spec.js",
60+
"*.spec.jsx"
61+
],
3662
"env": {
3763
"jest": true
3864
},
3965
"rules": {}
66+
},
67+
{
68+
"files": [
69+
"*.ts"
70+
],
71+
"extends": [
72+
"plugin:@softarc/sheriff/default"
73+
]
4074
}
4175
]
4276
}

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}
File renamed without changes.

apps/ngrx-toolkit-e2e/playwright.config.ts renamed to apps/demo-e2e/playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineConfig({
2525
},
2626
/* Run your local dev server before starting the tests */
2727
webServer: {
28-
command: 'npx nx serve ngrx-toolkit',
28+
command: 'npx nx serve demo',
2929
url: 'http://localhost:4200',
3030
reuseExistingServer: !process.env.CI,
3131
cwd: workspaceRoot,
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"name": "ngrx-toolkit-e2e",
2+
"name": "demo-e2e",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"projectType": "application",
5-
"sourceRoot": "apps/ngrx-toolkit-e2e/src",
5+
"sourceRoot": "apps/demo-e2e/src",
66
"targets": {
77
"e2e": {
88
"executor": "@nx/playwright:playwright",
9-
"outputs": ["{workspaceRoot}/dist/.playwright/apps/ngrx-toolkit-e2e"],
9+
"outputs": ["{workspaceRoot}/dist/.playwright/apps/demo-e2e"],
1010
"options": {
11-
"config": "apps/ngrx-toolkit-e2e/playwright.config.ts"
11+
"config": "apps/demo-e2e/playwright.config.ts"
1212
}
1313
},
1414
"lint": {
1515
"executor": "@nx/eslint:lint",
1616
"outputs": ["{options.outputFile}"]
1717
}
1818
},
19-
"implicitDependencies": ["ngrx-toolkit"]
19+
"implicitDependencies": ["demo"]
2020
}
File renamed without changes.

apps/demo/jest.config.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'demo',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../coverage/apps/demo',
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};

apps/ngrx-toolkit/project.json renamed to apps/demo/project.json

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
{
2-
"name": "ngrx-toolkit",
2+
"name": "demo",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"projectType": "application",
55
"prefix": "ngrx-toolkit",
6-
"sourceRoot": "apps/ngrx-toolkit/src",
6+
"sourceRoot": "apps/demo/src",
77
"tags": [],
88
"targets": {
99
"build": {
1010
"executor": "@angular-devkit/build-angular:application",
1111
"outputs": ["{options.outputPath}"],
1212
"options": {
13-
"outputPath": "dist/apps/ngrx-toolkit",
14-
"index": "apps/ngrx-toolkit/src/index.html",
15-
"browser": "apps/ngrx-toolkit/src/main.ts",
13+
"outputPath": "dist/apps/demo",
14+
"index": "apps/demo/src/index.html",
15+
"browser": "apps/demo/src/main.ts",
1616
"polyfills": ["zone.js"],
17-
"tsConfig": "apps/ngrx-toolkit/tsconfig.app.json",
18-
"assets": [
19-
"apps/ngrx-toolkit/src/favicon.ico",
20-
"apps/ngrx-toolkit/src/assets"
21-
],
22-
"styles": ["apps/ngrx-toolkit/src/styles.css"],
17+
"tsConfig": "apps/demo/tsconfig.app.json",
18+
"assets": ["apps/demo/src/favicon.ico", "apps/demo/src/assets"],
19+
"styles": ["apps/demo/src/styles.css"],
2320
"scripts": [],
24-
"server": "apps/ngrx-toolkit/src/main.server.ts",
21+
"server": "apps/demo/src/main.server.ts",
2522
"prerender": true,
2623
"ssr": {
27-
"entry": "apps/ngrx-toolkit/server.ts"
24+
"entry": "apps/demo/server.ts"
2825
}
2926
},
3027
"configurations": {
@@ -55,18 +52,18 @@
5552
"executor": "@angular-devkit/build-angular:dev-server",
5653
"configurations": {
5754
"production": {
58-
"buildTarget": "ngrx-toolkit:build:production"
55+
"buildTarget": "demo:build:production"
5956
},
6057
"development": {
61-
"buildTarget": "ngrx-toolkit:build:development"
58+
"buildTarget": "demo:build:development"
6259
}
6360
},
6461
"defaultConfiguration": "development"
6562
},
6663
"extract-i18n": {
6764
"executor": "@angular-devkit/build-angular:extract-i18n",
6865
"options": {
69-
"buildTarget": "ngrx-toolkit:build"
66+
"buildTarget": "demo:build"
7067
}
7168
},
7269
"lint": {
@@ -77,7 +74,7 @@
7774
"executor": "@nx/jest:jest",
7875
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
7976
"options": {
80-
"jestConfig": "apps/ngrx-toolkit/jest.config.ts"
77+
"jestConfig": "apps/demo/jest.config.ts"
8178
}
8279
}
8380
}
File renamed without changes.

apps/ngrx-toolkit/src/app/app.component.spec.ts renamed to apps/demo/src/app/app.component.spec.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ describe('AppComponent', () => {
1414
const fixture = TestBed.createComponent(AppComponent);
1515
fixture.detectChanges();
1616
const compiled = fixture.nativeElement as HTMLElement;
17-
expect(compiled.querySelector('h1')?.textContent).toContain(
18-
'Welcome ngrx-toolkit'
19-
);
17+
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome demo');
2018
});
2119

22-
it(`should have as title 'ngrx-toolkit'`, () => {
20+
it(`should have as title 'demo'`, () => {
2321
const fixture = TestBed.createComponent(AppComponent);
2422
const app = fixture.componentInstance;
25-
expect(app.title).toEqual('ngrx-toolkit');
23+
expect(app.title).toEqual('demo');
2624
});
2725
});

apps/ngrx-toolkit/src/app/app.component.ts renamed to apps/demo/src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import { NxWelcomeComponent } from './nx-welcome.component';
1010
styleUrl: './app.component.css',
1111
})
1212
export class AppComponent {
13-
title = 'ngrx-toolkit';
13+
title = 'demo';
1414
}

apps/ngrx-toolkit/src/app/nx-welcome.component.ts renamed to apps/demo/src/app/nx-welcome.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ import { CommonModule } from '@angular/common';
432432
<div id="welcome">
433433
<h1>
434434
<span> Hello there, </span>
435-
Welcome ngrx-toolkit 👋
435+
Welcome demo 👋
436436
</h1>
437437
</div>
438438
<!-- HERO -->
File renamed without changes.
File renamed without changes.

apps/ngrx-toolkit/src/index.html renamed to apps/demo/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>ngrx-toolkit</title>
5+
<title>demo</title>
66
<base href="/" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<link rel="icon" type="image/x-icon" href="favicon.ico" />
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

libs/ngrx-toolkit/.eslintrc.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "ngrxToolkit",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "ngrx-toolkit",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nx/angular-template"],
33+
"rules": {}
34+
},
35+
{
36+
"files": ["*.json"],
37+
"parser": "jsonc-eslint-parser",
38+
"rules": {
39+
"@nx/dependency-checks": "error"
40+
}
41+
}
42+
]
43+
}

libs/ngrx-toolkit/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ngrx-toolkit
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test ngrx-toolkit` to execute the unit tests.

apps/ngrx-toolkit/jest.config.ts renamed to libs/ngrx-toolkit/jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
displayName: 'ngrx-toolkit',
44
preset: '../../jest.preset.js',
55
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6-
coverageDirectory: '../../coverage/apps/ngrx-toolkit',
6+
coverageDirectory: '../../coverage/libs/ngrx-toolkit',
77
transform: {
88
'^.+\\.(ts|mjs|js|html)$': [
99
'jest-preset-angular',

libs/ngrx-toolkit/ng-package.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/libs/ngrx-toolkit",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

libs/ngrx-toolkit/package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "ngrx-toolkit",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^17.0.0",
6+
"@angular/core": "^17.0.0"
7+
},
8+
"dependencies": {
9+
"tslib": "^2.3.0"
10+
},
11+
"sideEffects": false
12+
}

libs/ngrx-toolkit/project.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "ngrx-toolkit",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/ngrx-toolkit/src",
5+
"prefix": "ngrx-toolkit",
6+
"tags": [],
7+
"projectType": "library",
8+
"targets": {
9+
"build": {
10+
"executor": "@nx/angular:package",
11+
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
12+
"options": {
13+
"project": "libs/ngrx-toolkit/ng-package.json"
14+
},
15+
"configurations": {
16+
"production": {
17+
"tsConfig": "libs/ngrx-toolkit/tsconfig.lib.prod.json"
18+
},
19+
"development": {
20+
"tsConfig": "libs/ngrx-toolkit/tsconfig.lib.json"
21+
}
22+
},
23+
"defaultConfiguration": "production"
24+
},
25+
"test": {
26+
"executor": "@nx/jest:jest",
27+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
28+
"options": {
29+
"jestConfig": "libs/ngrx-toolkit/jest.config.ts"
30+
}
31+
},
32+
"lint": {
33+
"executor": "@nx/eslint:lint",
34+
"outputs": ["{options.outputFile}"]
35+
}
36+
}
37+
}

libs/ngrx-toolkit/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/ngrx-toolkit/ngrx-toolkit.component';

libs/ngrx-toolkit/src/lib/ngrx-toolkit/ngrx-toolkit.component.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>ngrx-toolkit works!</p>

0 commit comments

Comments
 (0)