Skip to content

Commit

Permalink
Merge pull request #13 from sevenwestmedia-labs/chore/nx-upgrade
Browse files Browse the repository at this point in the history
upgrade nx, node, pnpm, typescript and more
  • Loading branch information
bennettp123 authored Aug 16, 2024
2 parents 6cd4874 + 1846151 commit 1742c24
Show file tree
Hide file tree
Showing 71 changed files with 7,077 additions and 7,380 deletions.
27 changes: 19 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# Editor configuration, see http://editorconfig.org
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.ts]
indent_size = 4

[*.json]
[*.js]
indent_size = 4

[*.tsx]
indent_size = 4

[*.md]
max_line_length = off
trim_trailing_whitespace = false
[*.jsx]
indent_size = 4

[*.json]
indent_size = 2

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
dist/
57 changes: 22 additions & 35 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {
"@typescript-eslint/no-empty-function": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
}
]
"root": true,
"ignorePatterns": ["!**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
88 changes: 9 additions & 79 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,92 +7,22 @@ on:
- master

jobs:
version:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.version.outputs.changes }} # map step output to job output
steps:
- name: Checkout
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
token: ${{ secrets.SERVICE_ACCOUNT_PAT }}

- name: Enable node
uses: actions/setup-node@master
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'
scope: '@wanews'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Version command
id: version
run: |
npm install --no-package-lock --no-save @changesets/cli
echo ::set-output name=changes::$(npx changeset version 2>&1 | grep -q 'No unreleased changesets found' && echo 'false' || echo 'true')
- name: Push changes
if: steps.version.outputs.changes == 'true'
run: |
git config user.email "[email protected]"
git config user.name "SWM GitHub Service Account"
git add -A
git commit -m "Version packages" || echo "No changes to commit"
git push
build:
runs-on: ubuntu-latest
needs: version
if: always() && needs.version.outputs.changes == 'false'
steps:
- name: Checkout
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/checkout@v4

- name: Enable node
uses: actions/setup-node@master
- uses: pnpm/action-setup@v4
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'
scope: '@wanews'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run_install: false

- name: Cache .pnpm-store
uses: actions/cache@v1
- uses: actions/setup-node@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: |
npm i -g pnpm
pnpm set verify-store-integrity false
- name: pnpm install
run: |
pnpm install --frozen-lockfile
cache: pnpm
node-version-file: .nvmrc

- name: Type check
run: pnpm run build-tsc
- run: pnpm run build

- name: Lint types and code
run: pnpm run lint
- run: pnpm run lint

- name: Run tests
run: pnpm test

- name: Package
run: pnpm package

- name: Release packages
uses: changesets/action@master
with:
publish: pnpx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PAT }}
- run: pnpm test
17 changes: 0 additions & 17 deletions .github/workflows/pr-test-on-comment.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/pr-test-on-reviewed.yml

This file was deleted.

33 changes: 10 additions & 23 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,18 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions/checkout@v4

- name: Enable node
uses: actions/setup-node@master
- uses: pnpm/action-setup@v4
with:
node-version: 14.x
run_install: false

- name: Cache .pnpm-store
uses: actions/cache@v1
- uses: actions/setup-node@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
cache: pnpm
node-version-file: .nvmrc

- name: Install pnpm
run: |
npm i -g pnpm
pnpm set verify-store-integrity false
- name: pnpm install
run: |
pnpm install --frozen-lockfile
- name: Build packages
run: pnpm run build-tsc

- name: Lint types and code
run: pnpm run lint
- run: pnpm install
- run: pnpm run build
- run: pnpm run lint
- run: pnpm run test
33 changes: 0 additions & 33 deletions .github/workflows/tests.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
dist
tmp
/out-tsc
tsconfig.tsbuildinfo

# dependencies
node_modules
Expand Down Expand Up @@ -39,4 +38,5 @@ testem.log
.DS_Store
Thumbs.db

dist/
.nx/cache
.nx/workspace-data
1 change: 1 addition & 0 deletions .node-version
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strict-peer-dependencies=false
auto-install-peers=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
workspace.json
/.nx/cache
/.nx/workspace-data
File renamed without changes.
Loading

0 comments on commit 1742c24

Please sign in to comment.