diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b0d3719b..7feff571 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -18,13 +18,20 @@ jobs: node-version-file: "package.json" - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn build type-check: @@ -38,13 +45,20 @@ jobs: node-version-file: "package.json" - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn check:types formatting-check: @@ -57,13 +71,20 @@ jobs: node-version-file: "package.json" - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn check:formatting test-unit: @@ -77,13 +98,20 @@ jobs: node-version-file: "package.json" - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn test:unit test-integration: @@ -110,13 +138,20 @@ jobs: node-version: ${{ matrix.node-version }} - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn test:integration test-e2e: @@ -136,13 +171,20 @@ jobs: - uses: volta-cli/action@v3 - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn test:e2e lint: @@ -156,13 +198,20 @@ jobs: node-version-file: "package.json" - name: Use dependency cache uses: actions/cache@v3 - id: cache + id: dependency-cache with: path: "**/node_modules" key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Use build cache + uses: actions/cache@v3 + with: + path: .nxcache + key: build-cache-key-${{ runner.os }}-${{ github.run_id }} + restore-keys: | + build-cache-key-${{ runner.os }}- - name: Install dependencies run: yarn --frozen-lockfile --ignore-engines - if: steps.cache.outputs.cache-hit != 'true' + if: steps.dependency-cache.outputs.cache-hit != 'true' - run: yarn lint artifacts: diff --git a/.gitignore b/.gitignore index cdf43c38..e462f7bc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ yarn-error.log .vscode/settings.json -*.tgz \ No newline at end of file +*.tgz + +.nxcache diff --git a/.prettierignore b/.prettierignore index a409bc29..9c714247 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ packages/e2e-tests/scenarios/*/ref/**/* -packages/bundler-plugin-core/test/fixtures \ No newline at end of file +packages/bundler-plugin-core/test/fixtures +.nxcache diff --git a/lerna.json b/lerna.json index 6280f7dc..f9e81b62 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", "version": "2.0.0", - "packages": "packages/*", "npmClient": "yarn", "useWorkspaces": true } diff --git a/nx.json b/nx.json index a8d43f5c..a69e473c 100644 --- a/nx.json +++ b/nx.json @@ -1,30 +1,37 @@ { - "extends": "nx/presets/npm.json", "$schema": "./node_modules/nx/schemas/nx-schema.json", - "affected": { - "defaultBase": "main" - }, "tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default", "options": { "cacheableOperations": ["build", "lint", "test"], - "parallel": 10 + "cacheDirectory": ".nxcache" } } }, + "namedInputs": { + "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock"] + }, "targetDefaults": { "build": { - "dependsOn": ["^build"] + "inputs": ["sharedGlobals"], + "dependsOn": ["^build"], + "outputs": ["{projectRoot}/dist"] }, "lint": { - "dependsOn": ["^build", "build"] + "inputs": ["sharedGlobals"], + "dependsOn": ["^build", "build"], + "outputs": [] }, "test": { - "dependsOn": ["^build"] + "inputs": ["sharedGlobals"], + "dependsOn": ["^build"], + "outputs": [] }, "check:types": { - "dependsOn": ["^build"] + "inputs": ["sharedGlobals"], + "dependsOn": ["^build"], + "outputs": [] }, "build:npm": { "dependsOn": ["build", "^build"] diff --git a/package.json b/package.json index 168f7ceb..94401948 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@nrwl/cli": "14.5.10", "@nrwl/workspace": "14.5.10", "husky": "^8.0.0", - "lerna": "^6.0.1", + "lerna": "^6.6.2", "nx": "14.5.10", "prettier": "^2.7.1", "pretty-quick": "^3.1.3", diff --git a/yarn.lock b/yarn.lock index 60c2012e..7844cd44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8080,7 +8080,7 @@ kleur@^3.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -lerna@^6.0.1: +lerna@^6.6.2: version "6.6.2" resolved "https://registry.npmjs.org/lerna/-/lerna-6.6.2.tgz#ad921f913aca4e7307123a598768b6f15ca5804f" integrity sha512-W4qrGhcdutkRdHEaDf9eqp7u4JvI+1TwFy5woX6OI8WPe4PYBdxuILAsvhp614fUG41rKSGDKlOh+AWzdSidTg==