-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1405 from aligent/chore/DO-1587-migrate-to-yarn
Chore/do 1587 migrate to yarn
- Loading branch information
Showing
100 changed files
with
11,451 additions
and
10,273 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,77 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"commonjs": true, | ||
"es2021": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"overrides": [], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest" | ||
}, | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_" | ||
"root": true, | ||
"ignorePatterns": ["**/*"], | ||
"plugins": ["@nx"], | ||
"extends": ["eslint:recommended", "plugin:prettier/recommended"], | ||
"overrides": [ | ||
{ | ||
"files": "*.json", | ||
"parser": "jsonc-eslint-parser", | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": { | ||
"@nx/enforce-module-boundaries": [ | ||
"error", | ||
{ | ||
"enforceBuildableLibDependency": true, | ||
"allow": [], | ||
"depConstraints": [ | ||
{ | ||
"sourceTag": "*", | ||
"onlyDependOnLibsWithTags": ["*"] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"parserOptions": { | ||
"project": ["./tsconfig.base.json"] | ||
}, | ||
"extends": [ | ||
"plugin:@nx/typescript", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/ban-ts-comment": [ | ||
"error", | ||
{ | ||
"ts-expect-error": "allow-with-description" | ||
} | ||
], | ||
"no-return-await": "off", | ||
"@typescript-eslint/return-await": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_" | ||
} | ||
], | ||
"@nx/enforce-module-boundaries": [ | ||
"error", | ||
{ | ||
"allow": ["@aligent/cdk-esbuild"] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"extends": ["plugin:@nx/javascript"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,43 +2,41 @@ name: Publish to NPM | |
|
||
on: | ||
release: | ||
tags: | ||
- '**-[0-9]+.[0-9]+.[0-9]+' | ||
- '**-[0-9]+.[0-9]+.[0-9]+-*' | ||
tags: | ||
- "**-[0-9]+.[0-9]+.[0-9]+" | ||
- "**-[0-9]+.[0-9]+.[0-9]+-*" | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
name: 🚀 Publish to NPM | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Source checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
# Setting Node environment | ||
- name: Setting up Node environment | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
# Environment configuration | ||
- name: Preparing environment for release | ||
run: | | ||
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "PACKAGE=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV | ||
# Release process | ||
- name: Release | ||
run: | | ||
npm ci | ||
git config --global user.name "Automated NPM Release" | ||
git config --global user.email "[email protected]" | ||
npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${{env.PACKAGE}}" | ||
npm run build --workspace "@aligent/cdk-${{env.PACKAGE}}" | ||
npm test --workspace "@aligent/cdk-${{env.PACKAGE}}" --if-present | ||
npm publish --access public --workspace "@aligent/cdk-${{env.PACKAGE}}" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- run: git push | ||
env: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "yarn" | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Install | ||
run: yarn install | ||
|
||
- name: Preparing environment for release | ||
run: | | ||
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "PACKAGE=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV | ||
- name: Release | ||
run: | | ||
git config --global user.name "Automated NPM Release" | ||
git config --global user.email "[email protected]" | ||
echo "Publishing $PACKAGE @ $VERSION" | ||
yarn config set registry https://registry.npmjs.org/ | ||
yarn nx publish $PACKAGE --ver=$VERSION --tag=latest --verbose | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,7 @@ cdk.out | |
*.js | ||
|
||
# Lock files | ||
package-lock.json | ||
package-lock.json | ||
|
||
# Ignore nx files | ||
.nx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": false, | ||
"arrowParens": "avoid" | ||
"arrowParens": "avoid", | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { getJestProjects } from "@nx/jest"; | ||
|
||
export default { | ||
projects: getJestProjects(), | ||
modulePathIgnorePatterns: ["__data__"], | ||
coverageThreshold: { | ||
global: { | ||
branches: 80, | ||
functions: 80, | ||
lines: 80, | ||
statements: 80, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const nxPreset = require('@nx/jest/preset').default; | ||
|
||
module.exports = { ...nxPreset }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "./node_modules/nx/schemas/nx-schema.json", | ||
"targetDefaults": { | ||
"build": { | ||
"cache": true | ||
}, | ||
"test": { | ||
"cache": true | ||
} | ||
}, | ||
"defaultBase": "main", | ||
"plugins": [ | ||
{ | ||
"plugin": "@nx/eslint/plugin", | ||
"options": { | ||
"targetName": "lint" | ||
} | ||
}, | ||
{ | ||
"plugin": "@nx/jest/plugin", | ||
"options": { | ||
"targetName": "test" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.