Skip to content

Commit 4b56252

Browse files
Initial commit
0 parents  commit 4b56252

Some content is hidden

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

41 files changed

+20265
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintignore

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

.eslintrc.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
}

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.angular

.prettierignore

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

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"ms-playwright.playwright",
7+
"dbaeumer.vscode-eslint"
8+
]
9+
}

README.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# NgrxToolkit
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
**This workspace has been generated by [Nx, Smart Monorepos · Fast CI.](https://nx.dev)**
6+
7+
8+
## Start the app
9+
10+
To start the development server run `nx serve ngrx-toolkit`. Open your browser and navigate to http://localhost:4200/. Happy coding!
11+
12+
13+
## Generate code
14+
15+
If you happen to use Nx plugins, you can leverage code generators that might come with it.
16+
17+
Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list <plugin-name>` to see what generators are available.
18+
19+
Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators).
20+
21+
## Running tasks
22+
23+
To execute tasks with Nx use the following syntax:
24+
25+
```
26+
nx <target> <project> <...options>
27+
```
28+
29+
You can also run multiple targets:
30+
31+
```
32+
nx run-many -t <target1> <target2>
33+
```
34+
35+
..or add `-p` to filter specific projects
36+
37+
```
38+
nx run-many -t <target1> <target2> -p <proj1> <proj2>
39+
```
40+
41+
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
42+
43+
## Want better Editor Integration?
44+
45+
Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
46+
47+
## Ready to deploy?
48+
49+
Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
50+
51+
## Set up CI!
52+
53+
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
54+
55+
- [Set up remote caching](https://nx.dev/core-features/share-your-cache)
56+
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
57+
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
58+
59+
## Connect with us!
60+
61+
- [Join the community](https://nx.dev/community)
62+
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
63+
- [Follow us on Twitter](https://twitter.com/nxdevtools)

apps/ngrx-toolkit-e2e/.eslintrc.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": ["plugin:playwright/recommended", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["src/**/*.{ts,js,tsx,jsx}"],
19+
"rules": {}
20+
}
21+
]
22+
}
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { defineConfig } from '@playwright/test';
2+
import { nxE2EPreset } from '@nx/playwright/preset';
3+
4+
import { workspaceRoot } from '@nx/devkit';
5+
6+
// For CI, you may want to set BASE_URL to the deployed application.
7+
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
8+
9+
/**
10+
* Read environment variables from file.
11+
* https://github.com/motdotla/dotenv
12+
*/
13+
// require('dotenv').config();
14+
15+
/**
16+
* See https://playwright.dev/docs/test-configuration.
17+
*/
18+
export default defineConfig({
19+
...nxE2EPreset(__filename, { testDir: './src' }),
20+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
21+
use: {
22+
baseURL,
23+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
24+
trace: 'on-first-retry',
25+
},
26+
/* Run your local dev server before starting the tests */
27+
webServer: {
28+
command: 'npx nx serve ngrx-toolkit',
29+
url: 'http://localhost:4200',
30+
reuseExistingServer: !process.env.CI,
31+
cwd: workspaceRoot,
32+
},
33+
});

apps/ngrx-toolkit-e2e/project.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "ngrx-toolkit-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"sourceRoot": "apps/ngrx-toolkit-e2e/src",
6+
"targets": {
7+
"e2e": {
8+
"executor": "@nx/playwright:playwright",
9+
"outputs": ["{workspaceRoot}/dist/.playwright/apps/ngrx-toolkit-e2e"],
10+
"options": {
11+
"config": "apps/ngrx-toolkit-e2e/playwright.config.ts"
12+
}
13+
},
14+
"lint": {
15+
"executor": "@nx/eslint:lint",
16+
"outputs": ["{options.outputFile}"]
17+
}
18+
},
19+
"implicitDependencies": ["ngrx-toolkit"]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('has title', async ({ page }) => {
4+
await page.goto('/');
5+
6+
// Expect h1 to contain a substring.
7+
expect(await page.locator('h1').innerText()).toContain('Welcome');
8+
});

apps/ngrx-toolkit/.eslintrc.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

apps/ngrx-toolkit/jest.config.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'ngrx-toolkit',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../coverage/apps/ngrx-toolkit',
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+
};

0 commit comments

Comments
 (0)