Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: migrate to Nx workspace #136

Merged
merged 24 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a8319a5
chore: migrate to Nx workspace
LayZeeDK Oct 24, 2022
b39c489
ci: update reusable Nx DTE workflows
LayZeeDK Oct 24, 2022
71325b5
ci: rename SonarCloud job
LayZeeDK Oct 24, 2022
7345265
chore: ignore Angular build cache
LayZeeDK Oct 24, 2022
94b4507
style: format
LayZeeDK Oct 24, 2022
2000d06
chore: fix `use-lumberjack-bundle` target
LayZeeDK Oct 24, 2022
8bfb713
ci: rename SonarCloud job
LayZeeDK Oct 24, 2022
8aeeba6
ci: normalize parameter name
LayZeeDK Oct 24, 2022
03fee68
chore: use independent versioning for packages
LayZeeDK Oct 25, 2022
51d1936
chore: change `type:lib` tag to `type:package`
LayZeeDK Oct 25, 2022
ebc9418
docs: cover project tags
LayZeeDK Oct 25, 2022
1c61ee0
chore: use read-only Nx Cloud access token
LayZeeDK Oct 25, 2022
c2657e2
style: format
LayZeeDK Oct 25, 2022
3360e61
chore: add self-dependency
LayZeeDK Oct 25, 2022
e44ba00
ci: try to use DTE for e2e tests
LayZeeDK Oct 25, 2022
6641826
chore: add configurations to `build` target
LayZeeDK Oct 25, 2022
11a8aa0
chore: cache `build-package` tasks
LayZeeDK Oct 25, 2022
188486c
chore: use built package in `lumberjack-app`
LayZeeDK Oct 25, 2022
f43ebf1
test: assert log payload
LayZeeDK Oct 25, 2022
8f72844
ci: remove `--stop-agents-after` parameter in an attempt to use cache…
LayZeeDK Oct 25, 2022
3f5c701
Revert "ci: remove `--stop-agents-after` parameter in an attempt to u…
LayZeeDK Oct 25, 2022
639e3f9
ci: use Nx Cloud access token from GitHub secret
LayZeeDK Oct 25, 2022
220d951
ci: strict job permissions
LayZeeDK Oct 25, 2022
c4aae29
ci: forward Nx Cloud access token as secret
LayZeeDK Oct 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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",
LayZeeDK marked this conversation as resolved.
Show resolved Hide resolved
"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