Skip to content

Commit

Permalink
chore!: migrate to Nx workspace (ngworker#136)
Browse files Browse the repository at this point in the history
## 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 ngworker#101, closes ngworker#84, closes ngworker#98
  • Loading branch information
LayZeeDK authored Oct 25, 2022
1 parent 3e595a8 commit 00aba83
Show file tree
Hide file tree
Showing 321 changed files with 9,465 additions and 58,181 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {}
}
200 changes: 56 additions & 144 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,167 +1,79 @@
{
"root": true,
"ignorePatterns": ["dist", "coverage"],
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx", "etc", "rxjs", "rxjs-angular", "sonarjs"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020
"project": ["{e2e,packages}/**/tsconfig.*?.json", "e2e/**/*-e2e/tsconfig.json"]
},
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:ordered-imports/recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": ["no-null", "ordered-imports"],
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"excludedFiles": ["*.spec.ts"],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "ngworker",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "ngworker",
"style": "camelCase"
}
],
"@angular-eslint/no-forward-ref": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"accessibility": "no-public"
}
],
"@typescript-eslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/quotes": [
"off",
"single",
{
"allowTemplateLiterals": true
}
],
"@typescript-eslint/semi": ["off", null],
"@typescript-eslint/type-annotation-spacing": "off",
"arrow-parens": ["off", "always"],
"brace-style": ["off", "off"],
"eol-last": "off",
"import/no-internal-modules": [
"error",
{
"allow": [
"rxjs/operators",
"rxjs/operators/*",
"@angular/common/*",
"@angular/common/http/*",
"@angular/core",
"@angular/core/*",
"@angular/platform-browser/*",
"@angular/platform-browser-dynamic/*",
"@angular/core/testing/*",
"@angular/fire/database/*",
"@angular/material/*",
"@angular-devkit/schematics/*",
"@internal/*",
"@ngworker/*",
"@schematics/angular/*",
"@schematics/angular/application/*",
"@schematics/angular/workspace/*",
"zone.js/*",
"zone.js/dist/*"
]
}
],
"import/order": "warn",
"import/named": "warn",
"import/no-unresolved": ["off", { "commonjs": true, "amd": true }],
"linebreak-style": "off",
"max-classes-per-file": ["error", 5],
"max-len": "off",
"new-parens": "off",
"newline-per-chained-call": "off",
"no-extra-semi": "off",
"no-irregular-whitespace": "off",
"no-null/no-null": "error",
"no-redeclare": "error",
"no-trailing-spaces": "off",
"ordered-imports/ordered-imports": [
"warn",
{
"symbols-first": true,
"declaration-ordering": [
"type",
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"ordering": ["side-effect", "default", "namespace", "destructured"],
"secondaryOrdering": ["name", "case-insensitive"]
}
],
"specifier-ordering": "case-insensitive",
"group-ordering": [
"sourceTag": "scope:public",
"onlyDependOnLibsWithTags": ["scope:public"]
},
{
"name": "project root",
"match": "^@(?!(ngworker|internal)).*|^[a-zA-Z].*",
"order": 20
"sourceTag": "scope:internal",
"onlyDependOnLibsWithTags": ["scope:public", "scope:internal"]
},
{
"name": "internal routes",
"match": "^@(ngworker|internal).*",
"order": 30
"sourceTag": "type:app",
"onlyDependOnLibsWithTags": ["type:package"]
},
{ "name": "parent directories", "match": "^\\.\\.", "order": 40 },
{ "name": "current directory", "match": "^\\.", "order": 50 },
{ "name": "third-party", "match": ".*", "order": 10 }
{
"sourceTag": "type:package",
"onlyDependOnLibsWithTags": ["type:package", "type:test-util"]
},
{
"sourceTag": "type:e2e",
"onlyDependOnLibsWithTags": ["type:app"]
}
]
}
],
"quote-props": "off",
"space-before-function-paren": "off",
"space-in-parens": ["off", "never"],
"prefer-arrow/prefer-arrow-functions": "off",
"eqeqeq": "off"
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"extends": ["plugin:etc/recommended", "plugin:rxjs/recommended", "plugin:sonarjs/recommended"],
"rules": {
"etc/no-commented-out-code": "error",
"etc/no-const-enum": "error",
"sonarjs/cognitive-complexity": ["error", 8]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"files": ["*.ts"],
"rules": {
"@angular-eslint/template/eqeqeq": "off",
"@angular-eslint/template/no-negated-async": "off"
"rxjs-angular/prefer-composition": [
"error",
{ "checkDecorators": ["Component", "Directive", "Injectable", "NgModule", "Pipe"] }
]
}
}
]
Expand Down
30 changes: 30 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Setup

description: Setup Node.js, cache and install dependencies

runs:
using: composite
steps:
# Needed for nx affected command, it set the BASE and HEAD env variables
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3

- name: Determine Node.js version
id: node_version
shell: bash
run: echo "node_version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Use Node.js
uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ steps.node_version.outputs.node_version }}
# This doesn't just set the registry url, but also sets
# the right configuration in .npmrc that reads NPM token
# from NPM_AUTH_TOKEN environment variable.
# It actually creates a .npmrc in a temporary folder
# and sets the NPM_CONFIG_USERCONFIG environment variable.
registry-url: https://registry.npmjs.org

- name: Install dependencies
shell: bash
run: yarn install --immutable --immutable-cache
28 changes: 28 additions & 0 deletions .github/actions/ssh-runner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Open SSH debug session

description: SSH into the GitHub runner. Run tmux attach once connected. Run exit to close the session.

# A consumer must add the following permissions
# permissions:
# id-token: write
# contents: read
# actions: read

inputs:
ssh_gateway:
description: The gateway hostname address or IP address.
required: true

runs:
using: composite
steps:
- name: Setup SSH server for Actor
uses: alexellis/setup-sshd-actor@master
- name: Connect to the actuated SSH gateway
uses: alexellis/actuated-ssh-gateway-action@master
with:
gatewayaddr: ${{ inputs.ssh_gateway }}
# Use TLS
secure: true
- name: Setup a blocking tmux session
uses: alexellis/block-with-tmux-action@master
Loading

0 comments on commit 00aba83

Please sign in to comment.