Skip to content

Commit

Permalink
Nx config improvements (strapi#16187)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebodin authored Mar 23, 2023
1 parent da8cf68 commit c2732e2
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- uses: nrwl/nx-set-shas@v3
- run: yarn install --frozen-lockfile
- name: Run build:ts
run: yarn nx run-many --target=build:ts --nx-ignore-cycles
- name: Run lint
run: yarn nx affected --target=lint --parallel --nx-ignore-cycles

Expand Down
1 change: 1 addition & 0 deletions .nxignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples/**
30 changes: 18 additions & 12 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,41 @@
"default",
"!{projectRoot}/**/*.test.ts",
"!{projectRoot}/**/*.test.js",
"!{projectRoot}/**/*.md"
"!{projectRoot}/**/*.test.api.js",
"!{projectRoot}/**/__mocks__/**",
"!{projectRoot}/**/__tests__/**",
"!{projectRoot}/**/*.md",
"!{projectRoot}/jest.config.js",
"!{projectRoot}/jest.config.front.js",
"!{projectRoot}/tsconfig.eslint.json",
"!{projectRoot}/.eslintignore",
"!{projectRoot}/.eslintrc.js"
]
},
"cli": {
"packageManager": "yarn"
},
"targetDefaults": {
"build": {
"inputs": ["production", "^production"],
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/lib", "{projectRoot}/build", "{projectRoot}/dist"]
"dependsOn": ["^build"]
},
"build:ts": {
"inputs": ["production", "^production", "{workspaceRoot}/packages/utils/tsconfig/**/*"],
"dependsOn": ["^build:ts"],
"outputs": ["{projectRoot}/lib", "{projectRoot}/build", "{projectRoot}/dist"]
"dependsOn": ["^build:ts"]
},
"test:unit": {
"inputs": ["default", "{projectRoot}/jest.config.js", "{workspaceRoot}/jest-preset.unit.js"],
"inputs": ["default", "{workspaceRoot}/jest-preset.unit.js"],
"dependsOn": ["build:ts"]
},
"test:front": {
"inputs": [
"default",
"{projectRoot}/jest.config.front.js",
"{workspaceRoot}/jest-preset.front.js"
],
"inputs": ["default", "{workspaceRoot}/jest-preset.front.js"],
"dependsOn": ["^build"]
},
"lint": {
"inputs": [
"default",
"{projectRoot}/**/*.js",
"{projectRoot}/**/*.ts",
"{projectRoot}/.eslintrc.js",
"{projectRoot}/.eslintignore",
"{projectRoot}/tsconfig.eslint.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/data-transfer/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
lib/
dist/
.eslintrc.js
jest.config.js
coverage/
2 changes: 1 addition & 1 deletion packages/core/data-transfer/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib/
dist/
12 changes: 6 additions & 6 deletions packages/core/data-transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
"url": "https://strapi.io"
}
],
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"build:ts": "tsc",
"clean": "rimraf ./lib",
"clean": "rimraf ./dist",
"prepublishOnly": "yarn clean && yarn build",
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"watch": "tsc -w --preserveWatchOutput",
"lint": "eslint ."
},
"directories": {
"lib": "./lib"
},
"files": [
"./dist"
],
"dependencies": {
"@strapi/logger": "4.8.2",
"@strapi/strapi": "4.8.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/data-transfer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "tsconfig/base.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "dist"
},
"include": ["types", "src"],
"exclude": ["node_modules", "**/__tests__/**"]
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/logger/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
lib/
dist/
.eslintrc.js
2 changes: 1 addition & 1 deletion packages/utils/logger/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ package-lock.json
testApp
coverage

lib/
dist/
docs/
8 changes: 4 additions & 4 deletions packages/utils/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"url": "https://strapi.io"
}
],
"main": "./lib/index.js",
"types": "./lib/index.ts",
"main": "./dist/index.js",
"types": "./dist/index.ts",
"files": [
"./lib"
"./dist"
],
"scripts": {
"build": "tsc",
"build:ts": "tsc",
"watch": "tsc -w --preserveWatchOutput",
"clean": "rimraf ./lib",
"clean": "rimraf ./dist",
"prepublishOnly": "yarn clean && yarn build",
"lint": "eslint ."
},
Expand Down
7 changes: 0 additions & 7 deletions packages/utils/logger/project.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/utils/logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "tsconfig/base.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "dist"
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/**"]
Expand Down

0 comments on commit c2732e2

Please sign in to comment.