diff --git a/.cargo/config.toml b/.cargo/config.toml index cd80114f9371f..e70bce47ee47d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,5 @@ [build] -target-dir = 'build/target' +target-dir = 'dist/target' [target.x86_64-unknown-linux-musl] rustflags = [ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 58cc26c446899..2a59994d5ca00 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,7 +42,7 @@ jobs: # we should generate an applicable version number within publish-resolve-data.js and use a custom ref of the PR branch name. resolve-required-data: name: Resolve Required Data - if: ${{ github.repository_owner == 'nrwl' }} + # if: ${{ github.repository_owner == 'nrwl' }} runs-on: ubuntu-latest outputs: version: ${{ steps.script.outputs.version }} @@ -70,8 +70,8 @@ jobs: check-latest: true # Ensure that the NPM_TOKEN secret is still valid before wasting any time deriving data or building projects - - name: Check NPM Credentials - run: npm whoami && echo "NPM credentials are valid" || (echo "NPM credentials are invalid or have expired." && exit 1) + # - name: Check NPM Credentials + # run: npm whoami && echo "NPM credentials are valid" || (echo "NPM credentials are invalid or have expired." && exit 1) - name: Resolve and set checkout and version data to use for release id: script @@ -89,7 +89,7 @@ jobs: uses: actions/checkout@v4 with: # Check out the latest master branch to get its copy of nx-release.ts - repository: nrwl/nx + repository: ndcunningham/nx ref: master path: latest-master-checkout @@ -102,21 +102,21 @@ jobs: ref: ${{ steps.script.outputs.ref }} path: pr-branch-checkout - - name: (PR Release Only) Ensure that nx-release.ts has not changed in the PR being released - if: ${{ steps.script.outputs.ref != '' }} - env: - FILE_TO_COMPARE: "scripts/nx-release.ts" - run: | - if ! cmp -s "latest-master-checkout/${{ env.FILE_TO_COMPARE }}" "pr-branch-checkout/${{ env.FILE_TO_COMPARE }}"; then - echo "🛑 Error: The file ${{ env.FILE_TO_COMPARE }} is different on the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} vs latest master on nrwl/nx, cancelling workflow. If you did not modify the file, then you likely just need to rebase/merge latest master." - exit 1 - else - echo "✅ The file ${{ env.FILE_TO_COMPARE }} is identical between the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} and latest master on nrwl/nx." - fi + # - name: (PR Release Only) Ensure that nx-release.ts has not changed in the PR being released + # if: ${{ steps.script.outputs.ref != '' }} + # env: + # FILE_TO_COMPARE: "scripts/nx-release.ts" + # run: | + # if ! cmp -s "latest-master-checkout/${{ env.FILE_TO_COMPARE }}" "pr-branch-checkout/${{ env.FILE_TO_COMPARE }}"; then + # echo "🛑 Error: The file ${{ env.FILE_TO_COMPARE }} is different on the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} vs latest master on nrwl/nx, cancelling workflow. If you did not modify the file, then you likely just need to rebase/merge latest master." + # exit 1 + # else + # echo "✅ The file ${{ env.FILE_TO_COMPARE }} is identical between the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} and latest master on nrwl/nx." + # fi build: needs: [ resolve-required-data ] - if: ${{ github.repository_owner == 'nrwl' }} + # if: ${{ github.repository_owner == 'nrwl' }} strategy: fail-fast: false matrix: @@ -354,7 +354,7 @@ jobs: build-freebsd: needs: [ resolve-required-data ] - if: ${{ github.repository_owner == 'nrwl' }} + # if: ${{ github.repository_owner == 'nrwl' }} runs-on: ubuntu-latest name: Build FreeBSD timeout-minutes: 45 @@ -398,8 +398,11 @@ jobs: whoami env freebsd-version + echo "Installing dependencies" pnpm install --frozen-lockfile --ignore-scripts + echo "Building FreeBSD bindings" pnpm nx run-many --verbose --outputStyle stream --target=build-native -- --target=x86_64-unknown-freebsd + echo "Cleaning up" pnpm nx reset rm -rf node_modules rm -rf dist diff --git a/.gitignore b/.gitignore index 2ad20cc68ecfa..7cbe79448831e 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ CHANGELOG.md .next out + # Angular Cache .angular diff --git a/docs/generated/devkit/AggregateCreateNodesError.md b/docs/generated/devkit/AggregateCreateNodesError.md index 894fc07e96695..4d54508e7103d 100644 --- a/docs/generated/devkit/AggregateCreateNodesError.md +++ b/docs/generated/devkit/AggregateCreateNodesError.md @@ -93,8 +93,6 @@ Error.cause • `Readonly` **errors**: [file: string, error: Error][] -An array of tuples that represent errors encountered when processing a given file. An example entry might look like ['path/to/project.json', [Error: 'Invalid JSON. Unexpected token 'a' in JSON at position 0]] - --- ### message @@ -121,8 +119,6 @@ Error.name • `Readonly` **partialResults**: [`CreateNodesResultV2`](/reference/core-api/devkit/documents/CreateNodesResultV2) -The partial results of the `createNodesV2` function. This should be the results for each file that didn't encounter an issue. - --- ### pluginIndex diff --git a/docs/generated/devkit/ProjectGraphProjectNode.md b/docs/generated/devkit/ProjectGraphProjectNode.md index f846b9dcaf68c..fb7b52da0f9dd 100644 --- a/docs/generated/devkit/ProjectGraphProjectNode.md +++ b/docs/generated/devkit/ProjectGraphProjectNode.md @@ -8,7 +8,7 @@ A node describing a project in a workspace - [data](/reference/core-api/devkit/documents/ProjectGraphProjectNode#data): ProjectConfiguration & Object - [name](/reference/core-api/devkit/documents/ProjectGraphProjectNode#name): string -- [type](/reference/core-api/devkit/documents/ProjectGraphProjectNode#type): "lib" | "app" | "e2e" +- [type](/reference/core-api/devkit/documents/ProjectGraphProjectNode#type): "app" | "e2e" | "lib" ## Properties @@ -28,4 +28,4 @@ Additional metadata about a project ### type -• **type**: `"lib"` \| `"app"` \| `"e2e"` +• **type**: `"app"` \| `"e2e"` \| `"lib"` diff --git a/docs/generated/devkit/addProjectConfiguration.md b/docs/generated/devkit/addProjectConfiguration.md index 83956ad940307..fa191278fd2a0 100644 --- a/docs/generated/devkit/addProjectConfiguration.md +++ b/docs/generated/devkit/addProjectConfiguration.md @@ -6,12 +6,12 @@ Adds project configuration to the Nx workspace. #### Parameters -| Name | Type | Default value | Description | -| :--------------------- | :---------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](/reference/core-api/devkit/documents/Tree) | `undefined` | the file system tree | -| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](/reference/core-api/devkit/documents/ProjectConfiguration) | `undefined` | project configuration | -| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | +| Name | Type | Description | +| :--------------------- | :---------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](/reference/core-api/devkit/documents/Tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](/reference/core-api/devkit/documents/ProjectConfiguration) | project configuration | +| `standalone?` | `boolean` | whether the project is configured in workspace.json or not | #### Returns diff --git a/docs/generated/devkit/createProjectGraphAsync.md b/docs/generated/devkit/createProjectGraphAsync.md index efa9a2d762dca..fcb7983dcf084 100644 --- a/docs/generated/devkit/createProjectGraphAsync.md +++ b/docs/generated/devkit/createProjectGraphAsync.md @@ -28,7 +28,7 @@ stored in the daemon process. To reset both run: `nx reset`. | Name | Type | | :------------------------ | :-------- | -| `opts` | `Object` | +| `opts?` | `Object` | | `opts.exitOnError` | `boolean` | | `opts.resetDaemonClient?` | `boolean` | diff --git a/docs/generated/devkit/detectPackageManager.md b/docs/generated/devkit/detectPackageManager.md index cbe7c23532200..4feec9aa9d1ac 100644 --- a/docs/generated/devkit/detectPackageManager.md +++ b/docs/generated/devkit/detectPackageManager.md @@ -6,9 +6,9 @@ Detects which package manager is used in the workspace based on the lock file. #### Parameters -| Name | Type | Default value | -| :---- | :------- | :------------ | -| `dir` | `string` | `''` | +| Name | Type | +| :----- | :------- | +| `dir?` | `string` | #### Returns diff --git a/docs/generated/devkit/getOutputsForTargetAndConfiguration.md b/docs/generated/devkit/getOutputsForTargetAndConfiguration.md index 2207a60404e61..6d74be6c9cef9 100644 --- a/docs/generated/devkit/getOutputsForTargetAndConfiguration.md +++ b/docs/generated/devkit/getOutputsForTargetAndConfiguration.md @@ -19,8 +19,6 @@ Pass the target and overrides instead. This will be removed in v20. ▸ **getOutputsForTargetAndConfiguration**(`target`, `overrides`, `node`): `string`[] -Returns the list of outputs that will be cached. - #### Parameters | Name | Type | diff --git a/docs/generated/devkit/getPackageManagerCommand.md b/docs/generated/devkit/getPackageManagerCommand.md index f88747f14bc34..6ca8277aedcad 100644 --- a/docs/generated/devkit/getPackageManagerCommand.md +++ b/docs/generated/devkit/getPackageManagerCommand.md @@ -14,10 +14,10 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`); #### Parameters -| Name | Type | Default value | Description | -| :--------------- | :---------------------------------------------------------------------- | :-------------- | :------------------------------------------------------------------------------------------ | -| `packageManager` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | `undefined` | The package manager to use. If not provided, it will be detected based on the lock file. | -| `root` | `string` | `workspaceRoot` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | +| `packageManager?` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | The package manager to use. If not provided, it will be detected based on the lock file. | +| `root?` | `string` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | #### Returns diff --git a/docs/generated/devkit/getPackageManagerVersion.md b/docs/generated/devkit/getPackageManagerVersion.md index 1c5f84eed321f..c6651334895a1 100644 --- a/docs/generated/devkit/getPackageManagerVersion.md +++ b/docs/generated/devkit/getPackageManagerVersion.md @@ -8,10 +8,10 @@ but it can also be passed in explicitly. #### Parameters -| Name | Type | -| :--------------- | :---------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | -| `cwd` | `string` | +| Name | Type | +| :---------------- | :---------------------------------------------------------------------- | +| `packageManager?` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | +| `cwd?` | `string` | #### Returns diff --git a/docs/generated/devkit/isWorkspacesEnabled.md b/docs/generated/devkit/isWorkspacesEnabled.md index 6d71751e5732f..7bfca2b22a1b1 100644 --- a/docs/generated/devkit/isWorkspacesEnabled.md +++ b/docs/generated/devkit/isWorkspacesEnabled.md @@ -6,10 +6,10 @@ Returns true if the workspace is using npm workspaces, yarn workspaces, or pnpm #### Parameters -| Name | Type | Default value | Description | -| :--------------- | :---------------------------------------------------------------------- | :-------------- | :------------------------------------------------------------------------------------------ | -| `packageManager` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | `undefined` | The package manager to use. If not provided, it will be detected based on the lock file. | -| `root` | `string` | `workspaceRoot` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | +| Name | Type | Description | +| :---------------- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | +| `packageManager?` | [`PackageManager`](/reference/core-api/devkit/documents/PackageManager) | The package manager to use. If not provided, it will be detected based on the lock file. | +| `root?` | `string` | The directory the commands will be ran inside of. Defaults to the current workspace's root. | #### Returns diff --git a/docs/generated/devkit/ngcli_adapter/NxScopedHost.md b/docs/generated/devkit/ngcli_adapter/NxScopedHost.md index 59adcb8624835..4b0b86320a71e 100644 --- a/docs/generated/devkit/ngcli_adapter/NxScopedHost.md +++ b/docs/generated/devkit/ngcli_adapter/NxScopedHost.md @@ -16,7 +16,7 @@ - [\_delegate](/reference/core-api/devkit/documents/ngcli_adapter/NxScopedHost#_delegate): Host - [\_root](/reference/core-api/devkit/documents/ngcli_adapter/NxScopedHost#_root): Path -- [root](/reference/core-api/devkit/documents/ngcli_adapter/NxScopedHost#root): string +- [root](/reference/core-api/devkit/documents/ngcli_adapter/NxScopedHost#root): any ### Accessors @@ -84,7 +84,7 @@ virtualFs.ScopedHost.\_root ### root -• `Private` **root**: `string` +• `Private` **root**: `any` ## Accessors diff --git a/e2e/angular/package.json b/e2e/angular/package.json new file mode 100644 index 0000000000000..b4541f61fc417 --- /dev/null +++ b/e2e/angular/package.json @@ -0,0 +1,11 @@ +{ + "name": "@nx/e2e-angular", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*", + "@nx/workspace": "workspace:*" + } +} diff --git a/e2e/angular/src/config.test.ts b/e2e/angular/src/config.test.ts index ea730c70a7329..8696340e980de 100644 --- a/e2e/angular/src/config.test.ts +++ b/e2e/angular/src/config.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('angular.json v1 config', () => { const app1 = uniq('app1'); diff --git a/e2e/angular/src/cypress-component-tests.test.ts b/e2e/angular/src/cypress-component-tests.test.ts index 5ce393768a99e..6e90fbfedab9b 100644 --- a/e2e/angular/src/cypress-component-tests.test.ts +++ b/e2e/angular/src/cypress-component-tests.test.ts @@ -10,7 +10,7 @@ import { removeFile, checkFilesExist, updateJson, -} from '../../utils'; +} from '@nx/e2e-utils'; import { names } from '@nx/devkit'; import { join } from 'path'; diff --git a/e2e/angular/src/misc.test.ts b/e2e/angular/src/misc.test.ts index f6fe69fe35a4b..5758e45c7c7c0 100644 --- a/e2e/angular/src/misc.test.ts +++ b/e2e/angular/src/misc.test.ts @@ -6,9 +6,8 @@ import { runCLI, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { classify } from '@nx/devkit/src/utils/string-utils'; -import { join } from 'path'; describe('Move Angular Project', () => { let proj: string; diff --git a/e2e/angular/src/module-federation.rspack.test.ts b/e2e/angular/src/module-federation.rspack.test.ts index e8585e588e3b9..17cbadd483074 100644 --- a/e2e/angular/src/module-federation.rspack.test.ts +++ b/e2e/angular/src/module-federation.rspack.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Angular Module Federation', () => { diff --git a/e2e/angular/src/module-federation.test.ts b/e2e/angular/src/module-federation.test.ts index eb78d0176a40c..229a99ad8434c 100644 --- a/e2e/angular/src/module-federation.test.ts +++ b/e2e/angular/src/module-federation.test.ts @@ -12,7 +12,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Angular Module Federation', () => { diff --git a/e2e/angular/src/ng-add.test.ts b/e2e/angular/src/ng-add.test.ts index 0dc85b76ed040..a97cd4b395021 100644 --- a/e2e/angular/src/ng-add.test.ts +++ b/e2e/angular/src/ng-add.test.ts @@ -11,7 +11,7 @@ import { runNgNew, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { PackageManager } from 'nx/src/utils/package-manager'; describe('convert Angular CLI workspace to an Nx workspace', () => { diff --git a/e2e/angular/src/ngrx.test.ts b/e2e/angular/src/ngrx.test.ts index aa2948937b101..ea8c1ee77bd50 100644 --- a/e2e/angular/src/ngrx.test.ts +++ b/e2e/angular/src/ngrx.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCLIAsync, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Angular Package', () => { describe('ngrx', () => { diff --git a/e2e/angular/src/plugin.test.ts b/e2e/angular/src/plugin.test.ts index 7a1c69ead7d4d..e3da49de9cb33 100644 --- a/e2e/angular/src/plugin.test.ts +++ b/e2e/angular/src/plugin.test.ts @@ -13,7 +13,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { angularCliVersion } from '@nx/workspace/src/utils/versions'; import { ensureDirSync } from 'fs-extra'; import { execSync } from 'node:child_process'; diff --git a/e2e/angular/src/projects.test.ts b/e2e/angular/src/projects.test.ts index dfd92eb8a7f4b..9023a7241d930 100644 --- a/e2e/angular/src/projects.test.ts +++ b/e2e/angular/src/projects.test.ts @@ -17,7 +17,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join, normalize } from 'path'; describe('Angular Projects', () => { diff --git a/e2e/angular/src/tailwind.test.ts b/e2e/angular/src/tailwind.test.ts index b8e107c96569b..02ad4d658524a 100644 --- a/e2e/angular/src/tailwind.test.ts +++ b/e2e/angular/src/tailwind.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Tailwind support', () => { diff --git a/e2e/angular/tsconfig.json b/e2e/angular/tsconfig.json index 6d5abf8483200..ee91e6d286989 100644 --- a/e2e/angular/tsconfig.json +++ b/e2e/angular/tsconfig.json @@ -6,6 +6,18 @@ "include": [], "files": [], "references": [ + { + "path": "../../packages/workspace" + }, + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/angular/tsconfig.spec.json b/e2e/angular/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/angular/tsconfig.spec.json +++ b/e2e/angular/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/cypress/package.json b/e2e/cypress/package.json new file mode 100644 index 0000000000000..61d474bd3e9d5 --- /dev/null +++ b/e2e/cypress/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-cypress", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/cypress/src/cypress-legacy.test.ts b/e2e/cypress/src/cypress-legacy.test.ts index 744ea99ee34b1..0e244a2e48840 100644 --- a/e2e/cypress/src/cypress-legacy.test.ts +++ b/e2e/cypress/src/cypress-legacy.test.ts @@ -5,7 +5,7 @@ import { runCLI, runE2ETests, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; const TEN_MINS_MS = 600_000; diff --git a/e2e/cypress/src/cypress.test.ts b/e2e/cypress/src/cypress.test.ts index 8d66ed31fe729..261898c6f6532 100644 --- a/e2e/cypress/src/cypress.test.ts +++ b/e2e/cypress/src/cypress.test.ts @@ -9,7 +9,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; const TEN_MINS_MS = 600_000; diff --git a/e2e/cypress/tsconfig.json b/e2e/cypress/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/cypress/tsconfig.json +++ b/e2e/cypress/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/cypress/tsconfig.spec.json b/e2e/cypress/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/cypress/tsconfig.spec.json +++ b/e2e/cypress/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/detox/package.json b/e2e/detox/package.json new file mode 100644 index 0000000000000..1645d318c5d26 --- /dev/null +++ b/e2e/detox/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-detox", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/detox/src/detox-legacy.test.ts b/e2e/detox/src/detox-legacy.test.ts index 47235659371b7..4293faf82a4eb 100644 --- a/e2e/detox/src/detox-legacy.test.ts +++ b/e2e/detox/src/detox-legacy.test.ts @@ -7,7 +7,7 @@ import { uniq, killPorts, cleanupProject, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('@nx/detox (legacy)', () => { const appName = uniq('myapp'); diff --git a/e2e/detox/src/detox.test.ts b/e2e/detox/src/detox.test.ts index c068e9de380b2..ebfd19778d2ce 100644 --- a/e2e/detox/src/detox.test.ts +++ b/e2e/detox/src/detox.test.ts @@ -5,7 +5,7 @@ import { uniq, readJson, updateJson, -} from 'e2e/utils'; +} from '@nx/e2e-utils'; describe('@nx/detox', () => { let project: string; diff --git a/e2e/detox/tsconfig.json b/e2e/detox/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/detox/tsconfig.json +++ b/e2e/detox/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/detox/tsconfig.spec.json b/e2e/detox/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/detox/tsconfig.spec.json +++ b/e2e/detox/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/esbuild/package.json b/e2e/esbuild/package.json new file mode 100644 index 0000000000000..7bec8438bd3b4 --- /dev/null +++ b/e2e/esbuild/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-esbuild", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/esbuild/src/esbuild.test.ts b/e2e/esbuild/src/esbuild.test.ts index acae44e230ff2..6b0fa10ad09a7 100644 --- a/e2e/esbuild/src/esbuild.test.ts +++ b/e2e/esbuild/src/esbuild.test.ts @@ -15,7 +15,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('EsBuild Plugin', () => { diff --git a/e2e/esbuild/tsconfig.json b/e2e/esbuild/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/esbuild/tsconfig.json +++ b/e2e/esbuild/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/esbuild/tsconfig.spec.json b/e2e/esbuild/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/esbuild/tsconfig.spec.json +++ b/e2e/esbuild/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/eslint/package.json b/e2e/eslint/package.json new file mode 100644 index 0000000000000..cb3fe7697eca1 --- /dev/null +++ b/e2e/eslint/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-eslint", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/eslint/src/linter-legacy.test.ts b/e2e/eslint/src/linter-legacy.test.ts index f47d099fac65e..91f9ead9c25e3 100644 --- a/e2e/eslint/src/linter-legacy.test.ts +++ b/e2e/eslint/src/linter-legacy.test.ts @@ -11,7 +11,7 @@ import { runCreateWorkspace, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Linter (legacy)', () => { describe('Integrated (eslintrc config)', () => { diff --git a/e2e/eslint/src/linter.test.ts b/e2e/eslint/src/linter.test.ts index f688c5ed3472f..514af67622001 100644 --- a/e2e/eslint/src/linter.test.ts +++ b/e2e/eslint/src/linter.test.ts @@ -11,7 +11,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import * as ts from 'typescript'; describe('Linter', () => { diff --git a/e2e/eslint/tsconfig.json b/e2e/eslint/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/eslint/tsconfig.json +++ b/e2e/eslint/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/eslint/tsconfig.spec.json b/e2e/eslint/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/eslint/tsconfig.spec.json +++ b/e2e/eslint/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/expo/package.json b/e2e/expo/package.json new file mode 100644 index 0000000000000..51a4eb22e375d --- /dev/null +++ b/e2e/expo/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-expo", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/expo/src/expo-legacy.test.ts b/e2e/expo/src/expo-legacy.test.ts index 6860fb6800233..3f73dbfbb2770 100644 --- a/e2e/expo/src/expo-legacy.test.ts +++ b/e2e/expo/src/expo-legacy.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ChildProcess } from 'child_process'; import { join } from 'path'; diff --git a/e2e/expo/src/expo.test.ts b/e2e/expo/src/expo.test.ts index 3859edc626aa5..61872b2bc187d 100644 --- a/e2e/expo/src/expo.test.ts +++ b/e2e/expo/src/expo.test.ts @@ -14,7 +14,7 @@ import { killPorts, createFile, removeFile, -} from 'e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('@nx/expo', () => { diff --git a/e2e/expo/tsconfig.json b/e2e/expo/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/expo/tsconfig.json +++ b/e2e/expo/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/expo/tsconfig.spec.json b/e2e/expo/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/expo/tsconfig.spec.json +++ b/e2e/expo/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/gradle/package.json b/e2e/gradle/package.json new file mode 100644 index 0000000000000..227c40a19c4f0 --- /dev/null +++ b/e2e/gradle/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-gradle", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/gradle/src/gradle-import.test.ts b/e2e/gradle/src/gradle-import.test.ts index 77898640ee2e4..183fca9e6afed 100644 --- a/e2e/gradle/src/gradle-import.test.ts +++ b/e2e/gradle/src/gradle-import.test.ts @@ -10,7 +10,7 @@ import { readJson, runCommand, createFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { mkdirSync, rmdirSync, writeFileSync } from 'fs'; import { execSync } from 'node:child_process'; import { join } from 'path'; diff --git a/e2e/gradle/src/gradle-plugin-v1.test.ts b/e2e/gradle/src/gradle-plugin-v1.test.ts index e17a34074e256..166c8c681c995 100644 --- a/e2e/gradle/src/gradle-plugin-v1.test.ts +++ b/e2e/gradle/src/gradle-plugin-v1.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { basename, dirname, join } from 'path'; import { createGradleProject } from './utils/create-gradle-project'; diff --git a/e2e/gradle/src/gradle.test.ts b/e2e/gradle/src/gradle.test.ts index b1c4cc349175c..85fd483d82bf7 100644 --- a/e2e/gradle/src/gradle.test.ts +++ b/e2e/gradle/src/gradle.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { createGradleProject } from './utils/create-gradle-project'; diff --git a/e2e/gradle/src/utils/create-gradle-project.ts b/e2e/gradle/src/utils/create-gradle-project.ts index 2cddb5851a61c..e90b2b519ec24 100644 --- a/e2e/gradle/src/utils/create-gradle-project.ts +++ b/e2e/gradle/src/utils/create-gradle-project.ts @@ -3,7 +3,7 @@ import { isWindows, runCommand, tmpProjPath, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import { readFileSync } from 'fs'; import { createFileSync, writeFileSync } from 'fs-extra'; diff --git a/e2e/gradle/tsconfig.json b/e2e/gradle/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/gradle/tsconfig.json +++ b/e2e/gradle/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/gradle/tsconfig.spec.json b/e2e/gradle/tsconfig.spec.json index 1a24bfb0a1353..97710f252a908 100644 --- a/e2e/gradle/tsconfig.spec.json +++ b/e2e/gradle/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, @@ -14,6 +13,7 @@ "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx", + "src/**/*.ts", "**/*.d.ts", "jest.config.ts" ] diff --git a/e2e/jest.preset.e2e.js b/e2e/jest.preset.e2e.js index 30a04b21e78ba..dd9c3b9e3028f 100644 --- a/e2e/jest.preset.e2e.js +++ b/e2e/jest.preset.e2e.js @@ -2,5 +2,8 @@ const preset = require('../jest.preset'); // The root preset sets up the environment for unit tests. delete preset.setupFiles; +delete preset.moduleNameMapper; -module.exports = preset; +module.exports = { + ...preset, +}; diff --git a/e2e/jest/package.json b/e2e/jest/package.json new file mode 100644 index 0000000000000..90c8f56312c76 --- /dev/null +++ b/e2e/jest/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-jest", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/jest/src/jest-legacy.test.ts b/e2e/jest/src/jest-legacy.test.ts index a78d7d0fc46df..62bcf17519913 100644 --- a/e2e/jest/src/jest-legacy.test.ts +++ b/e2e/jest/src/jest-legacy.test.ts @@ -7,7 +7,7 @@ import { updateFile, expectJestTestsToPass, cleanupProject, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Jest', () => { beforeAll(() => { diff --git a/e2e/jest/src/jest-root.test.ts b/e2e/jest/src/jest-root.test.ts index 90b4c24dfa29e..f549cbf05b10f 100644 --- a/e2e/jest/src/jest-root.test.ts +++ b/e2e/jest/src/jest-root.test.ts @@ -1,4 +1,4 @@ -import { newProject, runCLI, runCLIAsync, uniq } from '@nx/e2e/utils'; +import { newProject, runCLI, runCLIAsync, uniq } from '@nx/e2e-utils'; describe('Jest root projects', () => { const myapp = uniq('myapp'); diff --git a/e2e/jest/src/jest.test.ts b/e2e/jest/src/jest.test.ts index eebf07802fddd..1c5afdbbb597a 100644 --- a/e2e/jest/src/jest.test.ts +++ b/e2e/jest/src/jest.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Jest', () => { beforeAll(() => { diff --git a/e2e/jest/tsconfig.json b/e2e/jest/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/jest/tsconfig.json +++ b/e2e/jest/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/jest/tsconfig.spec.json b/e2e/jest/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/jest/tsconfig.spec.json +++ b/e2e/jest/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/js/package.json b/e2e/js/package.json new file mode 100644 index 0000000000000..a759ec016db00 --- /dev/null +++ b/e2e/js/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-js", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/js/src/js-executor-copy-workspace-modules.test.ts b/e2e/js/src/js-executor-copy-workspace-modules.test.ts index 1e07c66c1d6ce..a44dbd463ecc3 100644 --- a/e2e/js/src/js-executor-copy-workspace-modules.test.ts +++ b/e2e/js/src/js-executor-copy-workspace-modules.test.ts @@ -2,14 +2,12 @@ import { checkFilesExist, cleanupProject, newProject, - readFile, - readJson, runCLI, uniq, updateJson, updateFile, runCommand, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('@nx/js:copy-workspace-modules', () => { let scope: string; diff --git a/e2e/js/src/js-executor-node.test.ts b/e2e/js/src/js-executor-node.test.ts index 31a554cae4622..4a541ec872f56 100644 --- a/e2e/js/src/js-executor-node.test.ts +++ b/e2e/js/src/js-executor-node.test.ts @@ -5,7 +5,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('js:node executor', () => { diff --git a/e2e/js/src/js-executor-prune-lockfile.test.ts b/e2e/js/src/js-executor-prune-lockfile.test.ts index 29485748af9ae..cb6b6e06f0a9a 100644 --- a/e2e/js/src/js-executor-prune-lockfile.test.ts +++ b/e2e/js/src/js-executor-prune-lockfile.test.ts @@ -8,7 +8,7 @@ import { updateJson, runCommand, tmpProjPath, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('js:prune-lockfile executor', () => { describe.each([ diff --git a/e2e/js/src/js-executor-swc.test.ts b/e2e/js/src/js-executor-swc.test.ts index 29073b47a71ac..c63353aa0f14a 100644 --- a/e2e/js/src/js-executor-swc.test.ts +++ b/e2e/js/src/js-executor-swc.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '../../utils'; +} from '@nx/e2e-utils'; describe('js:swc executor', () => { let scope: string; diff --git a/e2e/js/src/js-executor-tsc.test.ts b/e2e/js/src/js-executor-tsc.test.ts index d4685d8a74ae7..c46bc340ccefa 100644 --- a/e2e/js/src/js-executor-tsc.test.ts +++ b/e2e/js/src/js-executor-tsc.test.ts @@ -19,7 +19,7 @@ import { updateFile, updateJson, waitUntil, -} from '../../utils'; +} from '@nx/e2e-utils'; describe('js:tsc executor', () => { let scope; diff --git a/e2e/js/src/js-generators.ts b/e2e/js/src/js-generators.ts index fcd90d488d070..07e6b961c670f 100644 --- a/e2e/js/src/js-generators.ts +++ b/e2e/js/src/js-generators.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '../../utils'; +} from '@nx/e2e-utils'; describe('js e2e', () => { let scope: string; @@ -57,8 +57,9 @@ describe('js e2e', () => { // Lint const result = runCLI(`lint ${dirName}-${libName}`); - expect(result).toContain(`Linting "${dirName}-${libName}"...`); - expect(result).toContain('All files pass linting'); + expect(result).toContain( + `Successfully ran target lint for project ${dirName}-${libName}` + ); // Test const testResult = await runCLIAsync(`test ${dirName}-${libName}`); @@ -122,7 +123,10 @@ describe('js e2e', () => { updateJson('nx.json', (json) => { json.targetDefaults.build = { ...json.targetDefaults.build, - dependsOn: [...json.targetDefaults.build.dependsOn, '^my-custom-build'], + dependsOn: [ + ...(json.targetDefaults.build?.dependsOn || []), + '^my-custom-build', + ], }; return json; }); diff --git a/e2e/js/src/js-inlining.test.ts b/e2e/js/src/js-inlining.test.ts index 3ab1a817017d2..bbc7d7fdf408e 100644 --- a/e2e/js/src/js-inlining.test.ts +++ b/e2e/js/src/js-inlining.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; describe('inlining', () => { diff --git a/e2e/js/src/js-packaging.test.ts b/e2e/js/src/js-packaging.test.ts index 43e92e606af03..518e8aef15392 100644 --- a/e2e/js/src/js-packaging.test.ts +++ b/e2e/js/src/js-packaging.test.ts @@ -10,8 +10,7 @@ import { getPackageManagerCommand, readJson, updateFile, - renameFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('packaging libs', () => { diff --git a/e2e/js/src/js-ts-solution.test.ts b/e2e/js/src/js-ts-solution.test.ts index f4ce92e89b6e8..8c436912ebbc9 100644 --- a/e2e/js/src/js-ts-solution.test.ts +++ b/e2e/js/src/js-ts-solution.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('JS - TS solution setup', () => { beforeAll(() => { diff --git a/e2e/js/tsconfig.json b/e2e/js/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/js/tsconfig.json +++ b/e2e/js/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/js/tsconfig.spec.json b/e2e/js/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/js/tsconfig.spec.json +++ b/e2e/js/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/lerna-smoke-tests/package.json b/e2e/lerna-smoke-tests/package.json new file mode 100644 index 0000000000000..d0330220612a8 --- /dev/null +++ b/e2e/lerna-smoke-tests/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-lerna-smoke-tests", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts index 22c8ffcbebae3..bdddb8842a59d 100644 --- a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts +++ b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts @@ -9,7 +9,7 @@ import { runLernaCLI, tmpProjPath, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/lerna-smoke-tests/tsconfig.json b/e2e/lerna-smoke-tests/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/lerna-smoke-tests/tsconfig.json +++ b/e2e/lerna-smoke-tests/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/lerna-smoke-tests/tsconfig.spec.json b/e2e/lerna-smoke-tests/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/lerna-smoke-tests/tsconfig.spec.json +++ b/e2e/lerna-smoke-tests/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/next/package.json b/e2e/next/package.json new file mode 100644 index 0000000000000..25b69ef0b6d57 --- /dev/null +++ b/e2e/next/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-next", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/next/src/next-appdir.test.ts b/e2e/next/src/next-appdir.test.ts index ebc9a7d308cd3..737f48809a5c5 100644 --- a/e2e/next/src/next-appdir.test.ts +++ b/e2e/next/src/next-appdir.test.ts @@ -7,7 +7,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Next.js App Router', () => { let proj: string; diff --git a/e2e/next/src/next-component-tests.test.ts b/e2e/next/src/next-component-tests.test.ts index daf2ac00880f2..ff291ff45949b 100644 --- a/e2e/next/src/next-component-tests.test.ts +++ b/e2e/next/src/next-component-tests.test.ts @@ -2,11 +2,12 @@ import { cleanupProject, createFile, newProject, + packageInstall, runCLI, runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('NextJs Component Testing', () => { beforeAll(() => { @@ -110,6 +111,9 @@ function addBabelSupport(path: string) { ); }); + // Install babel-plugin-istanbul needed for code coverage + packageInstall('babel-plugin-istanbul', null, '7.0.0'); + // added needed .babelrc file with defaults createFile( `${path}/.babelrc`, diff --git a/e2e/next/src/next-jest-config.test.ts b/e2e/next/src/next-jest-config.test.ts index 76184e91642f0..830f47d6ab5e2 100644 --- a/e2e/next/src/next-jest-config.test.ts +++ b/e2e/next/src/next-jest-config.test.ts @@ -4,9 +4,7 @@ import { newProject, runCLI, uniq, - updateFile, - readFile, -} from 'e2e/utils'; +} from '@nx/e2e-utils'; describe('Next.js Jest Configuration', () => { let proj: string; diff --git a/e2e/next/src/next-legacy.test.ts b/e2e/next/src/next-legacy.test.ts index c1418f45ebe33..3bac77f4dc47e 100644 --- a/e2e/next/src/next-legacy.test.ts +++ b/e2e/next/src/next-legacy.test.ts @@ -17,7 +17,7 @@ import { uniq, updateFile, updateJson, -} from 'e2e/utils'; +} from '@nx/e2e-utils'; import { mkdirSync, removeSync } from 'fs-extra'; import { join } from 'path'; import { checkApp } from './utils'; diff --git a/e2e/next/src/next-playwright-standalone-eslint.test.ts b/e2e/next/src/next-playwright-standalone-eslint.test.ts index 0df2b56bc3e44..4081ea60f7ed6 100644 --- a/e2e/next/src/next-playwright-standalone-eslint.test.ts +++ b/e2e/next/src/next-playwright-standalone-eslint.test.ts @@ -5,7 +5,7 @@ import { runCLI, runCreateWorkspace, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; // This test exists as coverage for a previous regression describe('nextjs standalone playwright linting', () => { diff --git a/e2e/next/src/next-playwright.test.ts b/e2e/next/src/next-playwright.test.ts index 7d5131a3a0d8a..e49f2729e340d 100644 --- a/e2e/next/src/next-playwright.test.ts +++ b/e2e/next/src/next-playwright.test.ts @@ -5,7 +5,7 @@ import { newProject, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Next Playwright e2e tests', () => { let projectName; diff --git a/e2e/next/src/next-storybook.test.ts b/e2e/next/src/next-storybook.test.ts index bfff89e910db2..6790231734ef1 100644 --- a/e2e/next/src/next-storybook.test.ts +++ b/e2e/next/src/next-storybook.test.ts @@ -4,7 +4,7 @@ import { newProject, runCLI, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Next.js Storybook', () => { const appName = uniq('app'); diff --git a/e2e/next/src/next-styles.test.ts b/e2e/next/src/next-styles.test.ts index b8d58707864d8..732f7667b8dd8 100644 --- a/e2e/next/src/next-styles.test.ts +++ b/e2e/next/src/next-styles.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, readFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { checkApp } from './utils'; describe('Next.js Styles', () => { diff --git a/e2e/next/src/next-svgr.test.ts b/e2e/next/src/next-svgr.test.ts index 6a6092d401c1d..c0531a1067a5b 100644 --- a/e2e/next/src/next-svgr.test.ts +++ b/e2e/next/src/next-svgr.test.ts @@ -9,7 +9,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('NextJs SVGR support', () => { beforeAll(() => { diff --git a/e2e/next/src/next-ts-solutions.test.ts b/e2e/next/src/next-ts-solutions.test.ts index 62e14b9db0be8..5bfc0d3a03d43 100644 --- a/e2e/next/src/next-ts-solutions.test.ts +++ b/e2e/next/src/next-ts-solutions.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Next TS Solutions', () => { let proj: string; diff --git a/e2e/next/src/next-webpack.test.ts b/e2e/next/src/next-webpack.test.ts index 543a0397e4c60..90efd41243adb 100644 --- a/e2e/next/src/next-webpack.test.ts +++ b/e2e/next/src/next-webpack.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Next.js Webpack', () => { diff --git a/e2e/next/src/next.test.ts b/e2e/next/src/next.test.ts index b2e5774a2087a..cdc17aae1d35a 100644 --- a/e2e/next/src/next.test.ts +++ b/e2e/next/src/next.test.ts @@ -9,7 +9,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { checkApp } from './utils'; describe('Next.js Applications', () => { diff --git a/e2e/next/src/utils.ts b/e2e/next/src/utils.ts index 47c11e38ddb6f..dbd64a2139112 100644 --- a/e2e/next/src/utils.ts +++ b/e2e/next/src/utils.ts @@ -6,7 +6,7 @@ import { runCLI, runCLIAsync, runE2ETests, -} from '../../utils'; +} from '@nx/e2e-utils'; export async function checkApp( appName: string, diff --git a/e2e/next/tsconfig.json b/e2e/next/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/next/tsconfig.json +++ b/e2e/next/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/next/tsconfig.spec.json b/e2e/next/tsconfig.spec.json index 1a24bfb0a1353..97710f252a908 100644 --- a/e2e/next/tsconfig.spec.json +++ b/e2e/next/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, @@ -14,6 +13,7 @@ "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx", + "src/**/*.ts", "**/*.d.ts", "jest.config.ts" ] diff --git a/e2e/node/package.json b/e2e/node/package.json new file mode 100644 index 0000000000000..4fd7b853ac8dc --- /dev/null +++ b/e2e/node/package.json @@ -0,0 +1,9 @@ +{ + "name": "@nx/e2e-node", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/node/src/node-esbuild.test.ts b/e2e/node/src/node-esbuild.test.ts index 5b9da308d0bf5..9c5779bcc91c2 100644 --- a/e2e/node/src/node-esbuild.test.ts +++ b/e2e/node/src/node-esbuild.test.ts @@ -9,7 +9,7 @@ import { runCommandUntil, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Node Applications + esbuild', () => { beforeAll(() => diff --git a/e2e/node/src/node-server.test.ts b/e2e/node/src/node-server.test.ts index f5eb58552d62e..1851953f8cf4e 100644 --- a/e2e/node/src/node-server.test.ts +++ b/e2e/node/src/node-server.test.ts @@ -12,7 +12,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Node Applications + webpack', () => { diff --git a/e2e/node/src/node-ts-solution-esbuild.test.ts b/e2e/node/src/node-ts-solution-esbuild.test.ts index 9dd31d668afe3..44247f9ff309f 100644 --- a/e2e/node/src/node-ts-solution-esbuild.test.ts +++ b/e2e/node/src/node-ts-solution-esbuild.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; let originalEnvPort; diff --git a/e2e/node/src/node-ts-solution.test.ts b/e2e/node/src/node-ts-solution.test.ts index b2b0db4d9b804..abe24ced8ada2 100644 --- a/e2e/node/src/node-ts-solution.test.ts +++ b/e2e/node/src/node-ts-solution.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import * as http from 'http'; diff --git a/e2e/node/src/node-webpack.test.ts b/e2e/node/src/node-webpack.test.ts index 2d98ee18ea71d..082ba853b4390 100644 --- a/e2e/node/src/node-webpack.test.ts +++ b/e2e/node/src/node-webpack.test.ts @@ -12,7 +12,7 @@ import { updateFile, updateJson, promisifiedTreeKill, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import { join } from 'path'; diff --git a/e2e/node/src/node.test.ts b/e2e/node/src/node.test.ts index 8a850f9c69f32..1f49279e980fd 100644 --- a/e2e/node/src/node.test.ts +++ b/e2e/node/src/node.test.ts @@ -22,7 +22,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import * as http from 'http'; import { getLockFileName } from '@nx/js'; diff --git a/e2e/node/tsconfig.json b/e2e/node/tsconfig.json index 6d5abf8483200..87628a14dd415 100644 --- a/e2e/node/tsconfig.json +++ b/e2e/node/tsconfig.json @@ -6,6 +6,12 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/node/tsconfig.spec.json b/e2e/node/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/node/tsconfig.spec.json +++ b/e2e/node/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/nuxt/package.json b/e2e/nuxt/package.json new file mode 100644 index 0000000000000..f763f9bd1dc0c --- /dev/null +++ b/e2e/nuxt/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-nuxt", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/nuxt/src/nuxt.test.ts b/e2e/nuxt/src/nuxt.test.ts index c7e61b64e5fb1..d7ec12659ebc1 100644 --- a/e2e/nuxt/src/nuxt.test.ts +++ b/e2e/nuxt/src/nuxt.test.ts @@ -6,7 +6,7 @@ import { readJson, runCLI, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Nuxt Plugin', () => { const app = uniq('app'); diff --git a/e2e/nuxt/tsconfig.json b/e2e/nuxt/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/nuxt/tsconfig.json +++ b/e2e/nuxt/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/nuxt/tsconfig.spec.json b/e2e/nuxt/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/nuxt/tsconfig.spec.json +++ b/e2e/nuxt/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/nx-init/package.json b/e2e/nx-init/package.json new file mode 100644 index 0000000000000..e1fdd01f81a4b --- /dev/null +++ b/e2e/nx-init/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-nx-init", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/nx-init/src/nx-init-angular.test.ts b/e2e/nx-init/src/nx-init-angular.test.ts index 5c482724f8678..326ef2c9efc42 100644 --- a/e2e/nx-init/src/nx-init-angular.test.ts +++ b/e2e/nx-init/src/nx-init-angular.test.ts @@ -9,7 +9,7 @@ import { runCLI, runCommand, runNgNew, -} from '../../utils'; +} from '@nx/e2e-utils'; describe('nx init (Angular CLI - legacy)', () => { let project: string; diff --git a/e2e/nx-init/src/nx-init-monorepo.test.ts b/e2e/nx-init/src/nx-init-monorepo.test.ts index 12c31adc57018..9023b56750313 100644 --- a/e2e/nx-init/src/nx-init-monorepo.test.ts +++ b/e2e/nx-init/src/nx-init-monorepo.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCommand, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('nx init (Monorepo - legacy)', () => { beforeAll(() => { diff --git a/e2e/nx-init/src/nx-init-nest.test.ts b/e2e/nx-init/src/nx-init-nest.test.ts index e48cb9bf0acfb..3f6977644a9eb 100644 --- a/e2e/nx-init/src/nx-init-nest.test.ts +++ b/e2e/nx-init/src/nx-init-nest.test.ts @@ -4,7 +4,7 @@ import { getPackageManagerCommand, getPublishedVersion, runCLI, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import { removeSync } from 'fs-extra'; diff --git a/e2e/nx-init/src/nx-init-npm-repo.test.ts b/e2e/nx-init/src/nx-init-npm-repo.test.ts index 66f7a22d7db29..4bf7def6530d7 100644 --- a/e2e/nx-init/src/nx-init-npm-repo.test.ts +++ b/e2e/nx-init/src/nx-init-npm-repo.test.ts @@ -8,7 +8,7 @@ import { runCLI, runCommand, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('nx init (NPM repo - legacy)', () => { const pmc = getPackageManagerCommand({ diff --git a/e2e/nx-init/src/nx-init-react.test.ts b/e2e/nx-init/src/nx-init-react.test.ts index ffc428b1718ad..13fd980fb7783 100644 --- a/e2e/nx-init/src/nx-init-react.test.ts +++ b/e2e/nx-init/src/nx-init-react.test.ts @@ -10,15 +10,13 @@ import { runCLI, runCommand, updateFile, -} from '@nx/e2e/utils'; -import { copySync, renameSync } from 'fs-extra'; -import { sync as globSync } from 'glob'; -import { join } from 'path'; -import { createNonNxProjectDirectory, tmpProjPath, updateJson, -} from '../../utils'; +} from '@nx/e2e-utils'; +import { copySync, renameSync } from 'fs-extra'; +import { sync as globSync } from 'glob'; +import { join } from 'path'; describe('nx init (React)', () => { let pmc: ReturnType; diff --git a/e2e/nx-init/tsconfig.json b/e2e/nx-init/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/nx-init/tsconfig.json +++ b/e2e/nx-init/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/nx-init/tsconfig.spec.json b/e2e/nx-init/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/nx-init/tsconfig.spec.json +++ b/e2e/nx-init/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/nx/package.json b/e2e/nx/package.json new file mode 100644 index 0000000000000..4d448ab252044 --- /dev/null +++ b/e2e/nx/package.json @@ -0,0 +1,9 @@ +{ + "name": "@nx/e2e-nx", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/nx/src/affected-graph.test.ts b/e2e/nx/src/affected-graph.test.ts index 0e3171e215f91..8e329c51d451b 100644 --- a/e2e/nx/src/affected-graph.test.ts +++ b/e2e/nx/src/affected-graph.test.ts @@ -14,7 +14,7 @@ import { isWindows, fileExists, removeFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Nx Affected and Graph Tests', () => { diff --git a/e2e/nx/src/cache.test.ts b/e2e/nx/src/cache.test.ts index fa4e8c01e9d48..c427c12a3c432 100644 --- a/e2e/nx/src/cache.test.ts +++ b/e2e/nx/src/cache.test.ts @@ -12,7 +12,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { fork } from 'child_process'; import { readdir, stat } from 'fs/promises'; diff --git a/e2e/nx/src/extras.test.ts b/e2e/nx/src/extras.test.ts index d3c22490f8391..d4b3e46a26f8c 100644 --- a/e2e/nx/src/extras.test.ts +++ b/e2e/nx/src/extras.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Extra Nx Misc Tests', () => { diff --git a/e2e/nx/src/graph-ts-solution.test.ts b/e2e/nx/src/graph-ts-solution.test.ts index 1d669144c9ba9..d726eeebe31c5 100644 --- a/e2e/nx/src/graph-ts-solution.test.ts +++ b/e2e/nx/src/graph-ts-solution.test.ts @@ -11,7 +11,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { basename } from 'node:path'; describe('Graph - TS solution setup', () => { diff --git a/e2e/nx/src/import.test.ts b/e2e/nx/src/import.test.ts index 05548f58fedf8..2d8206c719387 100644 --- a/e2e/nx/src/import.test.ts +++ b/e2e/nx/src/import.test.ts @@ -10,7 +10,7 @@ import { readFile, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { writeFileSync, mkdirSync, rmdirSync } from 'fs'; import { execSync } from 'node:child_process'; import { join } from 'path'; diff --git a/e2e/nx/src/invoke-runner.test.ts b/e2e/nx/src/invoke-runner.test.ts index a8ce6a954773b..374787a96153f 100644 --- a/e2e/nx/src/invoke-runner.test.ts +++ b/e2e/nx/src/invoke-runner.test.ts @@ -6,7 +6,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Invoke Runner', () => { diff --git a/e2e/nx/src/misc.test.ts b/e2e/nx/src/misc.test.ts index 215de28011085..6727a942b8f91 100644 --- a/e2e/nx/src/misc.test.ts +++ b/e2e/nx/src/misc.test.ts @@ -19,7 +19,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { renameSync, writeFileSync } from 'fs'; import { ensureDirSync } from 'fs-extra'; import * as path from 'path'; @@ -188,10 +188,37 @@ describe('Nx Commands', () => { expect(listOutput).toContain('@nx/workspace'); // temporarily make it look like this isn't installed - renameSync( - tmpProjPath('node_modules/@nx/next'), - tmpProjPath('node_modules/@nx/next_tmp') - ); + // For pnpm, we need to rename the actual package in .pnpm directory, not just the symlink + const { readdirSync, statSync } = require('fs'); + const pnpmDir = tmpProjPath('node_modules/.pnpm'); + let renamedPnpmEntry = null; + + if (require('fs').existsSync(pnpmDir)) { + const entries = readdirSync(pnpmDir); + const nextEntries = entries.filter((entry) => + entry.includes('nx+next@') + ); + + // Rename all nx+next entries + const renamedEntries = []; + for (const entry of nextEntries) { + const tmpName = entry.replace('@nx+next@', 'tmp_nx_next_'); + renameSync( + tmpProjPath(`node_modules/.pnpm/${entry}`), + tmpProjPath(`node_modules/.pnpm/${tmpName}`) + ); + renamedEntries.push(entry); + } + renamedPnpmEntry = renamedEntries; + } + + // Also rename the symlink + if (require('fs').existsSync(tmpProjPath('node_modules/@nx/next'))) { + renameSync( + tmpProjPath('node_modules/@nx/next'), + tmpProjPath('node_modules/@nx/next_tmp') + ); + } listOutput = runCLI('list'); expect(listOutput).toContain('NX Also available'); @@ -218,7 +245,7 @@ describe('Nx Commands', () => { // check for builders expect(listOutput).toContain('package'); - // // look for uninstalled core plugin + // look for uninstalled core plugin listOutput = runCLI('list @nx/next'); expect(listOutput).toContain('NX @nx/next is not currently installed'); @@ -230,11 +257,23 @@ describe('Nx Commands', () => { 'NX @wibble/fish is not currently installed' ); - // put back the @nx/angular module (or all the other e2e tests after this will fail) - renameSync( - tmpProjPath('node_modules/@nx/next_tmp'), - tmpProjPath('node_modules/@nx/next') - ); + // put back the @nx/next module (or all the other e2e tests after this will fail) + if (renamedPnpmEntry && Array.isArray(renamedPnpmEntry)) { + for (const entry of renamedPnpmEntry) { + const tmpName = entry.replace('@nx+next@', 'tmp_nx_next_'); + renameSync( + tmpProjPath(`node_modules/.pnpm/${tmpName}`), + tmpProjPath(`node_modules/.pnpm/${entry}`) + ); + } + } + + if (require('fs').existsSync(tmpProjPath('node_modules/@nx/next_tmp'))) { + renameSync( + tmpProjPath('node_modules/@nx/next_tmp'), + tmpProjPath('node_modules/@nx/next') + ); + } }, 120000); }); @@ -523,6 +562,12 @@ describe('migrate', () => { }); it('should run migrations', () => { + // Ensure package.json has a trailing newline so migration can preserve it + const packageJsonContent = readFile('package.json'); + if (!packageJsonContent.endsWith('\n')) { + updateFile('package.json', packageJsonContent + '\n'); + } + updateJson('nx.json', (j: NxJsonConfiguration) => { j.installation = { version: getPublishedVersion(), @@ -563,6 +608,7 @@ describe('migrate', () => { ); // should keep new line on package const packageContent = readFile('package.json'); + console.log('[DEBUG]: Package contents', packageContent); expect(packageContent.charCodeAt(packageContent.length - 1)).toEqual(10); // creates migrations.json diff --git a/e2e/nx/src/nx-cloud.test.ts b/e2e/nx/src/nx-cloud.test.ts index 34d7e357b9864..54186d069eaf2 100644 --- a/e2e/nx/src/nx-cloud.test.ts +++ b/e2e/nx/src/nx-cloud.test.ts @@ -1,4 +1,4 @@ -import { cleanupProject, newProject, runCLI } from '@nx/e2e/utils'; +import { cleanupProject, newProject, runCLI } from '@nx/e2e-utils'; describe('Nx Cloud', () => { beforeAll(() => diff --git a/e2e/nx/src/nxw.test.ts b/e2e/nx/src/nxw.test.ts index 448d198fcdb25..9ed8bed596d4e 100644 --- a/e2e/nx/src/nxw.test.ts +++ b/e2e/nx/src/nxw.test.ts @@ -10,7 +10,7 @@ import { uniq, readJson, readFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { bold } from 'chalk'; describe('nx wrapper / .nx installation', () => { @@ -67,6 +67,7 @@ describe('nx wrapper / .nx installation', () => { const output = runNxWrapper('report'); expect(output).toMatch(new RegExp(`nx.*:.*${getPublishedVersion()}`)); expect(output).toMatch(new RegExp(`@nx/js.*:.*${getPublishedVersion()}`)); + // nx express exists in the workspace, but it is not installed expect(output).not.toContain('@nx/express'); }); diff --git a/e2e/nx/src/run.test.ts b/e2e/nx/src/run.test.ts index a9f2e7f97c69c..7d3ececa81f7a 100644 --- a/e2e/nx/src/run.test.ts +++ b/e2e/nx/src/run.test.ts @@ -13,7 +13,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { PackageJson } from 'nx/src/utils/package-json'; import * as path from 'path'; diff --git a/e2e/nx/src/watch.test.ts b/e2e/nx/src/watch.test.ts index 4f563a1f13452..35a104e7effc5 100644 --- a/e2e/nx/src/watch.test.ts +++ b/e2e/nx/src/watch.test.ts @@ -8,7 +8,7 @@ import { updateJson, isVerboseE2ERun, readFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { spawn } from 'child_process'; import { join } from 'path'; import { writeFileSync, mkdtempSync } from 'fs'; diff --git a/e2e/nx/src/workspace-legacy.test.ts b/e2e/nx/src/workspace-legacy.test.ts index f3283e7fcf6e2..bdacae592e962 100644 --- a/e2e/nx/src/workspace-legacy.test.ts +++ b/e2e/nx/src/workspace-legacy.test.ts @@ -5,7 +5,7 @@ import { runCLI, runE2ETests, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; let proj: string; diff --git a/e2e/nx/src/workspace.test.ts b/e2e/nx/src/workspace.test.ts index 6c6b1fb85e08c..235bdee00449b 100644 --- a/e2e/nx/src/workspace.test.ts +++ b/e2e/nx/src/workspace.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; let proj: string; diff --git a/e2e/nx/tsconfig.json b/e2e/nx/tsconfig.json index 6d5abf8483200..ad27a563db5da 100644 --- a/e2e/nx/tsconfig.json +++ b/e2e/nx/tsconfig.json @@ -6,6 +6,12 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/nx/tsconfig.spec.json b/e2e/nx/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/nx/tsconfig.spec.json +++ b/e2e/nx/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/playwright/package.json b/e2e/playwright/package.json new file mode 100644 index 0000000000000..6889156fca1bf --- /dev/null +++ b/e2e/playwright/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-playwright", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/playwright/src/playwright.test.ts b/e2e/playwright/src/playwright.test.ts index 93dc170f433c9..bab5ea0b6a7ce 100644 --- a/e2e/playwright/src/playwright.test.ts +++ b/e2e/playwright/src/playwright.test.ts @@ -7,7 +7,7 @@ import { getPackageManagerCommand, getSelectedPackageManager, readJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; const TEN_MINS_MS = 600_000; diff --git a/e2e/playwright/tsconfig.json b/e2e/playwright/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/playwright/tsconfig.json +++ b/e2e/playwright/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/playwright/tsconfig.spec.json b/e2e/playwright/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/playwright/tsconfig.spec.json +++ b/e2e/playwright/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/plugin/package.json b/e2e/plugin/package.json new file mode 100644 index 0000000000000..e2f5773c88562 --- /dev/null +++ b/e2e/plugin/package.json @@ -0,0 +1,9 @@ +{ + "name": "@nx/e2e-plugin", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/plugin/src/nx-plugin-ts-solution.test.ts b/e2e/plugin/src/nx-plugin-ts-solution.test.ts index bc245f7c228cc..281617e9eae62 100644 --- a/e2e/plugin/src/nx-plugin-ts-solution.test.ts +++ b/e2e/plugin/src/nx-plugin-ts-solution.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ASYNC_GENERATOR_EXECUTOR_CONTENTS, NX_PLUGIN_V2_CONTENTS, diff --git a/e2e/plugin/src/nx-plugin.test.ts b/e2e/plugin/src/nx-plugin.test.ts index d1b2f0eefdd48..5ac2224bd75f7 100644 --- a/e2e/plugin/src/nx-plugin.test.ts +++ b/e2e/plugin/src/nx-plugin.test.ts @@ -13,7 +13,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import type { PackageJson } from 'nx/src/utils/package-json'; import { join } from 'path'; diff --git a/e2e/plugin/tsconfig.json b/e2e/plugin/tsconfig.json index 6d5abf8483200..ad27a563db5da 100644 --- a/e2e/plugin/tsconfig.json +++ b/e2e/plugin/tsconfig.json @@ -6,6 +6,12 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/plugin/tsconfig.spec.json b/e2e/plugin/tsconfig.spec.json index 1a24bfb0a1353..97710f252a908 100644 --- a/e2e/plugin/tsconfig.spec.json +++ b/e2e/plugin/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, @@ -14,6 +13,7 @@ "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx", + "src/**/*.ts", "**/*.d.ts", "jest.config.ts" ] diff --git a/e2e/react-native/package.json b/e2e/react-native/package.json new file mode 100644 index 0000000000000..0388def823f5a --- /dev/null +++ b/e2e/react-native/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-react-native", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/react-native/src/react-native-legacy.test.ts b/e2e/react-native/src/react-native-legacy.test.ts index c0494c49fd7a8..3314994d917bf 100644 --- a/e2e/react-native/src/react-native-legacy.test.ts +++ b/e2e/react-native/src/react-native-legacy.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ChildProcess } from 'child_process'; import { join } from 'path'; diff --git a/e2e/react-native/src/react-native.test.ts b/e2e/react-native/src/react-native.test.ts index 956fffa2c0601..e07f39ac19352 100644 --- a/e2e/react-native/src/react-native.test.ts +++ b/e2e/react-native/src/react-native.test.ts @@ -10,7 +10,7 @@ import { checkFilesExist, runE2ETests, updateFile, -} from 'e2e/utils'; +} from '@nx/e2e-utils'; describe('@nx/react-native', () => { let proj: string; diff --git a/e2e/react-native/tsconfig.json b/e2e/react-native/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/react-native/tsconfig.json +++ b/e2e/react-native/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/react-native/tsconfig.spec.json b/e2e/react-native/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/react-native/tsconfig.spec.json +++ b/e2e/react-native/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/react/package.json b/e2e/react/package.json new file mode 100644 index 0000000000000..ff945b3af1bad --- /dev/null +++ b/e2e/react/package.json @@ -0,0 +1,10 @@ +{ + "name": "@nx/e2e-react", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/react/src/cypress-component-tests.test.ts b/e2e/react/src/cypress-component-tests.test.ts index b3135ca3320b2..c669cc0576d17 100644 --- a/e2e/react/src/cypress-component-tests.test.ts +++ b/e2e/react/src/cypress-component-tests.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '../../utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('React Cypress Component Tests', () => { diff --git a/e2e/react/src/module-federation/core.rspack.test.ts b/e2e/react/src/module-federation/core.rspack.test.ts index be41596882f8d..20fb95aadf6d6 100644 --- a/e2e/react/src/module-federation/core.rspack.test.ts +++ b/e2e/react/src/module-federation/core.rspack.test.ts @@ -11,7 +11,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('React Rspack Module Federation', () => { diff --git a/e2e/react/src/module-federation/core.webpack.test.ts b/e2e/react/src/module-federation/core.webpack.test.ts index 416faba66644b..24cc3e7581aec 100644 --- a/e2e/react/src/module-federation/core.webpack.test.ts +++ b/e2e/react/src/module-federation/core.webpack.test.ts @@ -11,7 +11,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('React Module Federation', () => { diff --git a/e2e/react/src/module-federation/dynamic-federation.rspack.test.ts b/e2e/react/src/module-federation/dynamic-federation.rspack.test.ts index 90cfbe0bdc6ce..aa30950352837 100644 --- a/e2e/react/src/module-federation/dynamic-federation.rspack.test.ts +++ b/e2e/react/src/module-federation/dynamic-federation.rspack.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('Dynamic Module Federation', () => { diff --git a/e2e/react/src/module-federation/dynamic-federation.webpack.test.ts b/e2e/react/src/module-federation/dynamic-federation.webpack.test.ts index b48d8c0194693..b45d5c496b83b 100644 --- a/e2e/react/src/module-federation/dynamic-federation.webpack.test.ts +++ b/e2e/react/src/module-federation/dynamic-federation.webpack.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('Dynamic Module Federation', () => { diff --git a/e2e/react/src/module-federation/federate-module.rspack.test.ts b/e2e/react/src/module-federation/federate-module.rspack.test.ts index 41f458e26b674..267383c50a8c0 100644 --- a/e2e/react/src/module-federation/federate-module.rspack.test.ts +++ b/e2e/react/src/module-federation/federate-module.rspack.test.ts @@ -6,7 +6,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('Federate Module', () => { diff --git a/e2e/react/src/module-federation/federate-module.webpack.test.ts b/e2e/react/src/module-federation/federate-module.webpack.test.ts index 3c1283f88ee1d..3aa68eb54523e 100644 --- a/e2e/react/src/module-federation/federate-module.webpack.test.ts +++ b/e2e/react/src/module-federation/federate-module.webpack.test.ts @@ -6,7 +6,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('Federate Module', () => { diff --git a/e2e/react/src/module-federation/independent-deployability.rspack.test.ts b/e2e/react/src/module-federation/independent-deployability.rspack.test.ts index 5ecd66c6d47f4..82f6e4b9bcc54 100644 --- a/e2e/react/src/module-federation/independent-deployability.rspack.test.ts +++ b/e2e/react/src/module-federation/independent-deployability.rspack.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { stripIndents } from 'nx/src/utils/strip-indents'; import { readPort, runCLI } from './utils'; diff --git a/e2e/react/src/module-federation/independent-deployability.webpack.test.ts b/e2e/react/src/module-federation/independent-deployability.webpack.test.ts index 51c86ad829df5..ecf468169e0e0 100644 --- a/e2e/react/src/module-federation/independent-deployability.webpack.test.ts +++ b/e2e/react/src/module-federation/independent-deployability.webpack.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { stripIndents } from 'nx/src/utils/strip-indents'; import { readPort, runCLI } from './utils'; diff --git a/e2e/react/src/module-federation/misc.rspack.test.ts b/e2e/react/src/module-federation/misc.rspack.test.ts index 414b5169e31e1..28d587386e262 100644 --- a/e2e/react/src/module-federation/misc.rspack.test.ts +++ b/e2e/react/src/module-federation/misc.rspack.test.ts @@ -6,7 +6,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; import { stripIndents } from 'nx/src/utils/strip-indents'; diff --git a/e2e/react/src/module-federation/ssr.rspack.test.ts b/e2e/react/src/module-federation/ssr.rspack.test.ts index 7433dfa5f66bd..441baa93ac08e 100644 --- a/e2e/react/src/module-federation/ssr.rspack.test.ts +++ b/e2e/react/src/module-federation/ssr.rspack.test.ts @@ -9,7 +9,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readPort, runCLI } from './utils'; describe('React Rspack SSR Module Federation', () => { diff --git a/e2e/react/src/module-federation/utils.ts b/e2e/react/src/module-federation/utils.ts index 0873adb6067bc..42eb191d6b3e6 100644 --- a/e2e/react/src/module-federation/utils.ts +++ b/e2e/react/src/module-federation/utils.ts @@ -1,4 +1,4 @@ -import { readJson, runCLI as _runCLI } from '@nx/e2e/utils'; +import { readJson, runCLI as _runCLI } from '@nx/e2e-utils'; import { join } from 'path'; export function readPort(appName: string): number { diff --git a/e2e/react/src/playwright.test.ts b/e2e/react/src/playwright.test.ts index 4686d33163a3e..a342b22b250fd 100644 --- a/e2e/react/src/playwright.test.ts +++ b/e2e/react/src/playwright.test.ts @@ -5,7 +5,7 @@ import { newProject, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('React Playwright e2e tests', () => { let projectName; diff --git a/e2e/react/src/react-package-legacy.test.ts b/e2e/react/src/react-package-legacy.test.ts index 1fb4a7404f945..5f3db8599a136 100644 --- a/e2e/react/src/react-package-legacy.test.ts +++ b/e2e/react/src/react-package-legacy.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { names } from '@nx/devkit'; import { join } from 'path'; diff --git a/e2e/react/src/react-package.test.ts b/e2e/react/src/react-package.test.ts index f89dafec04696..803498d687a31 100644 --- a/e2e/react/src/react-package.test.ts +++ b/e2e/react/src/react-package.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { names } from '@nx/devkit'; import { join } from 'path'; diff --git a/e2e/react/src/react-router.test.ts b/e2e/react/src/react-router.test.ts index 53d2ab19d5fa3..30fa173533b0e 100644 --- a/e2e/react/src/react-router.test.ts +++ b/e2e/react/src/react-router.test.ts @@ -6,7 +6,7 @@ import { readFile, runCLI, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('React Router Applications', () => { describe('TS paths', () => { diff --git a/e2e/react/src/react-rsbuild.test.ts b/e2e/react/src/react-rsbuild.test.ts index 22f39be4976a5..adf504d9562a3 100644 --- a/e2e/react/src/react-rsbuild.test.ts +++ b/e2e/react/src/react-rsbuild.test.ts @@ -6,7 +6,7 @@ import { runCLIAsync, runE2ETests, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Build React applications and libraries with Rsbuild', () => { beforeAll(() => { diff --git a/e2e/react/src/react-rspack.test.ts b/e2e/react/src/react-rspack.test.ts index c3fa9c9ccfbdf..036a01420ebf5 100644 --- a/e2e/react/src/react-rspack.test.ts +++ b/e2e/react/src/react-rspack.test.ts @@ -8,7 +8,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Build React applications and libraries with Rspack', () => { let proj: string; diff --git a/e2e/react/src/react-ts-solution.test.ts b/e2e/react/src/react-ts-solution.test.ts index 1acc99d6a5389..18ef46dd37d3d 100644 --- a/e2e/react/src/react-ts-solution.test.ts +++ b/e2e/react/src/react-ts-solution.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('React (TS solution)', () => { let workspaceName: string; diff --git a/e2e/react/src/react-vite.test.ts b/e2e/react/src/react-vite.test.ts index 15f5cbb5db419..e798f17adf6b5 100644 --- a/e2e/react/src/react-vite.test.ts +++ b/e2e/react/src/react-vite.test.ts @@ -8,7 +8,7 @@ import { runCLIAsync, runE2ETests, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Build React applications and libraries with Vite', () => { beforeAll(() => { diff --git a/e2e/react/src/react-webpack.test.ts b/e2e/react/src/react-webpack.test.ts index 84e1742d2631c..6f6ea2f77f62f 100644 --- a/e2e/react/src/react-webpack.test.ts +++ b/e2e/react/src/react-webpack.test.ts @@ -10,7 +10,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Build React applications and libraries with Webpack', () => { beforeAll(() => { diff --git a/e2e/react/src/react.test.ts b/e2e/react/src/react.test.ts index 68a5b537465ca..e4a1658821788 100644 --- a/e2e/react/src/react.test.ts +++ b/e2e/react/src/react.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readFileSync } from 'fs-extra'; import { join } from 'path'; diff --git a/e2e/react/tsconfig.json b/e2e/react/tsconfig.json index 6d5abf8483200..2d7b9ef08b0a9 100644 --- a/e2e/react/tsconfig.json +++ b/e2e/react/tsconfig.json @@ -6,6 +6,15 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/react/tsconfig.spec.json b/e2e/react/tsconfig.spec.json index 1a24bfb0a1353..97710f252a908 100644 --- a/e2e/react/tsconfig.spec.json +++ b/e2e/react/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, @@ -14,6 +13,7 @@ "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx", + "src/**/*.ts", "**/*.d.ts", "jest.config.ts" ] diff --git a/e2e/release/package.json b/e2e/release/package.json new file mode 100644 index 0000000000000..f49af26fb915c --- /dev/null +++ b/e2e/release/package.json @@ -0,0 +1,10 @@ +{ + "name": "@nx/e2e-release", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/release/src/circular-dependencies.test.ts b/e2e/release/src/circular-dependencies.test.ts index 5dad7feaf405a..45d16dc497253 100644 --- a/e2e/release/src/circular-dependencies.test.ts +++ b/e2e/release/src/circular-dependencies.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'node:child_process'; import { resetWorkspaceContext } from 'nx/src/utils/workspace-context'; diff --git a/e2e/release/src/conventional-commits-config.test.ts b/e2e/release/src/conventional-commits-config.test.ts index 1c22800d91821..40f183a91f6d4 100644 --- a/e2e/release/src/conventional-commits-config.test.ts +++ b/e2e/release/src/conventional-commits-config.test.ts @@ -7,7 +7,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/create-github-release.test.ts b/e2e/release/src/create-github-release.test.ts index 9ee45a66b828c..d07e62a3ed784 100644 --- a/e2e/release/src/create-github-release.test.ts +++ b/e2e/release/src/create-github-release.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/custom-registries.test.ts b/e2e/release/src/custom-registries.test.ts index b74055d483119..fce910c2342dd 100644 --- a/e2e/release/src/custom-registries.test.ts +++ b/e2e/release/src/custom-registries.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; import { NxReleaseVersionConfiguration } from 'nx/src/config/nx-json'; import type { PackageJson } from 'nx/src/utils/package-json'; diff --git a/e2e/release/src/first-release.test.ts b/e2e/release/src/first-release.test.ts index 91640cdbdd662..de48e2df27c09 100644 --- a/e2e/release/src/first-release.test.ts +++ b/e2e/release/src/first-release.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/independent-projects.test.ts b/e2e/release/src/independent-projects.test.ts index bf39698a36c59..e0566c4a60a5e 100644 --- a/e2e/release/src/independent-projects.test.ts +++ b/e2e/release/src/independent-projects.test.ts @@ -10,7 +10,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; expect.addSnapshotSerializer({ diff --git a/e2e/release/src/lock-file-updates.test.ts b/e2e/release/src/lock-file-updates.test.ts index d11017804ed17..3767d96fe80c3 100644 --- a/e2e/release/src/lock-file-updates.test.ts +++ b/e2e/release/src/lock-file-updates.test.ts @@ -6,7 +6,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/multiple-release-branches.test.ts b/e2e/release/src/multiple-release-branches.test.ts index e9edeed31029c..31c321a8dab2f 100644 --- a/e2e/release/src/multiple-release-branches.test.ts +++ b/e2e/release/src/multiple-release-branches.test.ts @@ -8,7 +8,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/nx-release-git-operations.test.ts b/e2e/release/src/nx-release-git-operations.test.ts index 1ac784ccdbbd1..a12d705a37040 100644 --- a/e2e/release/src/nx-release-git-operations.test.ts +++ b/e2e/release/src/nx-release-git-operations.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/pre-version-command.test.ts b/e2e/release/src/pre-version-command.test.ts index 928758f093a5d..aeec1490f32e9 100644 --- a/e2e/release/src/pre-version-command.test.ts +++ b/e2e/release/src/pre-version-command.test.ts @@ -4,7 +4,7 @@ import { runCLI, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/preserve-local-dependency-protocols.test.ts b/e2e/release/src/preserve-local-dependency-protocols.test.ts index 260e781cefcd3..a8efd43a603af 100644 --- a/e2e/release/src/preserve-local-dependency-protocols.test.ts +++ b/e2e/release/src/preserve-local-dependency-protocols.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'node:child_process'; import { join } from 'node:path'; diff --git a/e2e/release/src/private-js-packages.test.ts b/e2e/release/src/private-js-packages.test.ts index 4b3a9bc948143..cefbba57afa6c 100644 --- a/e2e/release/src/private-js-packages.test.ts +++ b/e2e/release/src/private-js-packages.test.ts @@ -5,7 +5,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'child_process'; expect.addSnapshotSerializer({ diff --git a/e2e/release/src/release-publishable-libraries-ts-solution.test.ts b/e2e/release/src/release-publishable-libraries-ts-solution.test.ts index c79f63fe90f1f..fd3601bc37870 100644 --- a/e2e/release/src/release-publishable-libraries-ts-solution.test.ts +++ b/e2e/release/src/release-publishable-libraries-ts-solution.test.ts @@ -5,7 +5,7 @@ import { runCommandAsync, tmpProjPath, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { emptydirSync } from 'fs-extra'; import { execSync } from 'node:child_process'; diff --git a/e2e/release/src/release-publishable-libraries.test.ts b/e2e/release/src/release-publishable-libraries.test.ts index dacfb67098380..9aaad0180ec29 100644 --- a/e2e/release/src/release-publishable-libraries.test.ts +++ b/e2e/release/src/release-publishable-libraries.test.ts @@ -5,7 +5,7 @@ import { runCommandAsync, tmpProjPath, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { emptydirSync } from 'fs-extra'; import { execSync } from 'node:child_process'; diff --git a/e2e/release/src/release-tag-pattern.test.ts b/e2e/release/src/release-tag-pattern.test.ts index c40d9560cdac9..16c458a833471 100644 --- a/e2e/release/src/release-tag-pattern.test.ts +++ b/e2e/release/src/release-tag-pattern.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/release.test.ts b/e2e/release/src/release.test.ts index ede933fac2940..e23f0b9b15904 100644 --- a/e2e/release/src/release.test.ts +++ b/e2e/release/src/release.test.ts @@ -17,7 +17,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { execSync } from 'node:child_process'; import type { NxReleaseVersionConfiguration } from 'nx/src/config/nx-json'; diff --git a/e2e/release/src/version-plans-check.test.ts b/e2e/release/src/version-plans-check.test.ts index 46ef193e4d295..cdef4819e888e 100644 --- a/e2e/release/src/version-plans-check.test.ts +++ b/e2e/release/src/version-plans-check.test.ts @@ -7,7 +7,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readdirSync, readFileSync, writeFileSync } from 'fs-extra'; import { join } from 'path'; diff --git a/e2e/release/src/version-plans-only-touched.test.ts b/e2e/release/src/version-plans-only-touched.test.ts index 9ea122a77933d..4d77dc183eaf3 100644 --- a/e2e/release/src/version-plans-only-touched.test.ts +++ b/e2e/release/src/version-plans-only-touched.test.ts @@ -6,7 +6,7 @@ import { runCommandAsync, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/release/src/version-plans.test.ts b/e2e/release/src/version-plans.test.ts index 399b8e52b93cd..743d6e5bb8b52 100644 --- a/e2e/release/src/version-plans.test.ts +++ b/e2e/release/src/version-plans.test.ts @@ -10,7 +10,7 @@ import { tmpProjPath, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ensureDir, readdirSync, writeFile } from 'fs-extra'; import { join } from 'path'; diff --git a/e2e/release/tsconfig.json b/e2e/release/tsconfig.json index 6d5abf8483200..2d7b9ef08b0a9 100644 --- a/e2e/release/tsconfig.json +++ b/e2e/release/tsconfig.json @@ -6,6 +6,15 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/release/tsconfig.spec.json b/e2e/release/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/release/tsconfig.spec.json +++ b/e2e/release/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/release/tsconfig.tsbuildinfo b/e2e/release/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000..b8d4dc2b9c6a0 --- /dev/null +++ b/e2e/release/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":[],"fileInfos":[],"root":[],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"module":1,"noImplicitAny":false,"noImplicitReturns":false,"noImplicitThis":false,"skipLibCheck":true,"strictBindCallApply":false,"strictFunctionTypes":false,"strictNullChecks":false,"strictPropertyInitialization":false,"target":8,"useUnknownInCatchVariables":false},"version":"5.8.3"} \ No newline at end of file diff --git a/e2e/remix/package.json b/e2e/remix/package.json new file mode 100644 index 0000000000000..e5f1ac965578d --- /dev/null +++ b/e2e/remix/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-remix", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/remix/src/nx-remix.test.ts b/e2e/remix/src/nx-remix.test.ts index 62ba0d7a6de4a..362410fb76407 100644 --- a/e2e/remix/src/nx-remix.test.ts +++ b/e2e/remix/src/nx-remix.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, runCommandAsync, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Remix E2E Tests', () => { describe('--integrated (npm)', () => { diff --git a/e2e/remix/src/remix-ts-solution.test.ts b/e2e/remix/src/remix-ts-solution.test.ts index ae0b19f14cf2c..cea685005692e 100644 --- a/e2e/remix/src/remix-ts-solution.test.ts +++ b/e2e/remix/src/remix-ts-solution.test.ts @@ -4,7 +4,7 @@ import { readJson, runCLI, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Remix - TS solution setup', () => { beforeAll(() => { diff --git a/e2e/remix/tsconfig.json b/e2e/remix/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/remix/tsconfig.json +++ b/e2e/remix/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/remix/tsconfig.spec.json b/e2e/remix/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/remix/tsconfig.spec.json +++ b/e2e/remix/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/remix/tsconfig.tsbuildinfo b/e2e/remix/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000..b8d4dc2b9c6a0 --- /dev/null +++ b/e2e/remix/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":[],"fileInfos":[],"root":[],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"module":1,"noImplicitAny":false,"noImplicitReturns":false,"noImplicitThis":false,"skipLibCheck":true,"strictBindCallApply":false,"strictFunctionTypes":false,"strictNullChecks":false,"strictPropertyInitialization":false,"target":8,"useUnknownInCatchVariables":false},"version":"5.8.3"} \ No newline at end of file diff --git a/e2e/rollup/package.json b/e2e/rollup/package.json new file mode 100644 index 0000000000000..d6568a13e53dd --- /dev/null +++ b/e2e/rollup/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-rollup", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/rollup/src/rollup-legacy.test.ts b/e2e/rollup/src/rollup-legacy.test.ts index b7fec5ec9f348..e134802c4e91b 100644 --- a/e2e/rollup/src/rollup-legacy.test.ts +++ b/e2e/rollup/src/rollup-legacy.test.ts @@ -11,7 +11,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Rollup Plugin', () => { diff --git a/e2e/rollup/src/rollup.test.ts b/e2e/rollup/src/rollup.test.ts index 085a93402df1d..e29d4a3cb6321 100644 --- a/e2e/rollup/src/rollup.test.ts +++ b/e2e/rollup/src/rollup.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Rollup Plugin', () => { beforeAll(() => newProject({ packages: ['@nx/rollup', '@nx/js'] })); diff --git a/e2e/rollup/tsconfig.json b/e2e/rollup/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/rollup/tsconfig.json +++ b/e2e/rollup/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/rollup/tsconfig.spec.json b/e2e/rollup/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/rollup/tsconfig.spec.json +++ b/e2e/rollup/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/rollup/tsconfig.tsbuildinfo b/e2e/rollup/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000..b8d4dc2b9c6a0 --- /dev/null +++ b/e2e/rollup/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":[],"fileInfos":[],"root":[],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"module":1,"noImplicitAny":false,"noImplicitReturns":false,"noImplicitThis":false,"skipLibCheck":true,"strictBindCallApply":false,"strictFunctionTypes":false,"strictNullChecks":false,"strictPropertyInitialization":false,"target":8,"useUnknownInCatchVariables":false},"version":"5.8.3"} \ No newline at end of file diff --git a/e2e/rspack/package.json b/e2e/rspack/package.json new file mode 100644 index 0000000000000..c383674a63373 --- /dev/null +++ b/e2e/rspack/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-rspack", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/rspack/tests/rspack.legacy.spec.ts b/e2e/rspack/tests/rspack.legacy.spec.ts index 0d613b2b518d9..2cb9d99902f9b 100644 --- a/e2e/rspack/tests/rspack.legacy.spec.ts +++ b/e2e/rspack/tests/rspack.legacy.spec.ts @@ -5,7 +5,7 @@ import { updateFile, runCLI, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('rspack e2e legacy', () => { let originalEnv; diff --git a/e2e/rspack/tests/rspack.spec.ts b/e2e/rspack/tests/rspack.spec.ts index cbe7b82f3238d..dcc26f2202e38 100644 --- a/e2e/rspack/tests/rspack.spec.ts +++ b/e2e/rspack/tests/rspack.spec.ts @@ -8,7 +8,7 @@ import { createFile, readJson, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('rspack e2e', () => { let proj: string; diff --git a/e2e/rspack/tsconfig.json b/e2e/rspack/tsconfig.json index f6e253991353b..f3bba796bd119 100644 --- a/e2e/rspack/tsconfig.json +++ b/e2e/rspack/tsconfig.json @@ -6,6 +6,9 @@ "files": [], "include": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/rspack/tsconfig.spec.json b/e2e/rspack/tsconfig.spec.json index 546f12877f7f0..a51c1f37fee03 100644 --- a/e2e/rspack/tsconfig.spec.json +++ b/e2e/rspack/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/storybook/package.json b/e2e/storybook/package.json new file mode 100644 index 0000000000000..f03396187cc72 --- /dev/null +++ b/e2e/storybook/package.json @@ -0,0 +1,17 @@ +{ + "name": "@nx/e2e-storybook", + "version": "0.0.1", + "private": true, + "dependencies": { + "nx": "workspace:*", + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*", + "@nx/e2e-utils": "workspace:*", + "@nx/storybook": "workspace:*", + "@nx/angular": "workspace:*", + "@nx/react": "workspace:*", + "@nx/jest": "workspace:*", + "@nx/js": "workspace:*", + "@nx/workspace": "workspace:*" + } +} diff --git a/e2e/storybook/src/storybook-angular.test.ts b/e2e/storybook/src/storybook-angular.test.ts index 5252f47380519..46f4366950bf0 100644 --- a/e2e/storybook/src/storybook-angular.test.ts +++ b/e2e/storybook/src/storybook-angular.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCommandUntil, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Storybook executors for Angular', () => { const angularStorybookLib = uniq('test-ui-ng-lib'); diff --git a/e2e/storybook/src/storybook-nested.test.ts b/e2e/storybook/src/storybook-nested.test.ts index 11ef5b2e472a1..91102bb764afd 100644 --- a/e2e/storybook/src/storybook-nested.test.ts +++ b/e2e/storybook/src/storybook-nested.test.ts @@ -9,7 +9,7 @@ import { runCreateWorkspace, tmpProjPath, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { writeFileSync } from 'fs'; import { createFileSync } from 'fs-extra'; diff --git a/e2e/storybook/src/storybook.test.ts b/e2e/storybook/src/storybook.test.ts index f92a3298a7d39..f154b02716df5 100644 --- a/e2e/storybook/src/storybook.test.ts +++ b/e2e/storybook/src/storybook.test.ts @@ -10,7 +10,7 @@ import { tmpProjPath, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { writeFileSync } from 'fs'; import { createFileSync } from 'fs-extra'; diff --git a/e2e/storybook/tsconfig.json b/e2e/storybook/tsconfig.json index 6d5abf8483200..9a7e2ea11685b 100644 --- a/e2e/storybook/tsconfig.json +++ b/e2e/storybook/tsconfig.json @@ -6,6 +6,33 @@ "include": [], "files": [], "references": [ + { + "path": "../../packages/workspace" + }, + { + "path": "../../packages/js" + }, + { + "path": "../../packages/jest" + }, + { + "path": "../../packages/react" + }, + { + "path": "../../packages/angular" + }, + { + "path": "../../packages/storybook" + }, + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, + { + "path": "../../packages/nx" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/storybook/tsconfig.spec.json b/e2e/storybook/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/storybook/tsconfig.spec.json +++ b/e2e/storybook/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/storybook/tsconfig.tsbuildinfo b/e2e/storybook/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000..b8d4dc2b9c6a0 --- /dev/null +++ b/e2e/storybook/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":[],"fileInfos":[],"root":[],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"module":1,"noImplicitAny":false,"noImplicitReturns":false,"noImplicitThis":false,"skipLibCheck":true,"strictBindCallApply":false,"strictFunctionTypes":false,"strictNullChecks":false,"strictPropertyInitialization":false,"target":8,"useUnknownInCatchVariables":false},"version":"5.8.3"} \ No newline at end of file diff --git a/e2e/utils/create-project-utils.ts b/e2e/utils/create-project-utils.ts index 019bb79492874..47d6c410f7a18 100644 --- a/e2e/utils/create-project-utils.ts +++ b/e2e/utils/create-project-utils.ts @@ -13,6 +13,7 @@ import { getLatestLernaVersion, getPublishedVersion, getSelectedPackageManager, + getStrippedEnvironmentVariables, isVerbose, isVerboseE2ERun, } from './get-env-info'; @@ -21,7 +22,7 @@ import { output, readJsonFile } from '@nx/devkit'; import { angularCliVersion as defaultAngularCliVersion } from '@nx/workspace/src/utils/versions'; import { dump } from '@zkochan/js-yaml'; import { execSync, ExecSyncOptions } from 'node:child_process'; -import { readFileSync, writeFileSync } from 'node:fs'; +import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { performance, PerformanceMeasure } from 'node:perf_hooks'; import { resetWorkspaceContext } from 'nx/src/utils/workspace-context'; @@ -129,7 +130,7 @@ export function newProject({ packageInstallEnd.name ); // stop the daemon - execSync(`${getPackageManagerCommand().runNx} reset`, { + execSync(`${getPackageManagerCommand({ packageManager }).runNx} reset`, { cwd: `${e2eCwd}/proj`, stdio: isVerbose() ? 'inherit' : 'pipe', }); @@ -151,12 +152,18 @@ export function newProject({ } else if (packageManager === 'pnpm') { // pnpm creates sym links to the pnpm store, // we need to run the install again after copying the temp folder - execSync(getPackageManagerCommand().install, { - cwd: projectDirectory, - stdio: 'pipe', - env: { CI: 'true', ...process.env }, - encoding: 'utf-8', - }); + try { + execSync(getPackageManagerCommand().install, { + cwd: projectDirectory, + stdio: 'pipe', + env: { CI: 'true', ...process.env }, + encoding: 'utf-8', + }); + } catch (e) { + console.log('newProject() - reinstall pnpm dependencies failed'); + console.error('Full error:', e); + throw e; + } } const newProjectEnd = performance.mark('new-project:end'); @@ -348,7 +355,7 @@ export function runCreateWorkspace( env: { CI: 'true', NX_VERBOSE_LOGGING: isCI ? 'true' : 'false', - ...process.env, + ...getStrippedEnvironmentVariables(), }, encoding: 'utf-8', }); @@ -439,7 +446,7 @@ export function packageInstall( try { const install = execSync(command, { cwd, - stdio: isVerbose() ? 'inherit' : 'ignore', + stdio: isVerbose() ? 'inherit' : 'pipe', env: process.env, encoding: 'utf-8', }); diff --git a/e2e/utils/get-env-info.ts b/e2e/utils/get-env-info.ts index c60fa41d9f9dd..f5e625f927a44 100644 --- a/e2e/utils/get-env-info.ts +++ b/e2e/utils/get-env-info.ts @@ -16,7 +16,7 @@ export function getPublishedVersion(): string { process.env.PUBLISHED_VERSION = process.env.PUBLISHED_VERSION || // read version of built nx package - readJsonFile(join(workspaceRoot, `./build/packages/nx/package.json`)) + readJsonFile(join(workspaceRoot, `./dist/packages/nx/package.json`)) .version || // fallback to latest if built nx package is missing 'latest'; @@ -176,7 +176,7 @@ export function ensurePlaywrightBrowsersInstallation() { export function getStrippedEnvironmentVariables() { return Object.fromEntries( - Object.entries(process.env).filter(([key, value]) => { + Object.entries(process.env).filter(([key]) => { if (key.startsWith('NX_E2E_')) { return true; } @@ -196,6 +196,13 @@ export function getStrippedEnvironmentVariables() { return false; } + // Remove NODE_PATH to prevent module resolution conflicts with original workspace. + // NODE_PATH is inherited from Jest (which runs from the original workspace) and contains + // pnpm paths that cause require.resolve() to find workspace packages instead of e2e test versions. + if (key === 'NODE_PATH') { + return false; + } + return true; }) ); diff --git a/e2e/utils/package.json b/e2e/utils/package.json new file mode 100644 index 0000000000000..f5e62e26494bf --- /dev/null +++ b/e2e/utils/package.json @@ -0,0 +1,12 @@ +{ + "name": "@nx/e2e-utils", + "version": "0.0.1", + "private": true, + "main": "index.ts", + "types": "index.ts", + "dependencies": { + "nx": "workspace:*", + "@nx/devkit": "workspace:*", + "@nx/workspace": "workspace:*" + } +} diff --git a/e2e/utils/tsconfig.json b/e2e/utils/tsconfig.json new file mode 100644 index 0000000000000..e0eb78389045c --- /dev/null +++ b/e2e/utils/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "../../packages/workspace" + }, + { + "path": "../../packages/devkit" + }, + { + "path": "../../packages/nx" + }, + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/e2e/utils/tsconfig.lib.json b/e2e/utils/tsconfig.lib.json new file mode 100644 index 0000000000000..8a2905b26f5c0 --- /dev/null +++ b/e2e/utils/tsconfig.lib.json @@ -0,0 +1,31 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node", "jest"], + "composite": true, + "skipLibCheck": true, + "noImplicitAny": false, + "strict": false + }, + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "jest.config.ts", + "global-setup.ts", + "global-teardown.ts" + ], + "include": ["**/*.ts", "**/*.js"], + "references": [ + { + "path": "../../packages/workspace/tsconfig.lib.json" + }, + { + "path": "../../packages/devkit/tsconfig.lib.json" + }, + { + "path": "../../packages/nx/tsconfig.lib.json" + } + ] +} diff --git a/e2e/vite/package.json b/e2e/vite/package.json new file mode 100644 index 0000000000000..e9c52310deaf9 --- /dev/null +++ b/e2e/vite/package.json @@ -0,0 +1,9 @@ +{ + "name": "@nx/e2e-vite", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/devkit": "workspace:*", + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/vite/src/vite-esm.test.ts b/e2e/vite/src/vite-esm.test.ts index 484a79a4b0f13..0982c92b2862d 100644 --- a/e2e/vite/src/vite-esm.test.ts +++ b/e2e/vite/src/vite-esm.test.ts @@ -5,7 +5,7 @@ import { runCLI, uniq, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; // TODO(jack): This test file can be removed when Vite goes ESM-only. // This test ensures that when CJS is gone from the published `vite` package, Nx will continue to work. diff --git a/e2e/vite/src/vite-legacy.test.ts b/e2e/vite/src/vite-legacy.test.ts index 7914656f713ae..80d8c511a26ff 100644 --- a/e2e/vite/src/vite-legacy.test.ts +++ b/e2e/vite/src/vite-legacy.test.ts @@ -22,7 +22,7 @@ import { updateJson, checkFilesExist, killProcessAndPorts, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; import { ChildProcess } from 'child_process'; diff --git a/e2e/vite/src/vite-ts-solution.test.ts b/e2e/vite/src/vite-ts-solution.test.ts index 6db41d52d27e8..06dfa8aedf321 100644 --- a/e2e/vite/src/vite-ts-solution.test.ts +++ b/e2e/vite/src/vite-ts-solution.test.ts @@ -9,7 +9,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Vite - TS solution setup', () => { beforeAll(() => { diff --git a/e2e/vite/src/vite.test.ts b/e2e/vite/src/vite.test.ts index a9ef753d48c22..7f50ce403fa4b 100644 --- a/e2e/vite/src/vite.test.ts +++ b/e2e/vite/src/vite.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ChildProcess } from 'child_process'; import { names } from '@nx/devkit'; diff --git a/e2e/vite/tsconfig.json b/e2e/vite/tsconfig.json index 6d5abf8483200..87628a14dd415 100644 --- a/e2e/vite/tsconfig.json +++ b/e2e/vite/tsconfig.json @@ -6,6 +6,12 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, + { + "path": "../../packages/devkit" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/vite/tsconfig.spec.json b/e2e/vite/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/vite/tsconfig.spec.json +++ b/e2e/vite/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/vue/package.json b/e2e/vue/package.json new file mode 100644 index 0000000000000..2aa1de6d8271c --- /dev/null +++ b/e2e/vue/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-vue", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/vue/src/vue-legacy.test.ts b/e2e/vue/src/vue-legacy.test.ts index 851fb7620266a..281b996362eaa 100644 --- a/e2e/vue/src/vue-legacy.test.ts +++ b/e2e/vue/src/vue-legacy.test.ts @@ -1,4 +1,4 @@ -import { cleanupProject, newProject, runCLI, uniq } from '@nx/e2e/utils'; +import { cleanupProject, newProject, runCLI, uniq } from '@nx/e2e-utils'; describe('Vue Plugin (legacy)', () => { let proj: string; diff --git a/e2e/vue/src/vue-storybook.test.ts b/e2e/vue/src/vue-storybook.test.ts index 3af588889ed84..e430478c52bdc 100644 --- a/e2e/vue/src/vue-storybook.test.ts +++ b/e2e/vue/src/vue-storybook.test.ts @@ -4,7 +4,7 @@ import { newProject, runCLI, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Storybook generators and executors for Vue projects', () => { const vueStorybookApp = uniq('vue-app'); diff --git a/e2e/vue/src/vue-tailwind.test.ts b/e2e/vue/src/vue-tailwind.test.ts index 604a385fbe89c..8303f2274f7bb 100644 --- a/e2e/vue/src/vue-tailwind.test.ts +++ b/e2e/vue/src/vue-tailwind.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('vue tailwind support', () => { beforeAll(() => { diff --git a/e2e/vue/src/vue-ts-solution.test.ts b/e2e/vue/src/vue-ts-solution.test.ts index 34f8af44b6211..d82c798812e55 100644 --- a/e2e/vue/src/vue-ts-solution.test.ts +++ b/e2e/vue/src/vue-ts-solution.test.ts @@ -5,7 +5,7 @@ import { runCLI, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Vue (TS solution)', () => { let proj: string; diff --git a/e2e/vue/src/vue.test.ts b/e2e/vue/src/vue.test.ts index 4dc8d9fa8212a..f56f9f6140284 100644 --- a/e2e/vue/src/vue.test.ts +++ b/e2e/vue/src/vue.test.ts @@ -6,7 +6,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Vue Plugin', () => { let proj: string; diff --git a/e2e/vue/tsconfig.json b/e2e/vue/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/vue/tsconfig.json +++ b/e2e/vue/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/vue/tsconfig.spec.json b/e2e/vue/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/vue/tsconfig.spec.json +++ b/e2e/vue/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/web/package.json b/e2e/web/package.json new file mode 100644 index 0000000000000..f20cc116aeb33 --- /dev/null +++ b/e2e/web/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-web", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/web/src/file-server-legacy.test.ts b/e2e/web/src/file-server-legacy.test.ts index ae7c105442d32..e054fbbc29ec6 100644 --- a/e2e/web/src/file-server-legacy.test.ts +++ b/e2e/web/src/file-server-legacy.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCommandUntil, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('file-server', () => { beforeAll(() => { diff --git a/e2e/web/src/file-server.test.ts b/e2e/web/src/file-server.test.ts index a95c6baec6a21..26ae73d06b135 100644 --- a/e2e/web/src/file-server.test.ts +++ b/e2e/web/src/file-server.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('file-server', () => { diff --git a/e2e/web/src/web-legacy.test.ts b/e2e/web/src/web-legacy.test.ts index c19cf9a576daf..0da175df56d38 100644 --- a/e2e/web/src/web-legacy.test.ts +++ b/e2e/web/src/web-legacy.test.ts @@ -10,7 +10,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Web Components Applications (legacy)', () => { diff --git a/e2e/web/src/web-vite.test.ts b/e2e/web/src/web-vite.test.ts index 8294756bd179d..db7e2916528ce 100644 --- a/e2e/web/src/web-vite.test.ts +++ b/e2e/web/src/web-vite.test.ts @@ -10,7 +10,7 @@ import { runCLIAsync, runE2ETests, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Web Components Applications with bundler set as vite', () => { beforeEach(() => newProject()); diff --git a/e2e/web/src/web-webpack.test.ts b/e2e/web/src/web-webpack.test.ts index 35e727a5ee47f..e5cfaefeb6e35 100644 --- a/e2e/web/src/web-webpack.test.ts +++ b/e2e/web/src/web-webpack.test.ts @@ -5,7 +5,7 @@ import { runCLI, runCommandUntil, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('Web Components Applications with bundler set as webpack', () => { beforeEach(() => newProject()); diff --git a/e2e/web/src/web.test.ts b/e2e/web/src/web.test.ts index d7d436ee0e9d5..7c2a8e671b779 100644 --- a/e2e/web/src/web.test.ts +++ b/e2e/web/src/web.test.ts @@ -15,7 +15,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; import { copyFileSync } from 'fs'; diff --git a/e2e/web/tsconfig.json b/e2e/web/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/web/tsconfig.json +++ b/e2e/web/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/web/tsconfig.spec.json b/e2e/web/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/web/tsconfig.spec.json +++ b/e2e/web/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/webpack/package.json b/e2e/webpack/package.json new file mode 100644 index 0000000000000..1a2d503684da6 --- /dev/null +++ b/e2e/webpack/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-webpack", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/webpack/src/webpack.legacy.test.ts b/e2e/webpack/src/webpack.legacy.test.ts index d50ca3a11b5c9..e6aed10d83a46 100644 --- a/e2e/webpack/src/webpack.legacy.test.ts +++ b/e2e/webpack/src/webpack.legacy.test.ts @@ -9,7 +9,7 @@ import { runE2ETests, uniq, updateFile, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { ChildProcess } from 'child_process'; describe('Webpack Plugin (legacy)', () => { diff --git a/e2e/webpack/src/webpack.test.ts b/e2e/webpack/src/webpack.test.ts index 367ee724c9609..63911310584a9 100644 --- a/e2e/webpack/src/webpack.test.ts +++ b/e2e/webpack/src/webpack.test.ts @@ -13,7 +13,7 @@ import { uniq, updateFile, updateJson, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { join } from 'path'; describe('Webpack Plugin', () => { diff --git a/e2e/webpack/tsconfig.json b/e2e/webpack/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/webpack/tsconfig.json +++ b/e2e/webpack/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/webpack/tsconfig.spec.json b/e2e/webpack/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/webpack/tsconfig.spec.json +++ b/e2e/webpack/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/e2e/workspace-create/package.json b/e2e/workspace-create/package.json new file mode 100644 index 0000000000000..f80863fde8a88 --- /dev/null +++ b/e2e/workspace-create/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/e2e-workspace-create", + "version": "0.0.1", + "private": true, + "dependencies": { + "@nx/e2e-utils": "workspace:*" + } +} diff --git a/e2e/workspace-create/src/create-nx-plugin.test.ts b/e2e/workspace-create/src/create-nx-plugin.test.ts index 67086c8922c9b..e74248b3df31d 100644 --- a/e2e/workspace-create/src/create-nx-plugin.test.ts +++ b/e2e/workspace-create/src/create-nx-plugin.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCreatePlugin, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('create-nx-plugin', () => { const packageManager = getSelectedPackageManager() || 'pnpm'; diff --git a/e2e/workspace-create/src/create-nx-workspace-npm.test.ts b/e2e/workspace-create/src/create-nx-workspace-npm.test.ts index 9dc3ec6411de9..d301b3be9b11c 100644 --- a/e2e/workspace-create/src/create-nx-workspace-npm.test.ts +++ b/e2e/workspace-create/src/create-nx-workspace-npm.test.ts @@ -8,7 +8,7 @@ import { runCommand, runCreateWorkspace, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; describe('create-nx-workspace --preset=npm', () => { const wsName = uniq('npm'); diff --git a/e2e/workspace-create/src/create-nx-workspace.test.ts b/e2e/workspace-create/src/create-nx-workspace.test.ts index be5931ddcaf48..1ffbd1ebbbf0c 100644 --- a/e2e/workspace-create/src/create-nx-workspace.test.ts +++ b/e2e/workspace-create/src/create-nx-workspace.test.ts @@ -12,7 +12,7 @@ import { runCommand, runCreateWorkspace, uniq, -} from '@nx/e2e/utils'; +} from '@nx/e2e-utils'; import { readFileSync } from 'fs'; import { existsSync, mkdirSync, rmSync } from 'fs-extra'; diff --git a/e2e/workspace-create/tsconfig.json b/e2e/workspace-create/tsconfig.json index 6d5abf8483200..76c5bd9eaa651 100644 --- a/e2e/workspace-create/tsconfig.json +++ b/e2e/workspace-create/tsconfig.json @@ -6,6 +6,9 @@ "include": [], "files": [], "references": [ + { + "path": "../utils" + }, { "path": "./tsconfig.spec.json" } diff --git a/e2e/workspace-create/tsconfig.spec.json b/e2e/workspace-create/tsconfig.spec.json index 1a24bfb0a1353..3a6cc7d023dbc 100644 --- a/e2e/workspace-create/tsconfig.spec.json +++ b/e2e/workspace-create/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/graph/client-e2e/.eslintrc b/graph/client-e2e/.eslintrc index a15e6e72c6c67..c5a9e939d6271 100644 --- a/graph/client-e2e/.eslintrc +++ b/graph/client-e2e/.eslintrc @@ -9,6 +9,6 @@ } } ], - "extends": ["plugin:cypress/recommended", "../../.eslintrc"], + "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], "ignorePatterns": ["!**/*"] } diff --git a/graph/client-e2e/tsconfig.json b/graph/client-e2e/tsconfig.json index 079188d253a05..f349f2504f7fd 100644 --- a/graph/client-e2e/tsconfig.json +++ b/graph/client-e2e/tsconfig.json @@ -2,9 +2,13 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "sourceMap": false, - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/graph/client-e2e", "allowJs": true, "types": ["cypress", "node"], + "typeRoots": [ + "../../node_modules/@types", + "../../node_modules/.pnpm/cypress@14.3.0/node_modules/cypress/types" + ], "lib": ["DOM"] }, "files": [], @@ -14,8 +18,13 @@ "cypress-release.config.ts", "cypress-release-static.config.ts", "src/**/*.ts", - "src/**/*.js" + "src/**/*.js", + "src/**/*.json" + ], + "references": [ + { + "path": "../client" + } ], - "references": [], "exclude": [] } diff --git a/graph/client/.eslintrc.json b/graph/client/.eslintrc.json index 552e049507521..543399f368f2d 100644 --- a/graph/client/.eslintrc.json +++ b/graph/client/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "rules": { "@typescript-eslint/no-implicit-any": "off" }, diff --git a/graph/client/package.json b/graph/client/package.json new file mode 100644 index 0000000000000..1bf65e18e1f7d --- /dev/null +++ b/graph/client/package.json @@ -0,0 +1,19 @@ +{ + "name": "@nx/graph-client", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "dist/index.js", + "types": "dist/index.d.ts", + "devDependencies": { + "jest": "^29.4.1" + }, + "dependencies": { + "@nx/graph-internal-ui-theme": "workspace:", + "@nx/graph-internal-project-details": "workspace:", + "@nx/graph-internal-ui-project-details": "workspace:", + "@nx/graph-migrate": "workspace:", + "@nx/graph-ui-common": "workspace:", + "@nx/graph-ui-code-block": "workspace:" + } +} diff --git a/graph/client/project.json b/graph/client/project.json index e23556ff9b6b2..23747fbf68eba 100644 --- a/graph/client/project.json +++ b/graph/client/project.json @@ -42,6 +42,9 @@ }, "defaultConfiguration": "release" }, + "typecheck": { + "dependsOn": ["^typecheck", "build-native"] + }, "serve-base": { "configurations": { "dev": {}, diff --git a/graph/client/src/app/app.tsx b/graph/client/src/app/app.tsx index 60843cb13da2a..96d9e2223d7ba 100644 --- a/graph/client/src/app/app.tsx +++ b/graph/client/src/app/app.tsx @@ -1,4 +1,4 @@ -import { themeInit } from '@nx/graph-internal/ui-theme'; +import { themeInit } from '@nx/graph-internal-ui-theme'; import { rankDirInit } from './rankdir-resolver'; import { RouterProvider } from 'react-router-dom'; import { getRouter } from './get-router'; diff --git a/graph/client/src/app/console-project-details/project-details.app.tsx b/graph/client/src/app/console-project-details/project-details.app.tsx index c5c6f24a12bc3..f896c7c63bb40 100644 --- a/graph/client/src/app/console-project-details/project-details.app.tsx +++ b/graph/client/src/app/console-project-details/project-details.app.tsx @@ -1,4 +1,4 @@ -import { ProjectDetails } from '@nx/graph-internal/ui-project-details'; +import { ProjectDetails } from '@nx/graph-internal-ui-project-details'; import { ErrorToastUI, ExpandedTargetsProvider, diff --git a/graph/client/src/app/machines/graph.service.ts b/graph/client/src/app/machines/graph.service.ts index 11521c879ea3b..2807a9d9464e2 100644 --- a/graph/client/src/app/machines/graph.service.ts +++ b/graph/client/src/app/machines/graph.service.ts @@ -3,7 +3,7 @@ import { getProjectGraphDataService, } from '@nx/graph/legacy/shared'; import { GraphService } from '@nx/graph/legacy/graph'; -import { selectValueByThemeStatic } from '@nx/graph-internal/ui-theme'; +import { selectValueByThemeStatic } from '@nx/graph-internal-ui-theme'; let graphService: GraphService; diff --git a/graph/client/src/app/routes.tsx b/graph/client/src/app/routes.tsx index 04a2231fa3ca5..c1420da343f2b 100644 --- a/graph/client/src/app/routes.tsx +++ b/graph/client/src/app/routes.tsx @@ -16,7 +16,7 @@ import { getProjectGraphDataService, } from '@nx/graph/legacy/shared'; import { TasksSidebarErrorBoundary } from './feature-tasks/tasks-sidebar-error-boundary'; -import { ProjectDetailsPage } from '@nx/graph-internal/project-details'; +import { ProjectDetailsPage } from '@nx/graph-internal-project-details'; import { ErrorBoundary } from './ui-components/error-boundary'; const { appConfig } = getEnvironmentConfig(); diff --git a/graph/client/src/app/shell.tsx b/graph/client/src/app/shell.tsx index 782fe9f16f344..6026551d096d5 100644 --- a/graph/client/src/app/shell.tsx +++ b/graph/client/src/app/shell.tsx @@ -22,7 +22,7 @@ import { import { Dropdown, Spinner } from '@nx/graph/legacy/components'; import { Tooltip } from '@nx/graph/legacy/tooltips'; -import { getSystemTheme, Theme, ThemePanel } from '@nx/graph-internal/ui-theme'; +import { getSystemTheme, Theme, ThemePanel } from '@nx/graph-internal-ui-theme'; import classNames from 'classnames'; import { useLayoutEffect, useState } from 'react'; import { diff --git a/graph/client/src/app/ui-components/error-boundary.tsx b/graph/client/src/app/ui-components/error-boundary.tsx index 42101d8ba3432..b0cc753a45807 100644 --- a/graph/client/src/app/ui-components/error-boundary.tsx +++ b/graph/client/src/app/ui-components/error-boundary.tsx @@ -1,4 +1,4 @@ -import { ProjectDetailsHeader } from '@nx/graph-internal/project-details'; +import { ProjectDetailsHeader } from '@nx/graph-internal-project-details'; import { fetchProjectGraph, getProjectGraphDataService, diff --git a/graph/client/src/app/ui-components/project-details-modal.tsx b/graph/client/src/app/ui-components/project-details-modal.tsx index 78a4b514712b5..497a9d0db2236 100644 --- a/graph/client/src/app/ui-components/project-details-modal.tsx +++ b/graph/client/src/app/ui-components/project-details-modal.tsx @@ -2,7 +2,7 @@ // nx-ignore-next-line import { ProjectGraphClientResponse } from 'nx/src/command-line/graph/graph'; // nx-ignore-next-line -import { ProjectDetailsWrapper } from '@nx/graph-internal/project-details'; +import { ProjectDetailsWrapper } from '@nx/graph-internal-project-details'; /* eslint-enable @nx/enforce-module-boundaries */ import { useFloating } from '@floating-ui/react'; import { XMarkIcon } from '@heroicons/react/24/outline'; diff --git a/graph/client/tsconfig.app.json b/graph/client/tsconfig.app.json index d44e043c2d8d6..c502c29d5c4c5 100644 --- a/graph/client/tsconfig.app.json +++ b/graph/client/tsconfig.app.json @@ -1,7 +1,10 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/graph/client", + "tsBuildInfoFile": "../../dist/graph/client/tsconfig.app.tsbuildinfo", + "declaration": true, + "composite": true, "types": ["node"], "lib": ["DOM", "es2022"] }, @@ -24,5 +27,25 @@ "**/*.stories.jsx", "**/*.stories.tsx" ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../ui-code-block/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + }, + { + "path": "../migrate/tsconfig.lib.json" + }, + { + "path": "../ui-project-details/tsconfig.lib.json" + }, + { + "path": "../project-details/tsconfig.lib.json" + }, + { + "path": "../ui-theme/tsconfig.lib.json" + } + ] } diff --git a/graph/client/tsconfig.json b/graph/client/tsconfig.json index 3a0cd637fd928..e5d743458dba6 100644 --- a/graph/client/tsconfig.json +++ b/graph/client/tsconfig.json @@ -8,13 +8,25 @@ "include": [], "references": [ { - "path": "./tsconfig.app.json" + "path": "../ui-code-block" + }, + { + "path": "../ui-common" + }, + { + "path": "../migrate" }, { - "path": "./tsconfig.spec.json" + "path": "../ui-project-details" }, { - "path": "./tsconfig.storybook.json" + "path": "../project-details" + }, + { + "path": "../ui-theme" + }, + { + "path": "./tsconfig.app.json" } ] } diff --git a/graph/client/tsconfig.spec.json b/graph/client/tsconfig.spec.json index 18d0dd2ccb793..8385c1d76bd0b 100644 --- a/graph/client/tsconfig.spec.json +++ b/graph/client/tsconfig.spec.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/graph/client/spec", "module": "commonjs", "types": ["jest", "node"], "lib": ["DOM"] diff --git a/graph/client/tsconfig.storybook.json b/graph/client/tsconfig.storybook.json index 98ee6645c6232..f74bd053cf3dd 100644 --- a/graph/client/tsconfig.storybook.json +++ b/graph/client/tsconfig.storybook.json @@ -2,7 +2,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "emitDecoratorMetadata": true, - "outDir": "" + "outDir": "../../dist/graph/client/storybook", + "composite": true }, "files": [ "../../node_modules/@nx/react/typings/styled-jsx.d.ts", @@ -21,6 +22,9 @@ "src/**/*.stories.jsx", "src/**/*.stories.tsx", "src/**/*.stories.mdx", - ".storybook/*.js" + "src/**/*.ts", + "src/**/*.tsx", + ".storybook/*.js", + ".storybook/*.ts" ] } diff --git a/graph/client/webpack.config.js b/graph/client/webpack.config.js index c4190ccd44d29..8ad03db875137 100644 --- a/graph/client/webpack.config.js +++ b/graph/client/webpack.config.js @@ -6,7 +6,7 @@ const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin'); module.exports = { output: { - path: join(__dirname, '../../build/apps/graph'), + path: join(__dirname, '../../dist/apps/graph'), }, devServer: { port: getPort(process.env.NX_TASK_TARGET_CONFIGURATION), diff --git a/graph/migrate/.eslintrc.json b/graph/migrate/.eslintrc.json index b96a5b888e9c0..e4822add98eb4 100644 --- a/graph/migrate/.eslintrc.json +++ b/graph/migrate/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "storybook-static"], + "ignorePatterns": ["!**/*", "storybook-static", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/graph/migrate/package.json b/graph/migrate/package.json new file mode 100644 index 0000000000000..36d5d6c12c35a --- /dev/null +++ b/graph/migrate/package.json @@ -0,0 +1,15 @@ +{ + "name": "@nx/graph-migrate", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "devDependencies": { + "jest": "^29.4.1" + }, + "dependencies": { + "@nx/graph-ui-common": "workspace:", + "@nx/graph-internal-ui-project-details": "workspace:" + } +} diff --git a/graph/migrate/src/lib/components/migration-card.tsx b/graph/migrate/src/lib/components/migration-card.tsx index bcdcdd9c7bd41..193adcc4e21e9 100644 --- a/graph/migrate/src/lib/components/migration-card.tsx +++ b/graph/migrate/src/lib/components/migration-card.tsx @@ -11,7 +11,7 @@ import { ListBulletIcon, PlayIcon, } from '@heroicons/react/24/outline'; -import { Pill } from '@nx/graph-internal/ui-project-details'; +import { Pill } from '@nx/graph-internal-ui-project-details'; import { useState, forwardRef, diff --git a/graph/migrate/src/lib/components/migration-done.tsx b/graph/migrate/src/lib/components/migration-done.tsx index a42ec80a215f7..498a7452bef5c 100644 --- a/graph/migrate/src/lib/components/migration-done.tsx +++ b/graph/migrate/src/lib/components/migration-done.tsx @@ -5,7 +5,7 @@ import { ChevronDownIcon, } from '@heroicons/react/24/outline'; import { useState } from 'react'; -import { Popover } from '@nx/graph/ui-common'; +import { Popover } from '@nx/graph-ui-common'; import { PrimaryAction } from '../migrate'; export interface MigrationDoneProps { diff --git a/graph/migrate/src/lib/components/migration-settings-panel.tsx b/graph/migrate/src/lib/components/migration-settings-panel.tsx index 3f2a713fc5f0c..bb3efaad388ca 100644 --- a/graph/migrate/src/lib/components/migration-settings-panel.tsx +++ b/graph/migrate/src/lib/components/migration-settings-panel.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Popover } from '@nx/graph/ui-common'; +import { Popover } from '@nx/graph-ui-common'; export interface MigrationSettingsPanelProps { createCommits: boolean; diff --git a/graph/migrate/src/lib/components/migration-timeline.tsx b/graph/migrate/src/lib/components/migration-timeline.tsx index d26466004510f..cf908541e4425 100644 --- a/graph/migrate/src/lib/components/migration-timeline.tsx +++ b/graph/migrate/src/lib/components/migration-timeline.tsx @@ -18,7 +18,7 @@ import { } from '@heroicons/react/24/outline'; import { useEffect, useState, useRef } from 'react'; import { MigrationCard, MigrationCardHandle } from './migration-card'; -import { Collapsible } from '@nx/graph/ui-common'; +import { Collapsible } from '@nx/graph-ui-common'; import { twMerge } from 'tailwind-merge'; import type { Interpreter } from 'xstate'; import type { diff --git a/graph/migrate/src/lib/migrate.tsx b/graph/migrate/src/lib/migrate.tsx index df5c088d91614..f624c0349c625 100644 --- a/graph/migrate/src/lib/migrate.tsx +++ b/graph/migrate/src/lib/migrate.tsx @@ -8,7 +8,7 @@ import { type FileChange } from 'nx/src/devkit-exports'; /* eslint-enable @nx/enforce-module-boundaries */ import { useEffect, useState } from 'react'; import { CheckIcon, ChevronDownIcon } from '@heroicons/react/24/outline'; -import { Popover } from '@nx/graph/ui-common'; +import { Popover } from '@nx/graph-ui-common'; import { useInterpret, useSelector } from '@xstate/react'; import { machine as automaticMigrationMachine } from './state/automatic/machine'; import { diff --git a/graph/migrate/tsconfig.json b/graph/migrate/tsconfig.json index 79d9ca983d86d..bb4747c7bbe87 100644 --- a/graph/migrate/tsconfig.json +++ b/graph/migrate/tsconfig.json @@ -1,22 +1,18 @@ { "compilerOptions": { - "jsx": "react-jsx", - "allowJs": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "strict": true + "jsx": "react-jsx" }, "files": [], "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-project-details" }, { - "path": "./tsconfig.spec.json" + "path": "../ui-common" }, { - "path": "./tsconfig.storybook.json" + "path": "./tsconfig.lib.json" } ], "extends": "../../tsconfig.base.json" diff --git a/graph/migrate/tsconfig.lib.json b/graph/migrate/tsconfig.lib.json index 15785607d1074..bb018cef1a900 100644 --- a/graph/migrate/tsconfig.lib.json +++ b/graph/migrate/tsconfig.lib.json @@ -1,13 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "node", - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ], - "lib": ["DOM"] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"], + "lib": ["ES2022", "DOM"] }, "exclude": [ "jest.config.ts", @@ -24,5 +21,17 @@ "**/*.stories.jsx", "**/*.stories.tsx" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../ui-project-details/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + } + ], + "files": [ + "../../node_modules/@nx/react/typings/cssmodule.d.ts", + "../../node_modules/@nx/react/typings/image.d.ts" + ] } diff --git a/graph/migrate/tsconfig.spec.json b/graph/migrate/tsconfig.spec.json index 26ef046ac5e54..fb16ed6823f61 100644 --- a/graph/migrate/tsconfig.spec.json +++ b/graph/migrate/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/graph/project-details/.eslintrc.json b/graph/project-details/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/graph/project-details/.eslintrc.json +++ b/graph/project-details/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/graph/project-details/package.json b/graph/project-details/package.json new file mode 100644 index 0000000000000..7fc43a982dbc9 --- /dev/null +++ b/graph/project-details/package.json @@ -0,0 +1,15 @@ +{ + "name": "@nx/graph-internal-project-details", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "devDependencies": { + "jest": "^29.4.1" + }, + "dependencies": { + "@nx/graph-internal-ui-theme": "workspace:*", + "@nx/graph-internal-ui-project-details": "workspace:*" + } +} diff --git a/graph/project-details/src/lib/project-details-header.tsx b/graph/project-details/src/lib/project-details-header.tsx index 91953b9257407..28340d1bd86f1 100644 --- a/graph/project-details/src/lib/project-details-header.tsx +++ b/graph/project-details/src/lib/project-details-header.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router-dom'; import { useRouteConstructor } from '@nx/graph/legacy/shared'; -import { ThemePanel } from '@nx/graph-internal/ui-theme'; +import { ThemePanel } from '@nx/graph-internal-ui-theme'; export function ProjectDetailsHeader() { const routeConstructor = useRouteConstructor(); diff --git a/graph/project-details/src/lib/project-details-wrapper.tsx b/graph/project-details/src/lib/project-details-wrapper.tsx index 42a39c30a4de3..54a52e31ae76e 100644 --- a/graph/project-details/src/lib/project-details-wrapper.tsx +++ b/graph/project-details/src/lib/project-details-wrapper.tsx @@ -14,7 +14,7 @@ import { } from '@nx/graph/legacy/shared'; import { Spinner } from '@nx/graph/legacy/components'; -import { ProjectDetails } from '@nx/graph-internal/ui-project-details'; +import { ProjectDetails } from '@nx/graph-internal-ui-project-details'; import { useCallback, useContext, useEffect } from 'react'; interface ProjectDetailsProps { diff --git a/graph/project-details/tsconfig.json b/graph/project-details/tsconfig.json index 3c41f10fb2148..cf905432cb8cd 100644 --- a/graph/project-details/tsconfig.json +++ b/graph/project-details/tsconfig.json @@ -10,10 +10,13 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-project-details" + }, + { + "path": "../ui-theme" }, { - "path": "./tsconfig.spec.json" + "path": "./tsconfig.lib.json" } ], "extends": "../../tsconfig.base.json" diff --git a/graph/project-details/tsconfig.lib.json b/graph/project-details/tsconfig.lib.json index 76ffded2dcab7..4859eeb862638 100644 --- a/graph/project-details/tsconfig.lib.json +++ b/graph/project-details/tsconfig.lib.json @@ -1,13 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "node", - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ], - "lib": ["DOM"] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"], + "lib": ["ES2022", "DOM"] }, "exclude": [ "jest.config.ts", @@ -20,5 +17,17 @@ "src/**/*.spec.jsx", "src/**/*.test.jsx" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../ui-project-details/tsconfig.lib.json" + }, + { + "path": "../ui-theme/tsconfig.lib.json" + } + ], + "files": [ + "../../node_modules/@nx/react/typings/cssmodule.d.ts", + "../../node_modules/@nx/react/typings/image.d.ts" + ] } diff --git a/graph/ui-code-block/.eslintrc.json b/graph/ui-code-block/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/graph/ui-code-block/.eslintrc.json +++ b/graph/ui-code-block/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/graph/ui-code-block/package.json b/graph/ui-code-block/package.json new file mode 100644 index 0000000000000..ee5d0dbbc02d6 --- /dev/null +++ b/graph/ui-code-block/package.json @@ -0,0 +1,11 @@ +{ + "name": "@nx/graph-ui-code-block", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "devDependencies": { + "jest": "^29.4.1" + } +} diff --git a/graph/ui-code-block/tsconfig.json b/graph/ui-code-block/tsconfig.json index 79d9ca983d86d..b6d0041446a92 100644 --- a/graph/ui-code-block/tsconfig.json +++ b/graph/ui-code-block/tsconfig.json @@ -1,22 +1,12 @@ { "compilerOptions": { - "jsx": "react-jsx", - "allowJs": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "strict": true + "jsx": "react-jsx" }, "files": [], "include": [], "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - }, - { - "path": "./tsconfig.storybook.json" } ], "extends": "../../tsconfig.base.json" diff --git a/graph/ui-code-block/tsconfig.lib.json b/graph/ui-code-block/tsconfig.lib.json index 8c1bec17db74e..290d639ae2c04 100644 --- a/graph/ui-code-block/tsconfig.lib.json +++ b/graph/ui-code-block/tsconfig.lib.json @@ -1,12 +1,9 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "node", - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"] }, "exclude": [ "jest.config.ts", @@ -23,5 +20,9 @@ "**/*.stories.jsx", "**/*.stories.tsx" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "files": [ + "../../node_modules/@nx/react/typings/cssmodule.d.ts", + "../../node_modules/@nx/react/typings/image.d.ts" + ] } diff --git a/graph/ui-code-block/tsconfig.storybook.json b/graph/ui-code-block/tsconfig.storybook.json index 2da3caee121ed..808cc7b17692b 100644 --- a/graph/ui-code-block/tsconfig.storybook.json +++ b/graph/ui-code-block/tsconfig.storybook.json @@ -2,7 +2,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "emitDecoratorMetadata": true, - "outDir": "" + "outDir": "../../dist/graph/ui-code-block/storybook", + "composite": false }, "files": [ "../../node_modules/@nx/react/typings/styled-jsx.d.ts", @@ -25,6 +26,8 @@ "src/**/*.stories.jsx", "src/**/*.stories.tsx", "src/**/*.stories.mdx", + "src/**/*.ts", + "src/**/*.tsx", ".storybook/*.js", ".storybook/*.ts" ] diff --git a/graph/ui-common/.eslintrc.json b/graph/ui-common/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/graph/ui-common/.eslintrc.json +++ b/graph/ui-common/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/graph/ui-common/package.json b/graph/ui-common/package.json new file mode 100644 index 0000000000000..4eaba80c6342d --- /dev/null +++ b/graph/ui-common/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/graph-ui-common", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/graph/ui-common/tsconfig.json b/graph/ui-common/tsconfig.json index 6d076c06d55ac..2d85751d3f7f2 100644 --- a/graph/ui-common/tsconfig.json +++ b/graph/ui-common/tsconfig.json @@ -1,14 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "jsx": "react-jsx", - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "jsx": "react-jsx" }, "files": [], "include": [], diff --git a/graph/ui-common/tsconfig.lib.json b/graph/ui-common/tsconfig.lib.json index 4cdfabb3c6a82..6033779b5306c 100644 --- a/graph/ui-common/tsconfig.lib.json +++ b/graph/ui-common/tsconfig.lib.json @@ -1,8 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["node"] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"], + "lib": ["ES2022", "DOM"] }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", @@ -15,5 +17,5 @@ "**/*.test.tsx", "jest.config.ts" ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] } diff --git a/graph/ui-project-details/jest.config.ts b/graph/ui-project-details/jest.config.ts index 1781dc7d0a237..c1f461b538ab7 100644 --- a/graph/ui-project-details/jest.config.ts +++ b/graph/ui-project-details/jest.config.ts @@ -7,4 +7,12 @@ export default { }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], coverageDirectory: '../../coverage/graph/graph-ui-project-details', + moduleNameMapper: { + // Override for graph packages - point to packages directory + '^@nx/devkit$': '/../../packages/devkit/index.ts', + '^@nx/devkit/testing$': '/../../packages/devkit/testing.ts', + '^@nx/devkit/internal-testing-utils$': + '/../../packages/devkit/internal-testing-utils.ts', + '^@nx/devkit/src/(.*)$': '/../../packages/devkit/src/$1', + }, }; diff --git a/graph/ui-project-details/package.json b/graph/ui-project-details/package.json new file mode 100644 index 0000000000000..5ac3e50f354d5 --- /dev/null +++ b/graph/ui-project-details/package.json @@ -0,0 +1,16 @@ +{ + "name": "@nx/graph-internal-ui-project-details", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "devDependencies": { + "jest": "^29.4.1", + "@nx/devkit": "workspace:*" + }, + "dependencies": { + "@nx/graph-ui-code-block": "workspace:", + "@nx/nx-dev-ui-fence": "workspace:" + } +} diff --git a/graph/ui-project-details/project.json b/graph/ui-project-details/project.json index fdc3e8072e654..3c3abdb49d262 100644 --- a/graph/ui-project-details/project.json +++ b/graph/ui-project-details/project.json @@ -42,5 +42,6 @@ } } } - } + }, + "implicitDependencies": ["!devkit"] } diff --git a/graph/ui-project-details/src/lib/project-details/project-details.tsx b/graph/ui-project-details/src/lib/project-details/project-details.tsx index 36e86dc88e529..9c36b7bfdda1c 100644 --- a/graph/ui-project-details/src/lib/project-details/project-details.tsx +++ b/graph/ui-project-details/src/lib/project-details/project-details.tsx @@ -1,6 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ // nx-ignore-next-line -import type { ProjectGraphProjectNode } from '@nx/devkit'; +import type { ProjectGraphProjectNode, TargetConfiguration } from '@nx/devkit'; // nx-ignore-next-line import { GraphError } from 'nx/src/command-line/graph/graph'; /* eslint-enable @nx/enforce-module-boundaries */ @@ -57,7 +57,9 @@ export const ProjectDetails = ({ [ ...(projectData.metadata?.technologies ?? []), ...Object.values(projectData.targets ?? {}) - .map((target) => target?.metadata?.technologies) + .map( + (target: TargetConfiguration) => target?.metadata?.technologies + ) .flat(), ].filter(Boolean) ), diff --git a/graph/ui-project-details/src/lib/show-all-options/show-options-help.tsx b/graph/ui-project-details/src/lib/show-all-options/show-options-help.tsx index 71a3c49732612..afbbd8a5830ce 100644 --- a/graph/ui-project-details/src/lib/show-all-options/show-options-help.tsx +++ b/graph/ui-project-details/src/lib/show-all-options/show-options-help.tsx @@ -8,7 +8,7 @@ import { /* eslint-disable @nx/enforce-module-boundaries */ // nx-ignore-next-line import type { TargetConfiguration } from '@nx/devkit'; -import { TerminalOutput } from '@nx/nx-dev/ui-fence'; +import { TerminalOutput } from '@nx/nx-dev-ui-fence'; import { Tooltip } from '@nx/graph/legacy/tooltips'; import { TooltipTriggerText } from '../target-configuration-details/tooltip-trigger-text'; @@ -59,7 +59,7 @@ export function ShowOptionsHelp({ null, 2 ); - }, [helpExampleOptions, helpExampleArgs]); + }, [helpExampleOptions, helpExampleArgs, targetName]); let runHelpActionElement: null | ReactNode; if (environment === 'docs') { @@ -87,11 +87,14 @@ export function ShowOptionsHelp({ } : async () => { setPending(true); - const result = await fetch( + const result = (await fetch( `/help?project=${encodeURIComponent( projectName )}&target=${encodeURIComponent(targetName)}` - ).then((resp) => resp.json()); + ).then((resp) => resp.json())) as { + text: string; + success: boolean; + }; setResult(result); setPending(false); } @@ -122,6 +125,7 @@ export function ShowOptionsHelp({ passing them diff --git a/graph/ui-project-details/src/lib/tag-list/tag-list.tsx b/graph/ui-project-details/src/lib/tag-list/tag-list.tsx index 5e993e153fb94..d1168111fd0a9 100644 --- a/graph/ui-project-details/src/lib/tag-list/tag-list.tsx +++ b/graph/ui-project-details/src/lib/tag-list/tag-list.tsx @@ -1,6 +1,6 @@ -import React, { useState, useRef, useEffect } from 'react'; -import { Pill } from '../pill'; +import { useState, useRef, useEffect } from 'react'; import { twMerge } from 'tailwind-merge'; +import { Pill } from '../pill'; interface TagListProps { tags: string[]; diff --git a/graph/ui-project-details/src/lib/target-configuration-details/target-configuration-details.tsx b/graph/ui-project-details/src/lib/target-configuration-details/target-configuration-details.tsx index 43a0910f99533..efac6057d0273 100644 --- a/graph/ui-project-details/src/lib/target-configuration-details/target-configuration-details.tsx +++ b/graph/ui-project-details/src/lib/target-configuration-details/target-configuration-details.tsx @@ -1,7 +1,5 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -// nx-ignore-next-line import type { TargetConfiguration } from '@nx/devkit'; -import { JsonCodeBlock } from '@nx/graph-internal/ui-code-block'; +import { JsonCodeBlock } from '@nx/graph-ui-code-block'; import { ExpandedTargetsContext } from '@nx/graph/legacy/shared'; import { CopyToClipboardButton } from '@nx/graph/legacy/components'; import { Tooltip } from '@nx/graph/legacy/tooltips'; diff --git a/graph/ui-project-details/src/lib/utils/get-display-header-from-target-configuration.ts b/graph/ui-project-details/src/lib/utils/get-display-header-from-target-configuration.ts index 94bdd57e4d8cd..e52b21327f2d0 100644 --- a/graph/ui-project-details/src/lib/utils/get-display-header-from-target-configuration.ts +++ b/graph/ui-project-details/src/lib/utils/get-display-header-from-target-configuration.ts @@ -1,5 +1,3 @@ -/* eslint-disable @nx/enforce-module-boundaries */ -// nx-ignore-next-line import type { TargetConfiguration } from '@nx/devkit'; export function getDisplayHeaderFromTargetConfiguration( @@ -42,8 +40,8 @@ export function getDisplayHeaderFromTargetConfiguration( options = rest; } else if (targetConfiguration.executor === 'nx:run-script') { link = `https://nx.dev/nx-api/nx/executors/run-script`; - displayText.command = targetConfiguration.metadata?.runCommand; - displayText.script = targetConfiguration.metadata?.scriptContent; + displayText.command = targetConfiguration.metadata?.['runCommand']; + displayText.script = targetConfiguration.metadata?.['scriptContent']; const { script, ...rest } = targetConfiguration.options; options = rest; } diff --git a/graph/ui-project-details/src/lib/utils/group-targets.ts b/graph/ui-project-details/src/lib/utils/group-targets.ts index 9c59d8cd7dede..dae19ca337adf 100644 --- a/graph/ui-project-details/src/lib/utils/group-targets.ts +++ b/graph/ui-project-details/src/lib/utils/group-targets.ts @@ -12,7 +12,10 @@ export function groupTargets(project: ProjectGraphProjectNode): { groups: Record; targets: string[]; } { - const targetGroups = { ...(project.data.metadata?.targetGroups ?? {}) }; + const targetGroups = { + ...((project.data.metadata?.targetGroups as Record) ?? + {}), + }; Object.entries(targetGroups).forEach(([group, targets]) => { targetGroups[group] = [...targets].sort(sortNxReleasePublishLast); }); diff --git a/graph/ui-project-details/tsconfig.json b/graph/ui-project-details/tsconfig.json index e9994c5f10865..b4c180fd25951 100644 --- a/graph/ui-project-details/tsconfig.json +++ b/graph/ui-project-details/tsconfig.json @@ -1,23 +1,19 @@ { "compilerOptions": { "jsx": "react-jsx", - "allowJs": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "strict": true, "lib": ["ES2022", "dom"] }, "files": [], "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../../nx-dev/ui-fence" }, { - "path": "./tsconfig.spec.json" + "path": "../ui-code-block" }, { - "path": "./tsconfig.storybook.json" + "path": "./tsconfig.lib.json" } ], "extends": "../../tsconfig.base.json" diff --git a/graph/ui-project-details/tsconfig.lib.json b/graph/ui-project-details/tsconfig.lib.json index 8c1bec17db74e..6203e5a8be64f 100644 --- a/graph/ui-project-details/tsconfig.lib.json +++ b/graph/ui-project-details/tsconfig.lib.json @@ -1,12 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "node", - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"], + "lib": ["ES2022", "DOM"] }, "exclude": [ "jest.config.ts", @@ -21,7 +19,21 @@ "**/*.stories.ts", "**/*.stories.js", "**/*.stories.jsx", - "**/*.stories.tsx" + "**/*.stories.tsx", + "node_modules", + "../../packages/nx/**/*" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "files": [ + "../../node_modules/@nx/react/typings/cssmodule.d.ts", + "../../node_modules/@nx/react/typings/image.d.ts" + ], + "references": [ + { + "path": "../../nx-dev/ui-fence/tsconfig.lib.json" + }, + { + "path": "../ui-code-block/tsconfig.lib.json" + } + ] } diff --git a/graph/ui-project-details/tsconfig.spec.json b/graph/ui-project-details/tsconfig.spec.json index 26ef046ac5e54..fb16ed6823f61 100644 --- a/graph/ui-project-details/tsconfig.spec.json +++ b/graph/ui-project-details/tsconfig.spec.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "module": "commonjs", "types": ["jest", "node"] }, "include": [ diff --git a/graph/ui-theme/.eslintrc.json b/graph/ui-theme/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/graph/ui-theme/.eslintrc.json +++ b/graph/ui-theme/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/graph/ui-theme/package.json b/graph/ui-theme/package.json new file mode 100644 index 0000000000000..d3d362b2e6238 --- /dev/null +++ b/graph/ui-theme/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/graph-internal-ui-theme", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/graph/ui-theme/tsconfig.json b/graph/ui-theme/tsconfig.json index 0672cc05841f6..b96c4d05226ec 100644 --- a/graph/ui-theme/tsconfig.json +++ b/graph/ui-theme/tsconfig.json @@ -12,12 +12,6 @@ "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - }, - { - "path": "./tsconfig.storybook.json" } ], "extends": "../../tsconfig.base.json" diff --git a/graph/ui-theme/tsconfig.lib.json b/graph/ui-theme/tsconfig.lib.json index 8c1bec17db74e..0b370fad08304 100644 --- a/graph/ui-theme/tsconfig.lib.json +++ b/graph/ui-theme/tsconfig.lib.json @@ -1,12 +1,10 @@ { - "extends": "./tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "node", - "@nx/react/typings/cssmodule.d.ts", - "@nx/react/typings/image.d.ts" - ] + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node"], + "lib": ["ES2022", "DOM"] }, "exclude": [ "jest.config.ts", @@ -23,5 +21,9 @@ "**/*.stories.jsx", "**/*.stories.tsx" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "files": [ + "../../node_modules/@nx/react/typings/cssmodule.d.ts", + "../../node_modules/@nx/react/typings/image.d.ts" + ] } diff --git a/jest.preset.js b/jest.preset.js index f47c7e50e350e..724daebe0a28a 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -14,4 +14,62 @@ module.exports = { maxWorkers: 1, testEnvironment: 'node', setupFiles: ['../../scripts/unit-test-setup.js'], + moduleNameMapper: { + // TypeScript source mappings needed for Jest to resolve imports correctly + // Until ts-jest supports ts references, see: https://github.com/kulshekhar/ts-jest/pull/4689 & https://github.com/kulshekhar/ts-jest/issues/1648 + '^@nx/devkit$': '/../devkit/index.ts', + '^@nx/devkit/testing$': '/../devkit/testing.ts', + '^@nx/devkit/internal-testing-utils$': + '/../devkit/internal-testing-utils.ts', + '^@nx/devkit/src/(.*)$': '/../devkit/src/$1', + '^nx/src/devkit-exports$': '/../nx/src/devkit-exports.ts', + '^nx/src/devkit-internals$': '/../nx/src/devkit-internals.ts', + '^nx/src/devkit-testing-exports$': + '/../nx/src/devkit-testing-exports.ts', + '^nx/src/internal-testing-utils/(.*)$': + '/../nx/src/internal-testing-utils/$1', + '^nx/src/generators/(.*)$': '/../nx/src/generators/$1', + '^nx/src/plugins/(.*)$': '/../nx/src/plugins/$1', + '^nx/src/utils/(.*)$': '/../nx/src/utils/$1', + '^nx/src/config/(.*)$': '/../nx/src/config/$1', + '^nx/src/command-line/(.*)$': '/../nx/src/command-line/$1', + '^nx/src/project-graph/(.*)$': '/../nx/src/project-graph/$1', + '^nx/src/daemon/(.*)$': '/../nx/src/daemon/$1', + '^nx/src/utils/(.*)$': '/../nx/src/utils/$1', + '^nx/src/hasher/(.*)$': '/../nx/src/hasher/$1', + '^nx/src/tasks-runner/(.*)$': '/../nx/src/tasks-runner/$1', + '^nx/src/adapter/(.*)$': '/../nx/src/adapter/$1', + '^nx/package.json$': '/../nx/package.json', + '^@nx/workspace$': '/../workspace/index.ts', + '^@nx/workspace/src/(.*)$': '/../workspace/src/$1', + // TS Solution: Map workspace packages to their TypeScript source + '^@nx/rollup$': '/../rollup/index.ts', + '^@nx/eslint$': '/../eslint/index.ts', + '^@nx/vite$': '/../vite/index.ts', + '^@nx/vite/src/(.*)$': '/../vite/src/$1', + '^@nx/jest$': '/../jest/index.ts', + '^@nx/js$': '/../js/src/index.ts', + '^@nx/js/src/(.*)$': '/../js/src/$1', + '^@nx/eslint/src/(.*)$': '/../eslint/src/$1', + '^@nx/esbuild$': '/../esbuild/index.ts', + '^@nx/react$': '/../react/index.ts', + '^@nx/playwright/plugin$': '/../playwright/plugin.ts', + '^@nx/rollup$': '/../rollup/index.ts', + '^@nx/rspack$': '/../rspack/src/index.ts', + '^@nx/plugin$': '/../plugin/index.ts', + '^@nx/plugin/src/(.*)$': '/../plugin/src/$1', + '^@nx/angular$': '/../angular/index.ts', + '^@nx/angular/src/(.*)$': '/../angular/src/$1', + '^@nx/react/src/(.*)$': '/../react/src/$1', + '^@nx/next$': '/../next/index.ts', + '^@nx/next/src/(.*)$': '/../next/src/$1', + '^@nx/nuxt$': '/../nuxt/index.ts', + '^@nx/nuxt/src/(.*)$': '/../nuxt/src/$1', + '^@nx/node$': '/../node/index.ts', + '^@nx/node/src/(.*)$': '/../node/src/$1', + '^@nx/web/src/(.*)$': '/../web/src/$1', + '^@nx/webpack/src/(.*)$': '/../webpack/src/$1', + '^@nx/cypress/src/(.*)$': '/../cypress/src/$1', + '^@nx/jest/src/(.*)$': '/../jest/src/$1', + }, }; diff --git a/nx-dev/data-access-careers/.eslintrc.json b/nx-dev/data-access-careers/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/data-access-careers/.eslintrc.json +++ b/nx-dev/data-access-careers/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/data-access-careers/node-only/index.ts b/nx-dev/data-access-careers/node-only/index.ts new file mode 100644 index 0000000000000..403f2290f9eef --- /dev/null +++ b/nx-dev/data-access-careers/node-only/index.ts @@ -0,0 +1 @@ +export * from '../src/node.index'; diff --git a/nx-dev/data-access-careers/package.json b/nx-dev/data-access-careers/package.json new file mode 100644 index 0000000000000..6fbfd096e187b --- /dev/null +++ b/nx-dev/data-access-careers/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/nx-dev-data-access-careers", + "private": true, + "version": "0.0.1", + "type": "commonjs", + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/nx-dev/data-access-careers/tsconfig.lib.json b/nx-dev/data-access-careers/tsconfig.lib.json index 3b824cf3a50b7..9f11beae62ed7 100644 --- a/nx-dev/data-access-careers/tsconfig.lib.json +++ b/nx-dev/data-access-careers/tsconfig.lib.json @@ -1,13 +1,15 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/data-access-careers", "types": [ "node", "@nx/react/typings/cssmodule.d.ts", "@nx/react/typings/image.d.ts" ], - "lib": ["dom"] + "lib": ["dom"], + "composite": true, + "declaration": true }, "exclude": [ "jest.config.ts", diff --git a/nx-dev/data-access-courses/package.json b/nx-dev/data-access-courses/package.json new file mode 100644 index 0000000000000..7b4ec4c5ab297 --- /dev/null +++ b/nx-dev/data-access-courses/package.json @@ -0,0 +1,12 @@ +{ + "name": "@nx/nx-dev-data-access-courses", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-ui-markdoc": "workspace:*", + "@nx/nx-dev-data-access-documents": "workspace:*" + } +} diff --git a/nx-dev/data-access-courses/src/lib/course.types.ts b/nx-dev/data-access-courses/src/lib/course.types.ts index 16f40afc03a35..6d019ac4a0066 100644 --- a/nx-dev/data-access-courses/src/lib/course.types.ts +++ b/nx-dev/data-access-courses/src/lib/course.types.ts @@ -1,4 +1,4 @@ -import type { BlogAuthor } from '@nx/nx-dev/data-access-documents/node-only'; +import type { BlogAuthor } from '@nx/nx-dev-data-access-documents/node-only'; export interface Course { id: string; diff --git a/nx-dev/data-access-courses/src/lib/courses.api.ts b/nx-dev/data-access-courses/src/lib/courses.api.ts index 74c3f1582ce33..866d9623f0f4c 100644 --- a/nx-dev/data-access-courses/src/lib/courses.api.ts +++ b/nx-dev/data-access-courses/src/lib/courses.api.ts @@ -1,6 +1,6 @@ import { readFile, readdir } from 'fs/promises'; import { join } from 'path'; -import { extractFrontmatter } from '@nx/nx-dev/ui-markdoc'; +import { extractFrontmatter } from '@nx/nx-dev-ui-markdoc'; import { readFileSync, lstatSync } from 'fs'; import { Course, Lesson } from './course.types'; import { calculateTotalDuration } from './duration.utils'; diff --git a/nx-dev/data-access-courses/tsconfig.json b/nx-dev/data-access-courses/tsconfig.json index 95cfeb243dd57..965e5e6844612 100644 --- a/nx-dev/data-access-courses/tsconfig.json +++ b/nx-dev/data-access-courses/tsconfig.json @@ -9,6 +9,12 @@ "files": [], "include": [], "references": [ + { + "path": "../data-access-documents" + }, + { + "path": "../ui-markdoc" + }, { "path": "./tsconfig.lib.json" } diff --git a/nx-dev/data-access-courses/tsconfig.lib.json b/nx-dev/data-access-courses/tsconfig.lib.json index 461061d0b2fd8..5463c38bafca8 100644 --- a/nx-dev/data-access-courses/tsconfig.lib.json +++ b/nx-dev/data-access-courses/tsconfig.lib.json @@ -1,9 +1,20 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["node"] + "outDir": "../../dist/out-tsc/nx-dev/data-access-courses", + "types": ["node"], + "composite": true, + "declaration": true, + "jsx": "react-jsx" }, + "references": [ + { + "path": "../data-access-documents/tsconfig.lib.json" + }, + { + "path": "../ui-markdoc/tsconfig.lib.json" + } + ], "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], "include": ["src/**/*.ts"] } diff --git a/nx-dev/data-access-documents/.eslintrc.json b/nx-dev/data-access-documents/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/data-access-documents/.eslintrc.json +++ b/nx-dev/data-access-documents/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/data-access-documents/jest.config.ts b/nx-dev/data-access-documents/jest.config.ts index 1e2d60d0ce868..6344eef6e4246 100644 --- a/nx-dev/data-access-documents/jest.config.ts +++ b/nx-dev/data-access-documents/jest.config.ts @@ -13,4 +13,12 @@ export default { moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], coverageDirectory: '../../coverage/nx-dev/data-access-documents', preset: '../../jest.preset.js', + moduleNameMapper: { + // Override for nx-dev packages - point to packages directory + '^@nx/devkit$': '/../../packages/devkit/index.ts', + '^@nx/devkit/testing$': '/../../packages/devkit/testing.ts', + '^@nx/devkit/internal-testing-utils$': + '/../../packages/devkit/internal-testing-utils.ts', + '^@nx/devkit/src/(.*)$': '/../../packages/devkit/src/$1', + }, }; diff --git a/nx-dev/data-access-documents/node-only/index.ts b/nx-dev/data-access-documents/node-only/index.ts new file mode 100644 index 0000000000000..403f2290f9eef --- /dev/null +++ b/nx-dev/data-access-documents/node-only/index.ts @@ -0,0 +1 @@ +export * from '../src/node.index'; diff --git a/nx-dev/data-access-documents/package.json b/nx-dev/data-access-documents/package.json new file mode 100644 index 0000000000000..970393600239e --- /dev/null +++ b/nx-dev/data-access-documents/package.json @@ -0,0 +1,24 @@ +{ + "name": "@nx/nx-dev-data-access-documents", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "exports": { + ".": { + "import": "./src/index.ts", + "default": "./src/index.ts" + }, + "./node-only": { + "import": "./src/node.index.ts", + "default": "./src/node.index.ts" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@nx/devkit": "workspace:*", + "@nx/nx-dev-models-document": "workspace:*", + "@nx/nx-dev-models-package": "workspace:*", + "@nx/nx-dev-ui-markdoc": "workspace:*" + }, + "devDependencies": {} +} diff --git a/nx-dev/data-access-documents/src/lib/blog.api.ts b/nx-dev/data-access-documents/src/lib/blog.api.ts index ddb30f1837953..5a96387f6d25f 100644 --- a/nx-dev/data-access-documents/src/lib/blog.api.ts +++ b/nx-dev/data-access-documents/src/lib/blog.api.ts @@ -1,6 +1,6 @@ import { readFileSync, accessSync, constants } from 'fs'; import { join, basename, parse, resolve } from 'path'; -import { extractFrontmatter } from '@nx/nx-dev/ui-markdoc'; +import { extractFrontmatter } from '@nx/nx-dev-ui-markdoc'; import { sortPosts } from './blog.util'; import { BlogPostDataEntry } from './blog.model'; import { readFile, readdir } from 'fs/promises'; diff --git a/nx-dev/data-access-documents/src/lib/documents.api.ts b/nx-dev/data-access-documents/src/lib/documents.api.ts index 2aa890dacf391..bc3f7d1428c29 100644 --- a/nx-dev/data-access-documents/src/lib/documents.api.ts +++ b/nx-dev/data-access-documents/src/lib/documents.api.ts @@ -3,12 +3,12 @@ import { type DocumentMetadata, type ProcessedDocument, type RelatedDocument, -} from '@nx/nx-dev/models-document'; -import { type ProcessedPackageMetadata } from '@nx/nx-dev/models-package'; -import { readdirSync, readFileSync, existsSync } from 'node:fs'; +} from '@nx/nx-dev-models-document'; +import { type ProcessedPackageMetadata } from '@nx/nx-dev-models-package'; +import { existsSync, readdirSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import { type TagsApi } from './tags.api'; -import { extractFrontmatter } from '@nx/nx-dev/ui-markdoc'; +import { extractFrontmatter } from '@nx/nx-dev-ui-markdoc'; interface StaticDocumentPaths { params: { segments: string[] }; diff --git a/nx-dev/data-access-documents/src/lib/tags.api.ts b/nx-dev/data-access-documents/src/lib/tags.api.ts index 5e73b874085b6..94aeca47f535a 100644 --- a/nx-dev/data-access-documents/src/lib/tags.api.ts +++ b/nx-dev/data-access-documents/src/lib/tags.api.ts @@ -1,4 +1,4 @@ -import { RelatedDocument } from '@nx/nx-dev/models-document'; +import { RelatedDocument } from '@nx/nx-dev-models-document'; export class TagsApi { private readonly manifest: Record; diff --git a/nx-dev/data-access-documents/tsconfig.json b/nx-dev/data-access-documents/tsconfig.json index ecd9872c40282..44aabaf206611 100644 --- a/nx-dev/data-access-documents/tsconfig.json +++ b/nx-dev/data-access-documents/tsconfig.json @@ -7,10 +7,19 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-markdoc" + }, + { + "path": "../models-package" + }, + { + "path": "../models-document" + }, + { + "path": "../../packages/devkit" }, { - "path": "./tsconfig.spec.json" + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/data-access-documents/tsconfig.lib.json b/nx-dev/data-access-documents/tsconfig.lib.json index 339899f151f74..1c8a9048cedc2 100644 --- a/nx-dev/data-access-documents/tsconfig.lib.json +++ b/nx-dev/data-access-documents/tsconfig.lib.json @@ -4,9 +4,26 @@ "allowSyntheticDefaultImports": true, "esModuleInterop": true, "resolveJsonModule": true, - "outDir": "../../dist/out-tsc", - "types": ["node"] + "outDir": "../../dist/out-tsc/nx-dev/data-access-documents", + "types": ["node"], + "composite": true, + "declaration": true, + "jsx": "react-jsx" }, + "references": [ + { + "path": "../ui-markdoc/tsconfig.lib.json" + }, + { + "path": "../models-package/tsconfig.lib.json" + }, + { + "path": "../models-document/tsconfig.lib.json" + }, + { + "path": "../../packages/devkit/tsconfig.lib.json" + } + ], "include": ["**/*.ts"], "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"] } diff --git a/nx-dev/data-access-menu/.eslintrc.json b/nx-dev/data-access-menu/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/data-access-menu/.eslintrc.json +++ b/nx-dev/data-access-menu/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/data-access-menu/package.json b/nx-dev/data-access-menu/package.json new file mode 100644 index 0000000000000..2f25d96f7138f --- /dev/null +++ b/nx-dev/data-access-menu/package.json @@ -0,0 +1,11 @@ +{ + "name": "@nx/nx-dev-data-access-menu", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-models-menu": "workspace:*" + } +} diff --git a/nx-dev/data-access-menu/src/lib/menu.api.ts b/nx-dev/data-access-menu/src/lib/menu.api.ts index ed835c20bafdf..038fecc163158 100644 --- a/nx-dev/data-access-menu/src/lib/menu.api.ts +++ b/nx-dev/data-access-menu/src/lib/menu.api.ts @@ -1,4 +1,4 @@ -import { MenuItem } from '@nx/nx-dev/models-menu'; +import { MenuItem } from '@nx/nx-dev-models-menu'; export class MenusApi { private readonly cache: { id: string; menu: MenuItem[] }[]; diff --git a/nx-dev/data-access-menu/src/lib/menu.utils.ts b/nx-dev/data-access-menu/src/lib/menu.utils.ts index b58738053c947..8986cbfe246d0 100644 --- a/nx-dev/data-access-menu/src/lib/menu.utils.ts +++ b/nx-dev/data-access-menu/src/lib/menu.utils.ts @@ -1,4 +1,4 @@ -import { MenuItem, MenuSection } from '@nx/nx-dev/models-menu'; +import { MenuItem, MenuSection } from '@nx/nx-dev-models-menu'; const COLLAPSIBLE_SECTIONS = ['concepts', 'recipes', 'enterprise']; diff --git a/nx-dev/data-access-menu/tsconfig.json b/nx-dev/data-access-menu/tsconfig.json index e258886ffc933..9aa8e090d8afa 100644 --- a/nx-dev/data-access-menu/tsconfig.json +++ b/nx-dev/data-access-menu/tsconfig.json @@ -4,10 +4,10 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../models-menu" }, { - "path": "./tsconfig.spec.json" + "path": "./tsconfig.lib.json" } ], "compilerOptions": { diff --git a/nx-dev/data-access-menu/tsconfig.lib.json b/nx-dev/data-access-menu/tsconfig.lib.json index b3f90c22fea8c..3b03ae786c355 100644 --- a/nx-dev/data-access-menu/tsconfig.lib.json +++ b/nx-dev/data-access-menu/tsconfig.lib.json @@ -1,10 +1,16 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/data-access-menu", "declaration": true, - "types": [] + "types": [], + "composite": true }, "include": ["**/*.ts"], - "exclude": ["jest.config.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.spec.ts"], + "references": [ + { + "path": "../models-menu/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/data-access-packages/.eslintrc.json b/nx-dev/data-access-packages/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/data-access-packages/.eslintrc.json +++ b/nx-dev/data-access-packages/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/data-access-packages/node-only/index.ts b/nx-dev/data-access-packages/node-only/index.ts new file mode 100644 index 0000000000000..403f2290f9eef --- /dev/null +++ b/nx-dev/data-access-packages/node-only/index.ts @@ -0,0 +1 @@ +export * from '../src/node.index'; diff --git a/nx-dev/data-access-packages/package.json b/nx-dev/data-access-packages/package.json new file mode 100644 index 0000000000000..157f8f233a2c3 --- /dev/null +++ b/nx-dev/data-access-packages/package.json @@ -0,0 +1,22 @@ +{ + "name": "@nx/nx-dev-data-access-packages", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "exports": { + ".": { + "import": "./src/index.ts", + "default": "./src/index.ts" + }, + "./node-only": { + "import": "./src/node.index.ts", + "default": "./src/node.index.ts" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@nx/nx-dev-models-package": "workspace:*", + "@nx/nx-dev-models-document": "workspace:*", + "@nx/nx-dev-data-access-documents": "workspace:*" + } +} diff --git a/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts b/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts index 4f1944892a414..e34fc4a93f1e1 100644 --- a/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts +++ b/nx-dev/data-access-packages/src/lib/get-description-for-schema.ts @@ -1,4 +1,4 @@ -import { JsonSchema } from '@nx/nx-dev/models-package'; +import { JsonSchema } from '@nx/nx-dev-models-package'; export function getDescriptionForSchema(schema: JsonSchema): string { if (typeof schema === 'boolean') { diff --git a/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts b/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts index fcea028fa129d..a2176c408bc96 100644 --- a/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts +++ b/nx-dev/data-access-packages/src/lib/get-title-for-schema.ts @@ -1,4 +1,4 @@ -import { JsonSchema1 } from '@nx/nx-dev/models-package'; +import { JsonSchema1 } from '@nx/nx-dev-models-package'; export function getTitleForSchema( reference: string, diff --git a/nx-dev/data-access-packages/src/lib/lookup.ts b/nx-dev/data-access-packages/src/lib/lookup.ts index 45abb9d0d0766..c0bdc3fb5b3c5 100644 --- a/nx-dev/data-access-packages/src/lib/lookup.ts +++ b/nx-dev/data-access-packages/src/lib/lookup.ts @@ -1,4 +1,4 @@ -import { JsonSchema, JsonSchema1 } from '@nx/nx-dev/models-package'; +import { JsonSchema, JsonSchema1 } from '@nx/nx-dev-models-package'; import { get as pointerGet } from 'jsonpointer'; /** diff --git a/nx-dev/data-access-packages/src/lib/packages.api.ts b/nx-dev/data-access-packages/src/lib/packages.api.ts index 33fdcf79bbc99..ef4109b3e2a29 100644 --- a/nx-dev/data-access-packages/src/lib/packages.api.ts +++ b/nx-dev/data-access-packages/src/lib/packages.api.ts @@ -1,12 +1,12 @@ -import { TagsApi } from '@nx/nx-dev/data-access-documents/node-only'; -import { DocumentMetadata } from '@nx/nx-dev/models-document'; +import { TagsApi } from '@nx/nx-dev-data-access-documents/node-only'; +import { DocumentMetadata } from '@nx/nx-dev-models-document'; import { FileMetadata, IntrinsicPackageMetadata, ProcessedPackageMetadata, SchemaMetadata, -} from '@nx/nx-dev/models-package'; -import { readFileSync, lstatSync, readdirSync } from 'fs'; +} from '@nx/nx-dev-models-package'; +import { readFileSync, readdirSync } from 'fs'; import { join } from 'path'; interface StaticDocumentPaths { diff --git a/nx-dev/data-access-packages/tsconfig.json b/nx-dev/data-access-packages/tsconfig.json index ecd9872c40282..4c745bfc66565 100644 --- a/nx-dev/data-access-packages/tsconfig.json +++ b/nx-dev/data-access-packages/tsconfig.json @@ -7,10 +7,16 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../data-access-documents" + }, + { + "path": "../models-document" }, { - "path": "./tsconfig.spec.json" + "path": "../models-package" + }, + { + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/data-access-packages/tsconfig.lib.json b/nx-dev/data-access-packages/tsconfig.lib.json index 339899f151f74..e9026b7c52c21 100644 --- a/nx-dev/data-access-packages/tsconfig.lib.json +++ b/nx-dev/data-access-packages/tsconfig.lib.json @@ -4,9 +4,22 @@ "allowSyntheticDefaultImports": true, "esModuleInterop": true, "resolveJsonModule": true, - "outDir": "../../dist/out-tsc", - "types": ["node"] + "outDir": "../../dist/out-tsc/nx-dev/data-access-packages", + "types": ["node"], + "composite": true, + "declaration": true }, + "references": [ + { + "path": "../data-access-documents/tsconfig.lib.json" + }, + { + "path": "../models-document/tsconfig.lib.json" + }, + { + "path": "../models-package/tsconfig.lib.json" + } + ], "include": ["**/*.ts"], "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"] } diff --git a/nx-dev/feature-ai/.eslintrc.json b/nx-dev/feature-ai/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-ai/.eslintrc.json +++ b/nx-dev/feature-ai/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-ai/jest.config.ts b/nx-dev/feature-ai/jest.config.ts index 80eb900706dc2..8ba2d935455c9 100644 --- a/nx-dev/feature-ai/jest.config.ts +++ b/nx-dev/feature-ai/jest.config.ts @@ -1,10 +1,18 @@ /* eslint-disable */ export default { - displayName: 'nx-dev-feature-search', + displayName: 'nx-dev-feature-ai', transform: { '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }], }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], coverageDirectory: '../../coverage/nx-dev/feature-ai', preset: '../../jest.preset.js', + moduleNameMapper: { + // Override for nx-dev packages - point to packages directory + '^@nx/devkit$': '/../../packages/devkit/index.ts', + '^@nx/devkit/testing$': '/../../packages/devkit/testing.ts', + '^@nx/devkit/internal-testing-utils$': + '/../../packages/devkit/internal-testing-utils.ts', + '^@nx/devkit/src/(.*)$': '/../../packages/devkit/src/$1', + }, }; diff --git a/nx-dev/feature-ai/package.json b/nx-dev/feature-ai/package.json new file mode 100644 index 0000000000000..ad3c62efa57e1 --- /dev/null +++ b/nx-dev/feature-ai/package.json @@ -0,0 +1,16 @@ +{ + "name": "@nx/nx-dev-feature-ai", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-feature-analytics": "workspace:*", + "@nx/nx-dev-util-ai": "workspace:*", + "@nx/nx-dev-ui-primitives": "workspace:*", + "@nx/nx-dev-ui-common": "workspace:*", + "@nx/nx-dev-ui-markdoc": "workspace:*", + "ai": "^3.4.15" + } +} diff --git a/nx-dev/feature-ai/src/lib/feed-container.tsx b/nx-dev/feature-ai/src/lib/feed-container.tsx index 1891a2e2cd72b..846ae50e141bc 100644 --- a/nx-dev/feature-ai/src/lib/feed-container.tsx +++ b/nx-dev/feature-ai/src/lib/feed-container.tsx @@ -1,4 +1,4 @@ -import { sendCustomEvent } from '@nx/nx-dev/feature-analytics'; +import { sendCustomEvent } from '@nx/nx-dev-feature-analytics'; import { type FormEvent, type JSX, @@ -11,9 +11,9 @@ import { ErrorMessage } from './error-message'; import { Feed } from './feed/feed'; import { LoadingState } from './loading-state'; import { Prompt } from './prompt'; -import { getQueryFromUid, storeQueryForUid } from '@nx/nx-dev/util-ai'; +import { getQueryFromUid, storeQueryForUid } from '@nx/nx-dev-util-ai'; import { Message, useChat } from 'ai/react'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { cx } from '@nx/nx-dev-ui-primitives'; const assistantWelcome: Message = { id: 'first-custom-message', diff --git a/nx-dev/feature-ai/src/lib/feed/feed-answer.spec.tsx b/nx-dev/feature-ai/src/lib/feed/feed-answer.spec.tsx index 73f165b96c96d..10b67c2e7a77b 100644 --- a/nx-dev/feature-ai/src/lib/feed/feed-answer.spec.tsx +++ b/nx-dev/feature-ai/src/lib/feed/feed-answer.spec.tsx @@ -24,7 +24,7 @@ jest.mock('@nx/graph/legacy/shared', () => { }; }); -jest.mock('@nx/nx-dev/ui-primitives', () => { +jest.mock('@nx/nx-dev-ui-primitives', () => { return { cx: jest.fn(() => null), }; diff --git a/nx-dev/feature-ai/src/lib/feed/feed-answer.tsx b/nx-dev/feature-ai/src/lib/feed/feed-answer.tsx index 0538904255978..4a3f7f78a1067 100644 --- a/nx-dev/feature-ai/src/lib/feed/feed-answer.tsx +++ b/nx-dev/feature-ai/src/lib/feed/feed-answer.tsx @@ -2,10 +2,10 @@ import { HandThumbDownIcon, HandThumbUpIcon, } from '@heroicons/react/24/outline'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { cx } from '@nx/nx-dev-ui-primitives'; import { useMemo, useState } from 'react'; import { ChatGptLogo } from './chat-gpt-logo'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; // Exported for tests export function normalizeContent(content: string): string { diff --git a/nx-dev/feature-ai/src/lib/prompt.tsx b/nx-dev/feature-ai/src/lib/prompt.tsx index 3d6a93677c1fc..6031dfe46c8a4 100644 --- a/nx-dev/feature-ai/src/lib/prompt.tsx +++ b/nx-dev/feature-ai/src/lib/prompt.tsx @@ -6,10 +6,10 @@ import { PlusIcon, StopIcon, } from '@heroicons/react/24/outline'; -import { Button } from '@nx/nx-dev/ui-common'; +import { Button } from '@nx/nx-dev-ui-common'; import Textarea from 'react-textarea-autosize'; import { ChatRequestOptions } from 'ai'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { cx } from '@nx/nx-dev-ui-primitives'; export function Prompt({ isGenerating, diff --git a/nx-dev/feature-ai/tsconfig.json b/nx-dev/feature-ai/tsconfig.json index 3230750a884f7..7b8a7bbbe0d68 100644 --- a/nx-dev/feature-ai/tsconfig.json +++ b/nx-dev/feature-ai/tsconfig.json @@ -8,16 +8,30 @@ "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "module": "esnext" }, "files": [], "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-markdoc" + }, + { + "path": "../ui-common" + }, + { + "path": "../ui-primitives" }, { - "path": "./tsconfig.spec.json" + "path": "../util-ai" + }, + { + "path": "../feature-analytics" + }, + { + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/feature-ai/tsconfig.lib.json b/nx-dev/feature-ai/tsconfig.lib.json index cccfe3f7d83d9..ad3e95ec1881f 100644 --- a/nx-dev/feature-ai/tsconfig.lib.json +++ b/nx-dev/feature-ai/tsconfig.lib.json @@ -1,9 +1,11 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/feature-ai", "types": ["node"], - "lib": ["dom"] + "lib": ["dom"], + "composite": true, + "declaration": true }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", @@ -16,5 +18,22 @@ "**/*.test.tsx", "jest.config.ts" ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], + "references": [ + { + "path": "../ui-markdoc/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + }, + { + "path": "../ui-primitives/tsconfig.lib.json" + }, + { + "path": "../util-ai/tsconfig.lib.json" + }, + { + "path": "../feature-analytics/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/feature-analytics/.eslintrc.json b/nx-dev/feature-analytics/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-analytics/.eslintrc.json +++ b/nx-dev/feature-analytics/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-analytics/package.json b/nx-dev/feature-analytics/package.json new file mode 100644 index 0000000000000..40b1287372c4d --- /dev/null +++ b/nx-dev/feature-analytics/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/nx-dev-feature-analytics", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/nx-dev/feature-analytics/tsconfig.json b/nx-dev/feature-analytics/tsconfig.json index 3230750a884f7..6d076c06d55ac 100644 --- a/nx-dev/feature-analytics/tsconfig.json +++ b/nx-dev/feature-analytics/tsconfig.json @@ -15,9 +15,6 @@ "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" } ] } diff --git a/nx-dev/feature-analytics/tsconfig.lib.json b/nx-dev/feature-analytics/tsconfig.lib.json index 4cdfabb3c6a82..3e4f8860ed08e 100644 --- a/nx-dev/feature-analytics/tsconfig.lib.json +++ b/nx-dev/feature-analytics/tsconfig.lib.json @@ -1,8 +1,10 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": ["node"] + "outDir": "../../dist/out-tsc/nx-dev/feature-analytics", + "types": ["node"], + "composite": true, + "declaration": true }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", diff --git a/nx-dev/feature-doc-viewer/.eslintrc.json b/nx-dev/feature-doc-viewer/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-doc-viewer/.eslintrc.json +++ b/nx-dev/feature-doc-viewer/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-doc-viewer/package.json b/nx-dev/feature-doc-viewer/package.json new file mode 100644 index 0000000000000..4d5478f4b7524 --- /dev/null +++ b/nx-dev/feature-doc-viewer/package.json @@ -0,0 +1,16 @@ +{ + "name": "@nx/nx-dev-feature-doc-viewer", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-models-document": "workspace:*", + "@nx/nx-dev-ui-common": "workspace:*", + "@nx/nx-dev-ui-markdoc": "workspace:*", + "@nx/nx-dev-ui-primitives": "workspace:*", + "@nx/nx-dev-feature-analytics": "workspace:*", + "@nx/nx-dev-feature-feedback": "workspace:*" + } +} diff --git a/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx b/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx index f5016b113d809..5ee952252d992 100644 --- a/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx @@ -2,17 +2,17 @@ import { categorizeRelatedDocuments, ProcessedDocument, RelatedDocument, -} from '@nx/nx-dev/models-document'; -import { Breadcrumbs, Footer, GitHubStarWidget } from '@nx/nx-dev/ui-common'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +} from '@nx/nx-dev-models-document'; +import { Breadcrumbs, Footer, GitHubStarWidget } from '@nx/nx-dev-ui-common'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; -import { cx } from '@nx/nx-dev/ui-primitives'; -import { useRef, useState } from 'react'; +import { cx } from '@nx/nx-dev-ui-primitives'; +import { useRef, useState, useEffect } from 'react'; import { collectHeadings, TableOfContents } from './table-of-contents'; import { RelatedDocumentsSection } from './related-documents-section'; -import { sendCustomEvent } from '@nx/nx-dev/feature-analytics'; -import { FeedbackDialog } from '@nx/nx-dev/feature-feedback'; +import { sendCustomEvent } from '@nx/nx-dev-feature-analytics'; +import { FeedbackDialog } from '@nx/nx-dev-feature-feedback'; export function DocViewer({ document, @@ -24,13 +24,21 @@ export function DocViewer({ widgetData: { githubStarsCount: number }; }): JSX.Element { const router = useRouter(); + const [currentPath, setCurrentPath] = useState(''); + const [basePath, setBasePath] = useState(''); + + useEffect(() => { + setCurrentPath(router.asPath); + setBasePath(router.basePath); + }, [router.asPath, router.basePath]); + const hideTableOfContent = - router.asPath.endsWith('/getting-started') || - router.asPath.includes('/ci/intro/ci-with-nx') || - router.asPath.includes('/extending-nx/intro/getting-started') || - router.asPath.includes('/nx-api/devkit') || - router.asPath.includes('/reference/glossary') || - router.asPath.includes('/ci/reference/release-notes'); + currentPath.endsWith('/getting-started') || + currentPath.includes('/ci/intro/ci-with-nx') || + currentPath.includes('/extending-nx/intro/getting-started') || + currentPath.includes('/nx-api/devkit') || + currentPath.includes('/reference/glossary') || + currentPath.includes('/ci/reference/release-notes'); const ref = useRef(null); const { metadata, node, treeNode } = renderMarkdown( @@ -75,14 +83,14 @@ export function DocViewer({ 'An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.' } openGraph={{ - url: 'https://nx.dev' + router.asPath, + url: 'https://nx.dev' + currentPath, title: vm.title, description: vm.description ?? 'An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.', images: [ { - url: `https://nx.dev/images/open-graph/${router.asPath + url: `https://nx.dev/images/open-graph/${currentPath .replace('/', '') .replace(/\//gi, '-')}.${ vm.mediaImage ? getExtension(vm.mediaImage) : 'jpg' @@ -144,7 +152,7 @@ export function DocViewer({ )} diff --git a/nx-dev/feature-doc-viewer/src/lib/related-documents-section.tsx b/nx-dev/feature-doc-viewer/src/lib/related-documents-section.tsx index c2612ee8ba2a1..b399cd43e5750 100644 --- a/nx-dev/feature-doc-viewer/src/lib/related-documents-section.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/related-documents-section.tsx @@ -1,4 +1,4 @@ -import { RelatedDocumentsCategory } from '@nx/nx-dev/models-document'; +import { RelatedDocumentsCategory } from '@nx/nx-dev-models-document'; import { CubeTransparentIcon, ArrowRightIcon, diff --git a/nx-dev/feature-doc-viewer/src/lib/table-of-contents.tsx b/nx-dev/feature-doc-viewer/src/lib/table-of-contents.tsx index 6111a192d5d8d..a9dd179e946a9 100644 --- a/nx-dev/feature-doc-viewer/src/lib/table-of-contents.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/table-of-contents.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { cx } from '@nx/nx-dev-ui-primitives'; import { useHeadingsObserver } from './use-headings-observer'; -import { ProcessedDocument } from '@nx/nx-dev/models-document'; +import { ProcessedDocument } from '@nx/nx-dev-models-document'; interface Heading { id: string; diff --git a/nx-dev/feature-doc-viewer/src/lib/use-headings-observer.ts b/nx-dev/feature-doc-viewer/src/lib/use-headings-observer.ts index ac69b8daa59cc..9063d849ae08b 100644 --- a/nx-dev/feature-doc-viewer/src/lib/use-headings-observer.ts +++ b/nx-dev/feature-doc-viewer/src/lib/use-headings-observer.ts @@ -17,7 +17,7 @@ export function useHeadingsObserver( const node = elementRef?.current; // DOM Ref const hasIOSupport = !!window.IntersectionObserver; - if (!hasIOSupport || !node) return; + if (!hasIOSupport || !node) return undefined; const observer = new IntersectionObserver(handleObserver, { threshold, root, diff --git a/nx-dev/feature-doc-viewer/tsconfig.json b/nx-dev/feature-doc-viewer/tsconfig.json index 3230750a884f7..fc21dbeef5b93 100644 --- a/nx-dev/feature-doc-viewer/tsconfig.json +++ b/nx-dev/feature-doc-viewer/tsconfig.json @@ -14,10 +14,25 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../feature-feedback" + }, + { + "path": "../feature-analytics" + }, + { + "path": "../ui-primitives" + }, + { + "path": "../ui-markdoc" + }, + { + "path": "../ui-common" }, { - "path": "./tsconfig.spec.json" + "path": "../models-document" + }, + { + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/feature-doc-viewer/tsconfig.lib.json b/nx-dev/feature-doc-viewer/tsconfig.lib.json index cccfe3f7d83d9..6dcdd6293a11f 100644 --- a/nx-dev/feature-doc-viewer/tsconfig.lib.json +++ b/nx-dev/feature-doc-viewer/tsconfig.lib.json @@ -1,9 +1,11 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/feature-doc-viewer", "types": ["node"], - "lib": ["dom"] + "lib": ["dom"], + "composite": true, + "declaration": true }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", @@ -16,5 +18,25 @@ "**/*.test.tsx", "jest.config.ts" ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], + "references": [ + { + "path": "../feature-feedback/tsconfig.lib.json" + }, + { + "path": "../feature-analytics/tsconfig.lib.json" + }, + { + "path": "../ui-primitives/tsconfig.lib.json" + }, + { + "path": "../ui-markdoc/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + }, + { + "path": "../models-document/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/feature-feedback/.eslintrc.json b/nx-dev/feature-feedback/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-feedback/.eslintrc.json +++ b/nx-dev/feature-feedback/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-feedback/package.json b/nx-dev/feature-feedback/package.json new file mode 100644 index 0000000000000..bb6f760080849 --- /dev/null +++ b/nx-dev/feature-feedback/package.json @@ -0,0 +1,12 @@ +{ + "name": "@nx/nx-dev-feature-feedback", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-ui-common": "workspace:*", + "@nx/nx-dev-ui-primitives": "workspace:*" + } +} diff --git a/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx b/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx index 799b363967204..e232568aefbf9 100644 --- a/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx +++ b/nx-dev/feature-feedback/src/lib/feedback-dialog.tsx @@ -7,8 +7,8 @@ import { TransitionChild, } from '@headlessui/react'; import { ChangeEvent, Fragment, useMemo, useState } from 'react'; -import { GithubIcon } from '@nx/nx-dev/ui-common'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { GithubIcon } from '@nx/nx-dev-ui-common'; +import { cx } from '@nx/nx-dev-ui-primitives'; import styles from './feature-feedback.module.css'; diff --git a/nx-dev/feature-feedback/tsconfig.json b/nx-dev/feature-feedback/tsconfig.json index 3c41f10fb2148..b32b974713e0d 100644 --- a/nx-dev/feature-feedback/tsconfig.json +++ b/nx-dev/feature-feedback/tsconfig.json @@ -10,10 +10,13 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-primitives" + }, + { + "path": "../ui-common" }, { - "path": "./tsconfig.spec.json" + "path": "./tsconfig.lib.json" } ], "extends": "../../tsconfig.base.json" diff --git a/nx-dev/feature-feedback/tsconfig.lib.json b/nx-dev/feature-feedback/tsconfig.lib.json index cfc4843293956..cbc8e24205722 100644 --- a/nx-dev/feature-feedback/tsconfig.lib.json +++ b/nx-dev/feature-feedback/tsconfig.lib.json @@ -1,13 +1,15 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/feature-feedback", "types": [ "node", "@nx/react/typings/cssmodule.d.ts", "@nx/react/typings/image.d.ts" - ] + ], + "composite": true, + "declaration": true }, "exclude": [ "jest.config.ts", @@ -20,5 +22,13 @@ "src/**/*.spec.jsx", "src/**/*.test.jsx" ], - "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"], + "references": [ + { + "path": "../ui-primitives/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/feature-package-schema-viewer/.eslintrc.json b/nx-dev/feature-package-schema-viewer/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-package-schema-viewer/.eslintrc.json +++ b/nx-dev/feature-package-schema-viewer/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-package-schema-viewer/package.json b/nx-dev/feature-package-schema-viewer/package.json new file mode 100644 index 0000000000000..cdc3078550744 --- /dev/null +++ b/nx-dev/feature-package-schema-viewer/package.json @@ -0,0 +1,17 @@ +{ + "name": "@nx/nx-dev-feature-package-schema-viewer", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-models-document": "workspace:*", + "@nx/nx-dev-models-package": "workspace:*", + "@nx/nx-dev-ui-markdoc": "workspace:*", + "@nx/nx-dev-data-access-packages": "workspace:*", + "@nx/nx-dev-ui-common": "workspace:*", + "@nx/nx-dev-ui-primitives": "workspace:*", + "@nx/nx-dev-ui-theme": "workspace:*" + } +} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx index 727b237d8c6ec..f2bcbf6835090 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx @@ -1,17 +1,17 @@ import { HandRaisedIcon } from '@heroicons/react/24/outline'; import { XCircleIcon } from '@heroicons/react/24/solid'; -import { getSchemaFromReference } from '@nx/nx-dev/data-access-packages'; -import { JsonSchema1, NxSchema } from '@nx/nx-dev/models-package'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +import { getSchemaFromReference } from '@nx/nx-dev-data-access-packages'; +import { JsonSchema1, NxSchema } from '@nx/nx-dev-models-package'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import Link from 'next/link'; import { useRouter } from 'next/router'; -import React, { ReactNode, useState } from 'react'; +import React, { ReactNode, useState, useEffect } from 'react'; import { generateJsonExampleFor, isErrors } from './examples'; import { SchemaViewModel } from './get-schema-view-model'; import { SchemaEditor } from './schema-editor'; import { SchemaViewer } from './schema-viewer'; import { Heading2, Heading3 } from './ui/headings'; -import { cx } from '@nx/nx-dev/ui-primitives'; +import { cx } from '@nx/nx-dev-ui-primitives'; function pathCleaner(path: string): string { return path.split('?')[0]; @@ -28,7 +28,14 @@ export function Content({ ); const router = useRouter(); + const [currentPath, setCurrentPath] = useState(''); + const [isClient, setIsClient] = useState(false); const [presets, setPresets] = useState([]); + + useEffect(() => { + setIsClient(true); + setCurrentPath(router.asPath); + }, [router.asPath]); const filterWithPresets = ( data: Record, wantedProperties: string[] @@ -64,13 +71,13 @@ export function Content({ }, { name: schemaViewModel.schemaMetadata.name, - href: pathCleaner(router.asPath), + href: isClient ? pathCleaner(currentPath) : '', current: !schemaViewModel.subReference, }, !!schemaViewModel.subReference ? { name: schemaViewModel.subReference.split('/')[2], - href: pathCleaner(router.asPath), + href: isClient ? pathCleaner(currentPath) : '', current: true, } : void 0, @@ -87,7 +94,7 @@ export function Content({ return { header: renderMarkdown( getHeaderMarkdown({ - type: schemaViewModel.type, + type: schemaViewModel.type as 'executor' | 'generator', packageName: schemaViewModel.packageName, schemaName: schemaViewModel.schemaMetadata.name, schema, @@ -101,7 +108,7 @@ export function Content({ : null, usageAndExamples: renderMarkdown( getUsageAndExamplesMarkdown({ - type: schemaViewModel.type, + type: schemaViewModel.type as 'executor' | 'generator', packageName: schemaViewModel.packageName, schemaName: schemaViewModel.schemaMetadata.name, schemaAlias: schemaViewModel.schemaMetadata.aliases[0] ?? '', diff --git a/nx-dev/feature-package-schema-viewer/src/lib/examples.ts b/nx-dev/feature-package-schema-viewer/src/lib/examples.ts index af4b820782644..06761ddd480b5 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/examples.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/examples.ts @@ -1,5 +1,5 @@ -import { getSchemaFromResult, Lookup } from '@nx/nx-dev/data-access-packages'; -import { JsonSchema, JsonSchema1 } from '@nx/nx-dev/models-package'; +import { getSchemaFromResult, Lookup } from '@nx/nx-dev-data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nx/nx-dev-models-package'; import { shouldShowInStage, Stage } from './stage'; import { getOrInferType } from './types/type-inference'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts index c445f5257e9c2..955bd232f56b0 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts @@ -2,16 +2,16 @@ import { getSchemaFromReference, InternalLookup, Lookup, -} from '@nx/nx-dev/data-access-packages'; +} from '@nx/nx-dev-data-access-packages'; import { JsonSchema, NxSchema, ProcessedPackageMetadata, SchemaMetadata, -} from '@nx/nx-dev/models-package'; +} from '@nx/nx-dev-models-package'; import { ParsedUrlQuery } from 'querystring'; import { Errors, Example, generateJsonExampleFor } from './examples'; -import { pkgToGeneratedApiDocs } from '@nx/nx-dev/models-document'; +import { pkgToGeneratedApiDocs } from '@nx/nx-dev-models-document'; function getReferenceFromQuery(query: string): string { return query.replace('root/', '#/'); diff --git a/nx-dev/feature-package-schema-viewer/src/lib/migration-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/migration-viewer.tsx index 2745308122b6e..64c79264b90e7 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/migration-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/migration-viewer.tsx @@ -1,5 +1,5 @@ -import { MigrationMetadata } from '@nx/nx-dev/models-package'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +import { MigrationMetadata } from '@nx/nx-dev-models-package'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import { ReactNode } from 'react'; import { Heading3 } from './ui/headings'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx index bb4d34634d538..b6ccb7c1e9bd9 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx @@ -2,9 +2,9 @@ import { MigrationMetadata, PackageMetadata, ProcessedPackageMetadata, -} from '@nx/nx-dev/models-package'; -import { Breadcrumbs, Footer } from '@nx/nx-dev/ui-common'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +} from '@nx/nx-dev-models-package'; +import { Breadcrumbs, Footer } from '@nx/nx-dev-ui-common'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import React, { ReactNode } from 'react'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-sub-list.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-sub-list.tsx index efba6509d2e46..f2da141a85464 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-sub-list.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-sub-list.tsx @@ -2,8 +2,8 @@ import { MigrationMetadata, PackageMetadata, ProcessedPackageMetadata, -} from '@nx/nx-dev/models-package'; -import { Breadcrumbs, Footer } from '@nx/nx-dev/ui-common'; +} from '@nx/nx-dev-models-package'; +import { Breadcrumbs, Footer } from '@nx/nx-dev-ui-common'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import React from 'react'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx index a7c15b474a9b5..05b7253c0b05a 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx @@ -1,8 +1,8 @@ import { ProcessedPackageMetadata, SchemaMetadata, -} from '@nx/nx-dev/models-package'; -import { Breadcrumbs, Footer } from '@nx/nx-dev/ui-common'; +} from '@nx/nx-dev-models-package'; +import { Breadcrumbs, Footer } from '@nx/nx-dev-ui-common'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import Content from './content'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts b/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts index 6084e1d396dd6..64a02054c86e5 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/parameter-metadata.ts @@ -1,4 +1,4 @@ -import { JsonSchema } from '@nx/nx-dev/models-package'; +import { JsonSchema } from '@nx/nx-dev-models-package'; import { slugify } from './slugify.utils'; interface ParameterMetadata { diff --git a/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx b/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx index c435529d0af15..ed29185de7b0d 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/parameter-view.tsx @@ -1,6 +1,6 @@ -import { Lookup } from '@nx/nx-dev/data-access-packages'; -import { JsonSchema } from '@nx/nx-dev/models-package'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +import { Lookup } from '@nx/nx-dev-data-access-packages'; +import { JsonSchema } from '@nx/nx-dev-models-package'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import { getParameterMetadata } from './parameter-metadata'; import { getEnum } from './types/get-enum'; import { Type } from './types/type'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx index bf28c9f00c0d0..4f085dbac144d 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-editor.tsx @@ -1,6 +1,6 @@ import Editor, { useMonaco } from '@monaco-editor/react'; -import { JsonSchema } from '@nx/nx-dev/models-package'; -import { useTheme } from '@nx/nx-dev/ui-theme'; +import { JsonSchema } from '@nx/nx-dev-models-package'; +import { useTheme } from '@nx/nx-dev-ui-theme'; import { useEffect } from 'react'; export const SchemaEditor = ({ diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx index 58cbf9f47a303..0eaa79e238caf 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx @@ -3,8 +3,8 @@ import { getSchemaFromResult, Lookup, LookupResult, -} from '@nx/nx-dev/data-access-packages'; -import { JsonSchema, JsonSchema1 } from '@nx/nx-dev/models-package'; +} from '@nx/nx-dev-data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nx/nx-dev-models-package'; import { ParameterView } from './parameter-view'; import { shouldShowInStage, Stage } from './stage'; import { Type } from './types/type'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/stage.ts b/nx-dev/feature-package-schema-viewer/src/lib/stage.ts index e3222e27d654f..d36f4ff3fa6df 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/stage.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/stage.ts @@ -1,4 +1,4 @@ -import { JsonSchema } from '@nx/nx-dev/models-package'; +import { JsonSchema } from '@nx/nx-dev-models-package'; export type Stage = 'read' | 'write' | 'both'; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts b/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts index 98c501c26e152..1068b91f6828a 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/get-enum.ts @@ -1,5 +1,5 @@ -import { getSchemaFromResult, Lookup } from '@nx/nx-dev/data-access-packages'; -import { JsonSchema, JsonSchema1 } from '@nx/nx-dev/models-package'; +import { getSchemaFromResult, Lookup } from '@nx/nx-dev-data-access-packages'; +import { JsonSchema, JsonSchema1 } from '@nx/nx-dev-models-package'; import { getTypesFromEnum, isPrimitiveType } from './type-inference'; function extractEnumDirectly(schema?: JsonSchema): JsonSchema1['enum'] { diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts b/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts index de147d83a05f2..0191062e186be 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/type-inference.ts @@ -1,4 +1,4 @@ -import { JsonSchema1, SimpleTypes } from '@nx/nx-dev/models-package'; +import { JsonSchema1, SimpleTypes } from '@nx/nx-dev-models-package'; export function isPresent(t: T | undefined | null | void): t is T { return t !== undefined && t !== null; diff --git a/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx b/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx index 3271d89c9929e..8ea8ae33a54fc 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/types/type.tsx @@ -3,12 +3,12 @@ import { getSchemaFromResult, getTitleForSchema, Lookup, -} from '@nx/nx-dev/data-access-packages'; +} from '@nx/nx-dev-data-access-packages'; import { JsonSchema, JsonSchema1, SimpleTypes, -} from '@nx/nx-dev/models-package'; +} from '@nx/nx-dev-models-package'; import React from 'react'; import { joinTypes } from './join-types'; import { diff --git a/nx-dev/feature-package-schema-viewer/src/lib/ui/package-reference.tsx b/nx-dev/feature-package-schema-viewer/src/lib/ui/package-reference.tsx index 24b6cfec9c878..57dd5c0e6bf47 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/ui/package-reference.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/ui/package-reference.tsx @@ -5,9 +5,9 @@ import { DocumentIcon, InformationCircleIcon, } from '@heroicons/react/24/outline'; -import { DocumentMetadata } from '@nx/nx-dev/models-document'; -import { FileMetadata } from '@nx/nx-dev/models-package'; -import { renderMarkdown } from '@nx/nx-dev/ui-markdoc'; +import { DocumentMetadata } from '@nx/nx-dev-models-document'; +import { FileMetadata } from '@nx/nx-dev-models-package'; +import { renderMarkdown } from '@nx/nx-dev-ui-markdoc'; import Link from 'next/link'; export function DocumentList({ diff --git a/nx-dev/feature-package-schema-viewer/tsconfig.json b/nx-dev/feature-package-schema-viewer/tsconfig.json index 3230750a884f7..c746592d9c6d7 100644 --- a/nx-dev/feature-package-schema-viewer/tsconfig.json +++ b/nx-dev/feature-package-schema-viewer/tsconfig.json @@ -14,10 +14,28 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../ui-theme" + }, + { + "path": "../ui-primitives" + }, + { + "path": "../ui-common" + }, + { + "path": "../data-access-packages" }, { - "path": "./tsconfig.spec.json" + "path": "../ui-markdoc" + }, + { + "path": "../models-package" + }, + { + "path": "../models-document" + }, + { + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/feature-package-schema-viewer/tsconfig.lib.json b/nx-dev/feature-package-schema-viewer/tsconfig.lib.json index b4b6c7cd9a4bd..3c10d5c5f21fe 100644 --- a/nx-dev/feature-package-schema-viewer/tsconfig.lib.json +++ b/nx-dev/feature-package-schema-viewer/tsconfig.lib.json @@ -1,9 +1,11 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/feature-package-schema-viewer", "types": ["node"], - "lib": ["dom"] + "lib": ["dom"], + "composite": true, + "declaration": true }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", @@ -20,5 +22,28 @@ "**/*.test.jsx", "jest.config.ts" ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], + "references": [ + { + "path": "../ui-theme/tsconfig.lib.json" + }, + { + "path": "../ui-primitives/tsconfig.lib.json" + }, + { + "path": "../ui-common/tsconfig.lib.json" + }, + { + "path": "../data-access-packages/tsconfig.lib.json" + }, + { + "path": "../ui-markdoc/tsconfig.lib.json" + }, + { + "path": "../models-package/tsconfig.lib.json" + }, + { + "path": "../models-document/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/feature-search/.eslintrc.json b/nx-dev/feature-search/.eslintrc.json index a39ac5d057803..7a336d10241f8 100644 --- a/nx-dev/feature-search/.eslintrc.json +++ b/nx-dev/feature-search/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/feature-search/jest.config.ts b/nx-dev/feature-search/jest.config.ts index 3ecaf10480406..77da38bdbfcc7 100644 --- a/nx-dev/feature-search/jest.config.ts +++ b/nx-dev/feature-search/jest.config.ts @@ -7,4 +7,12 @@ export default { moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], coverageDirectory: '../../coverage/nx-dev/feature-search', preset: '../../jest.preset.js', + moduleNameMapper: { + // Override for nx-dev packages - point to packages directory + '^@nx/devkit$': '/../../packages/devkit/index.ts', + '^@nx/devkit/testing$': '/../../packages/devkit/testing.ts', + '^@nx/devkit/internal-testing-utils$': + '/../../packages/devkit/internal-testing-utils.ts', + '^@nx/devkit/src/(.*)$': '/../../packages/devkit/src/$1', + }, }; diff --git a/nx-dev/feature-search/package.json b/nx-dev/feature-search/package.json new file mode 100644 index 0000000000000..b2236a52fc354 --- /dev/null +++ b/nx-dev/feature-search/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/nx-dev-feature-search", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/nx-dev/feature-search/src/lib/algolia-search.tsx b/nx-dev/feature-search/src/lib/algolia-search.tsx index f5192e06d7536..161d41b7b072c 100644 --- a/nx-dev/feature-search/src/lib/algolia-search.tsx +++ b/nx-dev/feature-search/src/lib/algolia-search.tsx @@ -1,8 +1,9 @@ import * as docsearchReact from '@docsearch/react'; -import { - InternalDocSearchHit, - StoredDocSearchHit, -} from '@docsearch/react/dist/esm/types'; +// Note: InternalDocSearchHit and StoredDocSearchHit are not exported by @docsearch/react +// import type { +// InternalDocSearchHit, +// StoredDocSearchHit, +// } from '@docsearch/react'; import { MagnifyingGlassIcon } from '@heroicons/react/24/solid'; import Head from 'next/head'; import Link from 'next/link'; @@ -19,7 +20,7 @@ function Hit({ hit, children, }: { - hit: InternalDocSearchHit | StoredDocSearchHit; + hit: any; // TODO: Import proper types when @docsearch/react exports them children: ReactNode; }): JSX.Element { return ( diff --git a/nx-dev/feature-search/tsconfig.json b/nx-dev/feature-search/tsconfig.json index 3230750a884f7..6d076c06d55ac 100644 --- a/nx-dev/feature-search/tsconfig.json +++ b/nx-dev/feature-search/tsconfig.json @@ -15,9 +15,6 @@ "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" } ] } diff --git a/nx-dev/feature-search/tsconfig.lib.json b/nx-dev/feature-search/tsconfig.lib.json index cccfe3f7d83d9..5c4de551686b8 100644 --- a/nx-dev/feature-search/tsconfig.lib.json +++ b/nx-dev/feature-search/tsconfig.lib.json @@ -1,9 +1,11 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/feature-search", "types": ["node"], - "lib": ["dom"] + "lib": ["dom", "es2021"], + "composite": true, + "declaration": true }, "files": [ "../../node_modules/@nx/react/typings/cssmodule.d.ts", diff --git a/nx-dev/models-document/.eslintrc.json b/nx-dev/models-document/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/models-document/.eslintrc.json +++ b/nx-dev/models-document/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/models-document/package.json b/nx-dev/models-document/package.json new file mode 100644 index 0000000000000..55ef6658f74aa --- /dev/null +++ b/nx-dev/models-document/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/nx-dev-models-document", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/nx-dev/models-document/tsconfig.json b/nx-dev/models-document/tsconfig.json index 62ebbd946474c..c23e61c80035a 100644 --- a/nx-dev/models-document/tsconfig.json +++ b/nx-dev/models-document/tsconfig.json @@ -5,9 +5,6 @@ "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" } ] } diff --git a/nx-dev/models-document/tsconfig.lib.json b/nx-dev/models-document/tsconfig.lib.json index 5c589aef9e7c7..4dd7b260fb4ab 100644 --- a/nx-dev/models-document/tsconfig.lib.json +++ b/nx-dev/models-document/tsconfig.lib.json @@ -2,9 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/models-document", "declaration": true, - "types": ["node"] + "types": ["node"], + "composite": true }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], "include": ["**/*.ts"] diff --git a/nx-dev/models-menu/.eslintrc.json b/nx-dev/models-menu/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/models-menu/.eslintrc.json +++ b/nx-dev/models-menu/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/models-menu/package.json b/nx-dev/models-menu/package.json new file mode 100644 index 0000000000000..5c2105f09da1a --- /dev/null +++ b/nx-dev/models-menu/package.json @@ -0,0 +1,8 @@ +{ + "name": "@nx/nx-dev-models-menu", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts" +} diff --git a/nx-dev/models-menu/tsconfig.json b/nx-dev/models-menu/tsconfig.json index 62ebbd946474c..c23e61c80035a 100644 --- a/nx-dev/models-menu/tsconfig.json +++ b/nx-dev/models-menu/tsconfig.json @@ -5,9 +5,6 @@ "references": [ { "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" } ] } diff --git a/nx-dev/models-menu/tsconfig.lib.json b/nx-dev/models-menu/tsconfig.lib.json index 5c589aef9e7c7..df84d3fee66f3 100644 --- a/nx-dev/models-menu/tsconfig.lib.json +++ b/nx-dev/models-menu/tsconfig.lib.json @@ -2,9 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/models-menu", "declaration": true, - "types": ["node"] + "types": ["node"], + "composite": true }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], "include": ["**/*.ts"] diff --git a/nx-dev/models-package/.eslintrc.json b/nx-dev/models-package/.eslintrc.json index 9d9c0db55bb1e..b5a1809692a67 100644 --- a/nx-dev/models-package/.eslintrc.json +++ b/nx-dev/models-package/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], diff --git a/nx-dev/models-package/package.json b/nx-dev/models-package/package.json new file mode 100644 index 0000000000000..fef72646fc52b --- /dev/null +++ b/nx-dev/models-package/package.json @@ -0,0 +1,11 @@ +{ + "name": "@nx/nx-dev-models-package", + "version": "0.0.1", + "type": "commonjs", + "private": true, + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "@nx/nx-dev-models-document": "workspace:*" + } +} diff --git a/nx-dev/models-package/src/lib/package.models.ts b/nx-dev/models-package/src/lib/package.models.ts index ffbe4ab250c42..a1a0a97e92519 100644 --- a/nx-dev/models-package/src/lib/package.models.ts +++ b/nx-dev/models-package/src/lib/package.models.ts @@ -1,4 +1,4 @@ -import { DocumentMetadata } from '@nx/nx-dev/models-document'; +import { DocumentMetadata } from '@nx/nx-dev-models-document'; /** * To generate base json-schema models, you need to run the following command: * `npx json2ts nx-dev/models-package/src/lib/json-schema.draft-07.json > nx-dev/models-package/src/lib/json-schema.model.ts` diff --git a/nx-dev/models-package/tsconfig.json b/nx-dev/models-package/tsconfig.json index 62ebbd946474c..ccb5973db1402 100644 --- a/nx-dev/models-package/tsconfig.json +++ b/nx-dev/models-package/tsconfig.json @@ -4,10 +4,10 @@ "include": [], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../models-document" }, { - "path": "./tsconfig.spec.json" + "path": "./tsconfig.lib.json" } ] } diff --git a/nx-dev/models-package/tsconfig.lib.json b/nx-dev/models-package/tsconfig.lib.json index 5c589aef9e7c7..aa74b4e9a9337 100644 --- a/nx-dev/models-package/tsconfig.lib.json +++ b/nx-dev/models-package/tsconfig.lib.json @@ -2,10 +2,16 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", - "outDir": "../../dist/out-tsc", + "outDir": "../../dist/out-tsc/nx-dev/models-package", "declaration": true, - "types": ["node"] + "types": ["node"], + "composite": true }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], - "include": ["**/*.ts"] + "include": ["**/*.ts"], + "references": [ + { + "path": "../models-document/tsconfig.lib.json" + } + ] } diff --git a/nx-dev/nx-dev-e2e/.eslintrc.json b/nx-dev/nx-dev-e2e/.eslintrc.json index c1ece1052b0e4..04cccb209adda 100644 --- a/nx-dev/nx-dev-e2e/.eslintrc.json +++ b/nx-dev/nx-dev-e2e/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["plugin:playwright/recommended", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "node_modules"], "overrides": [ { "files": ["src/**/*.{ts,js,tsx,jsx}"], diff --git a/nx-dev/nx-dev/.eslintrc.json b/nx-dev/nx-dev/.eslintrc.json index 0a7f2c987e2dc..b172470dbaa91 100644 --- a/nx-dev/nx-dev/.eslintrc.json +++ b/nx-dev/nx-dev/.eslintrc.json @@ -1,4 +1,4 @@ { "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "**/.next", "public"] + "ignorePatterns": ["!**/*", "**/.next", "public", "node_modules"] } diff --git a/nx-dev/nx-dev/app/app-router-analytics.tsx b/nx-dev/nx-dev/app/app-router-analytics.tsx index 9bc143e7f7dbb..7a66c83b365d0 100644 --- a/nx-dev/nx-dev/app/app-router-analytics.tsx +++ b/nx-dev/nx-dev/app/app-router-analytics.tsx @@ -1,5 +1,5 @@ 'use client'; -import { sendPageViewEvent } from '@nx/nx-dev/feature-analytics'; +import { sendPageViewEvent } from '@nx/nx-dev-feature-analytics'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; @@ -14,5 +14,5 @@ export default function AppRouterAnalytics({ gaMeasurementId }) { } }, [pathName, gaMeasurementId, lastPath]); - return <>; + return null; } diff --git a/nx-dev/nx-dev/app/blog/[slug]/page.tsx b/nx-dev/nx-dev/app/blog/[slug]/page.tsx index 8005c2990afb3..55692a0f7c1e7 100644 --- a/nx-dev/nx-dev/app/blog/[slug]/page.tsx +++ b/nx-dev/nx-dev/app/blog/[slug]/page.tsx @@ -1,9 +1,11 @@ import type { Metadata, ResolvingMetadata } from 'next'; import { blogApi } from '../../../lib/blog.api'; -import { BlogDetails } from '@nx/nx-dev/ui-blog'; -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { BlogDetails } from '@nx/nx-dev-ui-blog'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; import { tryNxCloudForFree } from '../../../lib/header-cta.configs'; +// Needed without it Next.js will fail to serve the page with start +export const revalidate = 3600; interface BlogPostDetailProps { params: { slug: string }; } diff --git a/nx-dev/nx-dev/app/blog/page.tsx b/nx-dev/nx-dev/app/blog/page.tsx index 4bcb03cc9953c..c960043aaf5eb 100644 --- a/nx-dev/nx-dev/app/blog/page.tsx +++ b/nx-dev/nx-dev/app/blog/page.tsx @@ -1,7 +1,7 @@ import type { Metadata } from 'next'; import { blogApi } from '../../lib/blog.api'; -import { BlogContainer } from '@nx/nx-dev/ui-blog'; -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { BlogContainer } from '@nx/nx-dev-ui-blog'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; import { Suspense } from 'react'; import { requestFreeTrial, diff --git a/nx-dev/nx-dev/app/brands/page.tsx b/nx-dev/nx-dev/app/brands/page.tsx index 184a31bffbb0e..2e90013c8e6ca 100644 --- a/nx-dev/nx-dev/app/brands/page.tsx +++ b/nx-dev/nx-dev/app/brands/page.tsx @@ -1,13 +1,16 @@ -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; import { Hero, LernaBrand, NxBrand, NxCloudBrand, NxConsoleBrand, -} from '@nx/nx-dev/ui-brands'; +} from '@nx/nx-dev-ui-brands'; import type { Metadata } from 'next'; +// Needed without it Next.js will fail to serve the page with start +export const revalidate = 3600; + export const metadata: Metadata = { title: 'Brands & Guidelines', alternates: { diff --git a/nx-dev/nx-dev/app/careers/page.tsx b/nx-dev/nx-dev/app/careers/page.tsx index 9206bb7e77ea8..2d451958ac401 100644 --- a/nx-dev/nx-dev/app/careers/page.tsx +++ b/nx-dev/nx-dev/app/careers/page.tsx @@ -3,10 +3,10 @@ import { WhyJoinNx, CurrentOpenings, WhatWeOffer, -} from '@nx/nx-dev/ui-careers'; -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +} from '@nx/nx-dev-ui-careers'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; -import { fetchJobsList } from '@nx/nx-dev/data-access-careers/node-only'; +import { fetchJobsList } from '@nx/nx-dev-data-access-careers/node-only'; import { Metadata } from 'next'; async function getData() { diff --git a/nx-dev/nx-dev/app/courses/[courseId]/[lessonId]/page.tsx b/nx-dev/nx-dev/app/courses/[courseId]/[lessonId]/page.tsx index 8e559927268c3..093b115407aa2 100644 --- a/nx-dev/nx-dev/app/courses/[courseId]/[lessonId]/page.tsx +++ b/nx-dev/nx-dev/app/courses/[courseId]/[lessonId]/page.tsx @@ -1,6 +1,6 @@ import { coursesApi } from '../../../../lib/courses.api'; -import { DefaultLayout } from '@nx/nx-dev/ui-common'; -import { LessonPlayer } from '@nx/nx-dev/ui-courses'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; +import { LessonPlayer } from '@nx/nx-dev-ui-courses'; import { Metadata } from 'next'; interface LessonPageProps { diff --git a/nx-dev/nx-dev/app/courses/[courseId]/page.tsx b/nx-dev/nx-dev/app/courses/[courseId]/page.tsx index b85a91673852a..535834fede33f 100644 --- a/nx-dev/nx-dev/app/courses/[courseId]/page.tsx +++ b/nx-dev/nx-dev/app/courses/[courseId]/page.tsx @@ -1,7 +1,7 @@ import type { Metadata, ResolvingMetadata } from 'next'; import { coursesApi } from '../../../lib/courses.api'; -import { CourseDetails } from '@nx/nx-dev/ui-courses'; -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { CourseDetails } from '@nx/nx-dev-ui-courses'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; interface CourseDetailProps { params: { courseId: string }; diff --git a/nx-dev/nx-dev/app/courses/page.tsx b/nx-dev/nx-dev/app/courses/page.tsx index 879cc5fefd7ea..77f68b5c507fa 100644 --- a/nx-dev/nx-dev/app/courses/page.tsx +++ b/nx-dev/nx-dev/app/courses/page.tsx @@ -1,5 +1,5 @@ -import { DefaultLayout } from '@nx/nx-dev/ui-common'; -import { CourseOverview, CourseHero } from '@nx/nx-dev/ui-video-courses'; +import { DefaultLayout } from '@nx/nx-dev-ui-common'; +import { CourseOverview, CourseHero } from '@nx/nx-dev-ui-video-courses'; import { coursesApi } from '../../lib/courses.api'; import type { Metadata } from 'next'; diff --git a/nx-dev/nx-dev/app/global-scripts.tsx b/nx-dev/nx-dev/app/global-scripts.tsx index 3be79665dcde7..5561316ea5a0d 100644 --- a/nx-dev/nx-dev/app/global-scripts.tsx +++ b/nx-dev/nx-dev/app/global-scripts.tsx @@ -50,6 +50,7 @@ export default function GlobalScripts({ gaMeasurementId, gtmMeasurementId }) { {/* Google Tag Manager - NoScript */}