Skip to content

Commit 00aba83

Browse files
authored
chore!: migrate to Nx workspace (#136)
## PR Checklist Please check if your PR fulfills the following requirements: - [x] The commit message follows our guidelines: CONTRIBUTING.md#commit - [x] Tests for the changes have been added (for bug fixes / features) - [x] Docs have been added / updated (for bug fixes / features) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [x] Build related changes [x] CI related changes [ ] Documentation content changes [ ] Other... Please describe: ``` ## What is the current behavior? Our CI workflow is broken and we are not publishing a partially Ivy-compiled bundle. <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Issue Number: N/A ## What is the new behavior? We use Nrwl's Nx Cloud DTE workflow and we can publish a partially Ivy-compiled bundle. ## Does this PR introduce a breaking change? ``` [x] Yes [ ] No ``` <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> - Require Angular 14.0 - Require RxJS 7.4 ## Other information Merging from https://github.com/ngworker/lumberjack-next. Closes #101, closes #84, closes #98
1 parent 3e595a8 commit 00aba83

File tree

321 files changed

+9465
-58181
lines changed

Some content is hidden

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

321 files changed

+9465
-58181
lines changed

.commitlintrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {}
4+
}

.eslintrc.json

+56-144
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,79 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["dist", "coverage"],
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx", "etc", "rxjs", "rxjs-angular", "sonarjs"],
5+
"parser": "@typescript-eslint/parser",
46
"parserOptions": {
5-
"ecmaVersion": 2020
7+
"project": ["{e2e,packages}/**/tsconfig.*?.json", "e2e/**/*-e2e/tsconfig.json"]
68
},
79
"overrides": [
810
{
9-
"files": ["*.ts"],
10-
"parserOptions": {
11-
"project": ["tsconfig.json"],
12-
"createDefaultProgram": true
13-
},
14-
"extends": [
15-
"plugin:@angular-eslint/recommended",
16-
"eslint:recommended",
17-
"plugin:@typescript-eslint/recommended",
18-
"plugin:ordered-imports/recommended",
19-
"plugin:import/errors",
20-
"plugin:import/warnings"
21-
],
22-
"plugins": ["no-null", "ordered-imports"],
11+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
12+
"excludedFiles": ["*.spec.ts"],
2313
"rules": {
24-
"@angular-eslint/component-selector": [
25-
"error",
26-
{
27-
"type": "element",
28-
"prefix": "ngworker",
29-
"style": "kebab-case"
30-
}
31-
],
32-
"@angular-eslint/directive-selector": [
33-
"error",
34-
{
35-
"type": "attribute",
36-
"prefix": "ngworker",
37-
"style": "camelCase"
38-
}
39-
],
40-
"@angular-eslint/no-forward-ref": "error",
41-
"@typescript-eslint/array-type": [
42-
"error",
43-
{
44-
"default": "array"
45-
}
46-
],
47-
"@typescript-eslint/consistent-type-definitions": "error",
48-
"@typescript-eslint/dot-notation": "off",
49-
"@typescript-eslint/explicit-member-accessibility": [
14+
"@nrwl/nx/enforce-module-boundaries": [
5015
"error",
5116
{
52-
"accessibility": "no-public"
53-
}
54-
],
55-
"@typescript-eslint/member-delimiter-style": [
56-
"off",
57-
{
58-
"multiline": {
59-
"delimiter": "none",
60-
"requireLast": true
61-
},
62-
"singleline": {
63-
"delimiter": "semi",
64-
"requireLast": false
65-
}
66-
}
67-
],
68-
"@typescript-eslint/no-explicit-any": "error",
69-
"@typescript-eslint/no-floating-promises": "error",
70-
"@typescript-eslint/no-require-imports": "error",
71-
"@typescript-eslint/prefer-readonly": "error",
72-
"@typescript-eslint/quotes": [
73-
"off",
74-
"single",
75-
{
76-
"allowTemplateLiterals": true
77-
}
78-
],
79-
"@typescript-eslint/semi": ["off", null],
80-
"@typescript-eslint/type-annotation-spacing": "off",
81-
"arrow-parens": ["off", "always"],
82-
"brace-style": ["off", "off"],
83-
"eol-last": "off",
84-
"import/no-internal-modules": [
85-
"error",
86-
{
87-
"allow": [
88-
"rxjs/operators",
89-
"rxjs/operators/*",
90-
"@angular/common/*",
91-
"@angular/common/http/*",
92-
"@angular/core",
93-
"@angular/core/*",
94-
"@angular/platform-browser/*",
95-
"@angular/platform-browser-dynamic/*",
96-
"@angular/core/testing/*",
97-
"@angular/fire/database/*",
98-
"@angular/material/*",
99-
"@angular-devkit/schematics/*",
100-
"@internal/*",
101-
"@ngworker/*",
102-
"@schematics/angular/*",
103-
"@schematics/angular/application/*",
104-
"@schematics/angular/workspace/*",
105-
"zone.js/*",
106-
"zone.js/dist/*"
107-
]
108-
}
109-
],
110-
"import/order": "warn",
111-
"import/named": "warn",
112-
"import/no-unresolved": ["off", { "commonjs": true, "amd": true }],
113-
"linebreak-style": "off",
114-
"max-classes-per-file": ["error", 5],
115-
"max-len": "off",
116-
"new-parens": "off",
117-
"newline-per-chained-call": "off",
118-
"no-extra-semi": "off",
119-
"no-irregular-whitespace": "off",
120-
"no-null/no-null": "error",
121-
"no-redeclare": "error",
122-
"no-trailing-spaces": "off",
123-
"ordered-imports/ordered-imports": [
124-
"warn",
125-
{
126-
"symbols-first": true,
127-
"declaration-ordering": [
128-
"type",
17+
"enforceBuildableLibDependency": true,
18+
"allow": [],
19+
"depConstraints": [
12920
{
130-
"ordering": ["side-effect", "default", "namespace", "destructured"],
131-
"secondaryOrdering": ["name", "case-insensitive"]
132-
}
133-
],
134-
"specifier-ordering": "case-insensitive",
135-
"group-ordering": [
21+
"sourceTag": "scope:public",
22+
"onlyDependOnLibsWithTags": ["scope:public"]
23+
},
13624
{
137-
"name": "project root",
138-
"match": "^@(?!(ngworker|internal)).*|^[a-zA-Z].*",
139-
"order": 20
25+
"sourceTag": "scope:internal",
26+
"onlyDependOnLibsWithTags": ["scope:public", "scope:internal"]
14027
},
14128
{
142-
"name": "internal routes",
143-
"match": "^@(ngworker|internal).*",
144-
"order": 30
29+
"sourceTag": "type:app",
30+
"onlyDependOnLibsWithTags": ["type:package"]
14531
},
146-
{ "name": "parent directories", "match": "^\\.\\.", "order": 40 },
147-
{ "name": "current directory", "match": "^\\.", "order": 50 },
148-
{ "name": "third-party", "match": ".*", "order": 10 }
32+
{
33+
"sourceTag": "type:package",
34+
"onlyDependOnLibsWithTags": ["type:package", "type:test-util"]
35+
},
36+
{
37+
"sourceTag": "type:e2e",
38+
"onlyDependOnLibsWithTags": ["type:app"]
39+
}
14940
]
15041
}
151-
],
152-
"quote-props": "off",
153-
"space-before-function-paren": "off",
154-
"space-in-parens": ["off", "never"],
155-
"prefer-arrow/prefer-arrow-functions": "off",
156-
"eqeqeq": "off"
42+
]
43+
}
44+
},
45+
{
46+
"files": ["*.ts", "*.tsx"],
47+
"extends": ["plugin:@nrwl/nx/typescript"],
48+
"rules": {}
49+
},
50+
{
51+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
52+
"rules": {
53+
"@nrwl/nx/enforce-module-boundaries": "off"
54+
}
55+
},
56+
{
57+
"files": ["*.js", "*.jsx"],
58+
"extends": ["plugin:@nrwl/nx/javascript"],
59+
"rules": {}
60+
},
61+
{
62+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
63+
"extends": ["plugin:etc/recommended", "plugin:rxjs/recommended", "plugin:sonarjs/recommended"],
64+
"rules": {
65+
"etc/no-commented-out-code": "error",
66+
"etc/no-const-enum": "error",
67+
"sonarjs/cognitive-complexity": ["error", 8]
15768
}
15869
},
15970
{
160-
"files": ["*.html"],
161-
"extends": ["plugin:@angular-eslint/template/recommended"],
71+
"files": ["*.ts"],
16272
"rules": {
163-
"@angular-eslint/template/eqeqeq": "off",
164-
"@angular-eslint/template/no-negated-async": "off"
73+
"rxjs-angular/prefer-composition": [
74+
"error",
75+
{ "checkDecorators": ["Component", "Directive", "Injectable", "NgModule", "Pipe"] }
76+
]
16577
}
16678
}
16779
]

.github/actions/setup/action.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup
2+
3+
description: Setup Node.js, cache and install dependencies
4+
5+
runs:
6+
using: composite
7+
steps:
8+
# Needed for nx affected command, it set the BASE and HEAD env variables
9+
- name: Derive appropriate SHAs for base and head for `nx affected` commands
10+
uses: nrwl/nx-set-shas@v3
11+
12+
- name: Determine Node.js version
13+
id: node_version
14+
shell: bash
15+
run: echo "node_version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
16+
- name: Use Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
cache: yarn
20+
node-version: ${{ steps.node_version.outputs.node_version }}
21+
# This doesn't just set the registry url, but also sets
22+
# the right configuration in .npmrc that reads NPM token
23+
# from NPM_AUTH_TOKEN environment variable.
24+
# It actually creates a .npmrc in a temporary folder
25+
# and sets the NPM_CONFIG_USERCONFIG environment variable.
26+
registry-url: https://registry.npmjs.org
27+
28+
- name: Install dependencies
29+
shell: bash
30+
run: yarn install --immutable --immutable-cache

.github/actions/ssh-runner/action.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Open SSH debug session
2+
3+
description: SSH into the GitHub runner. Run tmux attach once connected. Run exit to close the session.
4+
5+
# A consumer must add the following permissions
6+
# permissions:
7+
# id-token: write
8+
# contents: read
9+
# actions: read
10+
11+
inputs:
12+
ssh_gateway:
13+
description: The gateway hostname address or IP address.
14+
required: true
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- name: Setup SSH server for Actor
20+
uses: alexellis/setup-sshd-actor@master
21+
- name: Connect to the actuated SSH gateway
22+
uses: alexellis/actuated-ssh-gateway-action@master
23+
with:
24+
gatewayaddr: ${{ inputs.ssh_gateway }}
25+
# Use TLS
26+
secure: true
27+
- name: Setup a blocking tmux session
28+
uses: alexellis/block-with-tmux-action@master

0 commit comments

Comments
 (0)