Skip to content

Commit

Permalink
chore: repo updates (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Nov 30, 2023
1 parent 1ab25ba commit b4953d5
Show file tree
Hide file tree
Showing 15 changed files with 408 additions and 1,542 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id: set_nx_run_group
run: |
NX_RUN_GROUP="$GITHUB_RUN_ID--$(uuidgen)"
echo "::set-output name=nx_run_group::$NX_RUN_GROUP"
echo "nx_run_group=$NX_RUN_GROUP" >> $GITHUB_OUTPUT
primary:
name: Primary
Expand All @@ -48,8 +48,8 @@ jobs:
- name: Get yarn cache directory path and node version for cache key and NX_CLOUD_ENV_NAME
id: yarn-cache-dir-path
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=node_version::$(node --version)"
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "node_version=$(node --version)" >> $GITHUB_OUTPUT
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
echo "NX_CLOUD_ENV_NAME=Node $(node --version) -" >> $GITHUB_ENV
Expand Down Expand Up @@ -120,8 +120,8 @@ jobs:
- name: Get yarn cache directory path and node version for cache key
id: yarn-cache-dir-path
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=node_version::$(node --version)"
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "node_version=$(node --version)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand Down Expand Up @@ -167,8 +167,8 @@ jobs:
- name: Get yarn cache directory path and node version for cache key and NX_CLOUD_ENV_NAME
id: yarn-cache-dir-path
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=node_version::$(node --version)"
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "node_version=$(node --version)" >> $GITHUB_OUTPUT
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
# NOTE: We are intentionally not using matrix.node here because that does not contain the full semver value
Expand Down Expand Up @@ -218,8 +218,8 @@ jobs:
- name: Get yarn cache directory path and node version for cache key
id: yarn-cache-dir-path
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=node_version::$(node --version)"
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "node_version=$(node --version)" >> $GITHUB_OUTPUT
- name: Apply version resolved by volta to standard Node action make authenticated npm publish easier
uses: actions/setup-node@v4
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: publish

on:
# Run manually using the GitHub UI
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: false
default: ''
# ...or whenever a GitHub release gets created
release:
types: [published]

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # include tags

- name: Install node and npm based on the volta config in our package.json
uses: volta-cli/action@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: |
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "node_version=$(node --version)" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-${{ steps.yarn-cache-dir-path.outputs.node_version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.yarn-cache-dir-path.outputs.node_version }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash
env:
YARN_CACHE_FOLDER: ${{ steps.yarn-cache-dir-path.outputs.dir }}

- name: Prepare packages for publishing
run: yarn build

- name: Apply updated version to packages
run: |
# Use the version from the workflow input if it's set, otherwise use the tag name from the release
VERSION=${{ github.event.inputs.version || github.ref_name }}
yarn nx release version $VERSION
- name: Publish packages to npm
run: yarn nx release publish --registry https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

10 changes: 7 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"release": {
"groups": {
"npm": {
"releaseTagPattern": "v{version}",
"projects": ["*", "!nx-plugin", "!e2e*"],
"version": {
"generatorOptions": {
Expand All @@ -22,7 +21,7 @@
"workspaceChangelog": {
"createRelease": "github"
},
"projectChangelogs": {}
"projectChangelogs": true
}
},
"targetDefaults": {
Expand All @@ -33,7 +32,12 @@
},
"typecheck": {
"dependsOn": ["^build"],
"cache": true
"cache": true,
"executor": "nx:run-commands",
"options": {
"command": "npx tsc --noEmit -p tsconfig.json",
"cwd": "{projectRoot}"
}
},
"update-rule-docs": {
"dependsOn": ["^build"],
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"yarn": "1.22.21"
},
"workspaces": [
"packages/!(nx-plugin)*"
"packages/*"
],
"contributors": [
"James Henry <angular-eslint@jameshenry.email>"
Expand All @@ -22,7 +22,6 @@
"e2e": "nx e2e e2e",
"update-e2e-snapshots": "nx e2e e2e --updateSnapshot",
"check-clean-workspace-after-install": "git diff --quiet --exit-code",
"clean": "nx reset && lerna clean && nx run-many -t clean",
"cz": "git-cz",
"postinstall": "tools/scripts/postinstall.sh",
"pre-commit": "yarn lint-staged",
Expand All @@ -31,6 +30,7 @@
"format-check": "node node_modules/prettier/bin/prettier.cjs --check \"./**/*.{ts,js,json,md}\"",
"lint": "eslint . --ext .js,.ts",
"typecheck": "nx run-many -t typecheck",
"release": "ts-node --transpile-only tools/scripts/release.ts",
"exec-tool": "ts-node --transpile-only --project tsconfig.tools.json tools/scripts/exec-tool.ts",
"update-configs": "ts-node --transpile-only --project tsconfig.tools.json tools/scripts/generate-configs.ts",
"check-rule-docs": "nx run-many -t check-rule-docs",
Expand All @@ -56,12 +56,12 @@
"@angular/compiler": "17.0.2",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@nx/devkit": "17.1.3",
"@nx/eslint-plugin": "17.1.3",
"@nx/jest": "17.1.3",
"@nx/js": "17.1.3",
"@nx/plugin": "17.1.3",
"@nx/workspace": "17.1.3",
"@nx/devkit": "17.2.0-beta.11",
"@nx/eslint-plugin": "17.2.0-beta.11",
"@nx/jest": "17.2.0-beta.11",
"@nx/js": "17.2.0-beta.11",
"@nx/plugin": "17.2.0-beta.11",
"@nx/workspace": "17.2.0-beta.11",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-typescript": "^11.1.0",
Expand All @@ -73,7 +73,7 @@
"@types/eslint": "8.44.8",
"@types/eslint-scope": "3.7.7",
"@types/jest": "29.4.4",
"@types/node": "20.10.1",
"@types/node": "18.16.9",
"@types/prettier": "2.7.3",
"@typescript-eslint/eslint-plugin": "6.13.1",
"@typescript-eslint/parser": "6.13.1",
Expand All @@ -88,10 +88,9 @@
"json-schema-to-typescript": "13.1.1",
"json-schema-traverse": "1.0.0",
"jsonc-eslint-parser": "^2.1.0",
"lerna": "8.0.0",
"lint-staged": "15.1.0",
"ncp": "2.0.0",
"nx": "17.1.3",
"nx": "17.2.0-beta.11",
"prettier": "3.1.0",
"prettier-v2-for-jest-inline-snapshots": "npm:prettier@^2",
"rimraf": "5.0.5",
Expand Down
17 changes: 1 addition & 16 deletions packages/builder/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,7 @@
"jestConfig": "packages/builder/jest.config.ts"
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/builder",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/builder",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
"typecheck": {}
},
"implicitDependencies": []
}
17 changes: 1 addition & 16 deletions packages/bundled-angular-compiler/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,7 @@
"commands": ["npx rimraf ./dist", "npx rollup -c"]
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/bundled-angular-compiler",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/bundled-angular-compiler",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
"typecheck": {}
},
"implicitDependencies": []
}
17 changes: 1 addition & 16 deletions packages/eslint-plugin-template/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,7 @@
"passWithNoTests": false
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/eslint-plugin-template",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/eslint-plugin-template",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
},
"typecheck": {},
"check-rule-docs": {
"dependsOn": [
{
Expand Down
17 changes: 1 addition & 16 deletions packages/eslint-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,7 @@
"passWithNoTests": false
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/eslint-plugin",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/eslint-plugin",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
},
"typecheck": {},
"check-rule-docs": {
"dependsOn": [
{
Expand Down
17 changes: 1 addition & 16 deletions packages/schematics/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,7 @@
"passWithNoTests": false
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/schematics",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/schematics",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
"typecheck": {}
},
"implicitDependencies": []
}
17 changes: 1 addition & 16 deletions packages/template-parser/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,7 @@
"passWithNoTests": false
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/template-parser",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/template-parser",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
"typecheck": {}
},
"implicitDependencies": []
}
17 changes: 1 addition & 16 deletions packages/utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,7 @@
"commands": ["npx rimraf ./dist", "tsc -p tsconfig.build.json"]
}
},
"clean": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/utils",
"parallel": false,
"commands": ["npx rimraf ./dist"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/utils",
"parallel": false,
"commands": ["npx tsc -p tsconfig.json --noEmit"]
}
}
"typecheck": {}
},
"implicitDependencies": ["bundled-angular-compiler"]
}

0 comments on commit b4953d5

Please sign in to comment.