diff --git a/docs/generated/cli/generate.md b/docs/generated/cli/generate.md index a4a6e4d5c67ea..82c6f114c88f1 100644 --- a/docs/generated/cli/generate.md +++ b/docs/generated/cli/generate.md @@ -24,43 +24,43 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx` Generate a new Angular application: ```shell -nx generate @nrwl/angular:app myapp +nx generate @nx/angular:app myapp ``` Generate a new React application: ```shell -nx generate @nrwl/react:app myapp +nx generate @nx/react:app myapp ``` Generate a new web component application: ```shell -nx generate @nrwl/web:app myapp +nx generate @nx/web:app myapp ``` Generate a new Node application: ```shell -nx generate @nrwl/node:app myapp +nx generate @nx/node:app myapp ``` Generate a new Angular library application: ```shell -nx generate @nrwl/angular:library mylibrary +nx generate @nx/angular:library mylibrary ``` Generate a new React library application: ```shell -nx generate @nrwl/react:library mylibrary +nx generate @nx/react:library mylibrary ``` Generate a new Node library application: ```shell -nx generate @nrwl/node:library mylibrary +nx generate @nx/node:library mylibrary ``` ## Options diff --git a/docs/generated/cli/list.md b/docs/generated/cli/list.md index ae5c2bf3eb085..3811bd9663fad 100644 --- a/docs/generated/cli/list.md +++ b/docs/generated/cli/list.md @@ -23,10 +23,10 @@ List the plugins installed in the current workspace: nx list ``` -List the generators and executors available in the `@nrwl/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace): +List the generators and executors available in the `@nx/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace): ```shell - nx list @nrwl/web + nx list @nx/web ``` ## Options diff --git a/docs/generated/cli/migrate.md b/docs/generated/cli/migrate.md index ad793708015f5..6dd1f77873718 100644 --- a/docs/generated/cli/migrate.md +++ b/docs/generated/cli/migrate.md @@ -2,7 +2,7 @@ title: 'migrate - CLI command' description: 'Creates a migrations file or runs migrations from the migrations file. - - Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest) + - Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest) - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.' --- @@ -10,7 +10,7 @@ description: Creates a migrations file or runs migrations from the migrations file. -- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest) +- Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest) - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists. ## Usage @@ -35,16 +35,16 @@ Update all Nx plugins to "9.0.0". This will generate migrations.json: nx migrate 9.0.0 ``` -Update @nrwl/workspace and generate the list of migrations starting with version 8.0.0 of @nrwl/workspace and @nrwl/node, regardless of what is installed locally: +Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node, regardless of what is installed locally: ```shell - nx migrate @nrwl/workspace@9.0.0 --from="@nrwl/workspace@8.0.0,@nrwl/node@8.0.0" + nx migrate @nx/workspace@9.0.0 --from="@nx/workspace@8.0.0,@nx/node@8.0.0" ``` -Update @nrwl/workspace to "9.0.0". If it tries to update @nrwl/react or @nrwl/angular, use version "9.0.1": +Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1": ```shell - nx migrate @nrwl/workspace@9.0.0 --to="@nrwl/react@9.0.1,@nrwl/angular@9.0.1" + nx migrate @nx/workspace@9.0.0 --to="@nx/react@9.0.1,@nx/angular@9.0.1" ``` Update another-package to "12.0.0". This will update other packages and will generate migrations.json file: @@ -107,7 +107,7 @@ Exclude migrations that should have been applied on previous updates. To be used Type: `string` -Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nrwl/react@12.0.0,@nrwl/js@12.0.0") +Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@12.0.0,@nx/js@12.0.0") ### help @@ -135,7 +135,7 @@ Enable prompts to confirm whether to collect optional package updates and migrat Type: `string` -The target package and version (e.g, @nrwl/workspace@13.0.0) +The target package and version (e.g, @nx/workspace@13.0.0) ### runMigrations @@ -147,7 +147,7 @@ Execute migrations from a file (when the file isn't provided, execute migrations Type: `string` -Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nrwl/react@12.0.0,@nrwl/js@12.0.0") +Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@12.0.0,@nx/js@12.0.0") ### version diff --git a/docs/generated/cli/workspace-generator.md b/docs/generated/cli/workspace-generator.md index edb0b80d3f48a..f4d590973825c 100644 --- a/docs/generated/cli/workspace-generator.md +++ b/docs/generated/cli/workspace-generator.md @@ -31,7 +31,7 @@ Preview the changes without updating files Type: `string` -Name of the generator (e.g., @nrwl/js:library, library) +Name of the generator (e.g., @nx/js:library, library) ### help diff --git a/docs/generated/devkit/ngcli_adapter.md b/docs/generated/devkit/ngcli_adapter.md index 281b0570b0bc9..49bf7022494bd 100644 --- a/docs/generated/devkit/ngcli_adapter.md +++ b/docs/generated/devkit/ngcli_adapter.md @@ -68,12 +68,12 @@ Example: ```typescript overrideCollectionResolutionForTesting({ - '@nrwl/workspace': path.join( + '@nx/workspace': path.join( __dirname, '../../../../workspace/generators.json' ), - '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json'), + '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), + '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), }); ``` @@ -91,7 +91,7 @@ overrideCollectionResolutionForTesting({ ### wrapAngularDevkitSchematic -▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nrwl_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> +▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nx_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> #### Parameters @@ -108,10 +108,10 @@ overrideCollectionResolutionForTesting({ ##### Parameters -| Name | Type | -| :----------------- | :------------------------------------------------ | -| `host` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `generatorOptions` | `Object` | +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `host` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `generatorOptions` | `Object` | ##### Returns diff --git a/docs/generated/devkit/nrwl_devkit.md b/docs/generated/devkit/nx_devkit.md similarity index 60% rename from docs/generated/devkit/nrwl_devkit.md rename to docs/generated/devkit/nx_devkit.md index ce0df73d52ec0..bb34792585efd 100644 --- a/docs/generated/devkit/nrwl_devkit.md +++ b/docs/generated/devkit/nx_devkit.md @@ -1,4 +1,4 @@ -# Module: @nrwl/devkit +# Module: @nx/devkit The Nx Devkit is the underlying technology used to customize Nx to support different technologies and custom use-cases. It contains many utility @@ -13,152 +13,152 @@ It only uses language primitives and immutable objects ### Enumerations -- [ChangeType](../../devkit/documents/nrwl_devkit#changetype) -- [DependencyType](../../devkit/documents/nrwl_devkit#dependencytype) +- [ChangeType](../../devkit/documents/nx_devkit#changetype) +- [DependencyType](../../devkit/documents/nx_devkit#dependencytype) ### Classes -- [Hasher](../../devkit/documents/nrwl_devkit#hasher) -- [ProjectGraphBuilder](../../devkit/documents/nrwl_devkit#projectgraphbuilder) -- [Workspaces](../../devkit/documents/nrwl_devkit#workspaces) +- [Hasher](../../devkit/documents/nx_devkit#hasher) +- [ProjectGraphBuilder](../../devkit/documents/nx_devkit#projectgraphbuilder) +- [Workspaces](../../devkit/documents/nx_devkit#workspaces) ### Interfaces -- [DefaultTasksRunnerOptions](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) -- [ExecutorContext](../../devkit/documents/nrwl_devkit#executorcontext) -- [ExecutorsJson](../../devkit/documents/nrwl_devkit#executorsjson) -- [FileChange](../../devkit/documents/nrwl_devkit#filechange) -- [FileData](../../devkit/documents/nrwl_devkit#filedata) -- [GeneratorsJson](../../devkit/documents/nrwl_devkit#generatorsjson) -- [Hash](../../devkit/documents/nrwl_devkit#hash) -- [HasherContext](../../devkit/documents/nrwl_devkit#hashercontext) -- [ImplicitJsonSubsetDependency](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency) -- [JsonParseOptions](../../devkit/documents/nrwl_devkit#jsonparseoptions) -- [JsonSerializeOptions](../../devkit/documents/nrwl_devkit#jsonserializeoptions) -- [MigrationsJson](../../devkit/documents/nrwl_devkit#migrationsjson) -- [ModuleFederationConfig](../../devkit/documents/nrwl_devkit#modulefederationconfig) -- [NxAffectedConfig](../../devkit/documents/nrwl_devkit#nxaffectedconfig) -- [NxJsonConfiguration](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) -- [NxPlugin](../../devkit/documents/nrwl_devkit#nxplugin) -- [ProjectConfiguration](../../devkit/documents/nrwl_devkit#projectconfiguration) -- [ProjectFileMap](../../devkit/documents/nrwl_devkit#projectfilemap) -- [ProjectGraph](../../devkit/documents/nrwl_devkit#projectgraph) -- [ProjectGraphDependency](../../devkit/documents/nrwl_devkit#projectgraphdependency) -- [ProjectGraphExternalNode](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) -- [ProjectGraphProcessorContext](../../devkit/documents/nrwl_devkit#projectgraphprocessorcontext) -- [ProjectGraphProjectNode](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) -- [ProjectsConfigurations](../../devkit/documents/nrwl_devkit#projectsconfigurations) -- [RemoteCache](../../devkit/documents/nrwl_devkit#remotecache) -- [SharedLibraryConfig](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) -- [StringDeletion](../../devkit/documents/nrwl_devkit#stringdeletion) -- [StringInsertion](../../devkit/documents/nrwl_devkit#stringinsertion) -- [Target](../../devkit/documents/nrwl_devkit#target) -- [TargetConfiguration](../../devkit/documents/nrwl_devkit#targetconfiguration) -- [TargetDependencyConfig](../../devkit/documents/nrwl_devkit#targetdependencyconfig) -- [Task](../../devkit/documents/nrwl_devkit#task) -- [TaskGraph](../../devkit/documents/nrwl_devkit#taskgraph) -- [Tree](../../devkit/documents/nrwl_devkit#tree) -- [Workspace](../../devkit/documents/nrwl_devkit#workspace) +- [DefaultTasksRunnerOptions](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) +- [ExecutorContext](../../devkit/documents/nx_devkit#executorcontext) +- [ExecutorsJson](../../devkit/documents/nx_devkit#executorsjson) +- [FileChange](../../devkit/documents/nx_devkit#filechange) +- [FileData](../../devkit/documents/nx_devkit#filedata) +- [GeneratorsJson](../../devkit/documents/nx_devkit#generatorsjson) +- [Hash](../../devkit/documents/nx_devkit#hash) +- [HasherContext](../../devkit/documents/nx_devkit#hashercontext) +- [ImplicitJsonSubsetDependency](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency) +- [JsonParseOptions](../../devkit/documents/nx_devkit#jsonparseoptions) +- [JsonSerializeOptions](../../devkit/documents/nx_devkit#jsonserializeoptions) +- [MigrationsJson](../../devkit/documents/nx_devkit#migrationsjson) +- [ModuleFederationConfig](../../devkit/documents/nx_devkit#modulefederationconfig) +- [NxAffectedConfig](../../devkit/documents/nx_devkit#nxaffectedconfig) +- [NxJsonConfiguration](../../devkit/documents/nx_devkit#nxjsonconfiguration) +- [NxPlugin](../../devkit/documents/nx_devkit#nxplugin) +- [ProjectConfiguration](../../devkit/documents/nx_devkit#projectconfiguration) +- [ProjectFileMap](../../devkit/documents/nx_devkit#projectfilemap) +- [ProjectGraph](../../devkit/documents/nx_devkit#projectgraph) +- [ProjectGraphDependency](../../devkit/documents/nx_devkit#projectgraphdependency) +- [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) +- [ProjectGraphProcessorContext](../../devkit/documents/nx_devkit#projectgraphprocessorcontext) +- [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) +- [ProjectsConfigurations](../../devkit/documents/nx_devkit#projectsconfigurations) +- [RemoteCache](../../devkit/documents/nx_devkit#remotecache) +- [SharedLibraryConfig](../../devkit/documents/nx_devkit#sharedlibraryconfig) +- [StringDeletion](../../devkit/documents/nx_devkit#stringdeletion) +- [StringInsertion](../../devkit/documents/nx_devkit#stringinsertion) +- [Target](../../devkit/documents/nx_devkit#target) +- [TargetConfiguration](../../devkit/documents/nx_devkit#targetconfiguration) +- [TargetDependencyConfig](../../devkit/documents/nx_devkit#targetdependencyconfig) +- [Task](../../devkit/documents/nx_devkit#task) +- [TaskGraph](../../devkit/documents/nx_devkit#taskgraph) +- [Tree](../../devkit/documents/nx_devkit#tree) +- [Workspace](../../devkit/documents/nx_devkit#workspace) ### Type Aliases -- [AdditionalSharedConfig](../../devkit/documents/nrwl_devkit#additionalsharedconfig) -- [CustomHasher](../../devkit/documents/nrwl_devkit#customhasher) -- [Executor](../../devkit/documents/nrwl_devkit#executor) -- [Generator](../../devkit/documents/nrwl_devkit#generator) -- [GeneratorCallback](../../devkit/documents/nrwl_devkit#generatorcallback) -- [ImplicitDependencyEntry](../../devkit/documents/nrwl_devkit#implicitdependencyentry) -- [ModuleFederationLibrary](../../devkit/documents/nrwl_devkit#modulefederationlibrary) -- [PackageManager](../../devkit/documents/nrwl_devkit#packagemanager) -- [ProjectGraphNode](../../devkit/documents/nrwl_devkit#projectgraphnode) -- [ProjectTargetConfigurator](../../devkit/documents/nrwl_devkit#projecttargetconfigurator) -- [ProjectType](../../devkit/documents/nrwl_devkit#projecttype) -- [Remotes](../../devkit/documents/nrwl_devkit#remotes) -- [SharedFunction](../../devkit/documents/nrwl_devkit#sharedfunction) -- [SharedWorkspaceLibraryConfig](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) -- [StringChange](../../devkit/documents/nrwl_devkit#stringchange) -- [TaskGraphExecutor](../../devkit/documents/nrwl_devkit#taskgraphexecutor) -- [WorkspaceConfiguration](../../devkit/documents/nrwl_devkit#workspaceconfiguration) -- [WorkspaceJsonConfiguration](../../devkit/documents/nrwl_devkit#workspacejsonconfiguration) -- [WorkspaceLibrary](../../devkit/documents/nrwl_devkit#workspacelibrary) -- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nrwl_devkit#workspacelibrarysecondaryentrypoint) +- [AdditionalSharedConfig](../../devkit/documents/nx_devkit#additionalsharedconfig) +- [CustomHasher](../../devkit/documents/nx_devkit#customhasher) +- [Executor](../../devkit/documents/nx_devkit#executor) +- [Generator](../../devkit/documents/nx_devkit#generator) +- [GeneratorCallback](../../devkit/documents/nx_devkit#generatorcallback) +- [ImplicitDependencyEntry](../../devkit/documents/nx_devkit#implicitdependencyentry) +- [ModuleFederationLibrary](../../devkit/documents/nx_devkit#modulefederationlibrary) +- [PackageManager](../../devkit/documents/nx_devkit#packagemanager) +- [ProjectGraphNode](../../devkit/documents/nx_devkit#projectgraphnode) +- [ProjectTargetConfigurator](../../devkit/documents/nx_devkit#projecttargetconfigurator) +- [ProjectType](../../devkit/documents/nx_devkit#projecttype) +- [Remotes](../../devkit/documents/nx_devkit#remotes) +- [SharedFunction](../../devkit/documents/nx_devkit#sharedfunction) +- [SharedWorkspaceLibraryConfig](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) +- [StringChange](../../devkit/documents/nx_devkit#stringchange) +- [TaskGraphExecutor](../../devkit/documents/nx_devkit#taskgraphexecutor) +- [WorkspaceConfiguration](../../devkit/documents/nx_devkit#workspaceconfiguration) +- [WorkspaceJsonConfiguration](../../devkit/documents/nx_devkit#workspacejsonconfiguration) +- [WorkspaceLibrary](../../devkit/documents/nx_devkit#workspacelibrary) +- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nx_devkit#workspacelibrarysecondaryentrypoint) ### Variables -- [NX_VERSION](../../devkit/documents/nrwl_devkit#nx_version) -- [appRootPath](../../devkit/documents/nrwl_devkit#approotpath) -- [cacheDir](../../devkit/documents/nrwl_devkit#cachedir) -- [logger](../../devkit/documents/nrwl_devkit#logger) -- [output](../../devkit/documents/nrwl_devkit#output) -- [workspaceRoot](../../devkit/documents/nrwl_devkit#workspaceroot) +- [NX_VERSION](../../devkit/documents/nx_devkit#nx_version) +- [appRootPath](../../devkit/documents/nx_devkit#approotpath) +- [cacheDir](../../devkit/documents/nx_devkit#cachedir) +- [logger](../../devkit/documents/nx_devkit#logger) +- [output](../../devkit/documents/nx_devkit#output) +- [workspaceRoot](../../devkit/documents/nx_devkit#workspaceroot) ### Functions -- [addDependenciesToPackageJson](../../devkit/documents/nrwl_devkit#adddependenciestopackagejson) -- [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) -- [applyAdditionalShared](../../devkit/documents/nrwl_devkit#applyadditionalshared) -- [applyChangesToString](../../devkit/documents/nrwl_devkit#applychangestostring) -- [applySharedFunction](../../devkit/documents/nrwl_devkit#applysharedfunction) -- [convertNxExecutor](../../devkit/documents/nrwl_devkit#convertnxexecutor) -- [convertNxGenerator](../../devkit/documents/nrwl_devkit#convertnxgenerator) -- [createProjectGraphAsync](../../devkit/documents/nrwl_devkit#createprojectgraphasync) -- [defaultTasksRunner](../../devkit/documents/nrwl_devkit#defaulttasksrunner) -- [detectPackageManager](../../devkit/documents/nrwl_devkit#detectpackagemanager) -- [detectWorkspaceScope](../../devkit/documents/nrwl_devkit#detectworkspacescope) -- [ensurePackage](../../devkit/documents/nrwl_devkit#ensurepackage) -- [extractLayoutDirectory](../../devkit/documents/nrwl_devkit#extractlayoutdirectory) -- [formatFiles](../../devkit/documents/nrwl_devkit#formatfiles) -- [generateFiles](../../devkit/documents/nrwl_devkit#generatefiles) -- [getDependentPackagesForProject](../../devkit/documents/nrwl_devkit#getdependentpackagesforproject) -- [getImportPath](../../devkit/documents/nrwl_devkit#getimportpath) -- [getNpmPackageSharedConfig](../../devkit/documents/nrwl_devkit#getnpmpackagesharedconfig) -- [getOutputsForTargetAndConfiguration](../../devkit/documents/nrwl_devkit#getoutputsfortargetandconfiguration) -- [getPackageManagerCommand](../../devkit/documents/nrwl_devkit#getpackagemanagercommand) -- [getPackageManagerVersion](../../devkit/documents/nrwl_devkit#getpackagemanagerversion) -- [getProjects](../../devkit/documents/nrwl_devkit#getprojects) -- [getWorkspaceLayout](../../devkit/documents/nrwl_devkit#getworkspacelayout) -- [getWorkspacePath](../../devkit/documents/nrwl_devkit#getworkspacepath) -- [installPackagesTask](../../devkit/documents/nrwl_devkit#installpackagestask) -- [isStandaloneProject](../../devkit/documents/nrwl_devkit#isstandaloneproject) -- [joinPathFragments](../../devkit/documents/nrwl_devkit#joinpathfragments) -- [mapRemotes](../../devkit/documents/nrwl_devkit#mapremotes) -- [mapRemotesForSSR](../../devkit/documents/nrwl_devkit#mapremotesforssr) -- [moveFilesToNewDirectory](../../devkit/documents/nrwl_devkit#movefilestonewdirectory) -- [names](../../devkit/documents/nrwl_devkit#names) -- [normalizePath](../../devkit/documents/nrwl_devkit#normalizepath) -- [offsetFromRoot](../../devkit/documents/nrwl_devkit#offsetfromroot) -- [parseJson](../../devkit/documents/nrwl_devkit#parsejson) -- [parseTargetString](../../devkit/documents/nrwl_devkit#parsetargetstring) -- [readAllWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readallworkspaceconfiguration) -- [readCachedProjectGraph](../../devkit/documents/nrwl_devkit#readcachedprojectgraph) -- [readJson](../../devkit/documents/nrwl_devkit#readjson) -- [readJsonFile](../../devkit/documents/nrwl_devkit#readjsonfile) -- [readNxJson](../../devkit/documents/nrwl_devkit#readnxjson) -- [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) -- [readRootPackageJson](../../devkit/documents/nrwl_devkit#readrootpackagejson) -- [readTargetOptions](../../devkit/documents/nrwl_devkit#readtargetoptions) -- [readWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readworkspaceconfiguration) -- [removeDependenciesFromPackageJson](../../devkit/documents/nrwl_devkit#removedependenciesfrompackagejson) -- [removeProjectConfiguration](../../devkit/documents/nrwl_devkit#removeprojectconfiguration) -- [reverse](../../devkit/documents/nrwl_devkit#reverse) -- [runExecutor](../../devkit/documents/nrwl_devkit#runexecutor) -- [runTasksInSerial](../../devkit/documents/nrwl_devkit#runtasksinserial) -- [serializeJson](../../devkit/documents/nrwl_devkit#serializejson) -- [sharePackages](../../devkit/documents/nrwl_devkit#sharepackages) -- [shareWorkspaceLibraries](../../devkit/documents/nrwl_devkit#shareworkspacelibraries) -- [stripIndents](../../devkit/documents/nrwl_devkit#stripindents) -- [stripJsonComments](../../devkit/documents/nrwl_devkit#stripjsoncomments) -- [targetToTargetString](../../devkit/documents/nrwl_devkit#targettotargetstring) -- [toJS](../../devkit/documents/nrwl_devkit#tojs) -- [updateJson](../../devkit/documents/nrwl_devkit#updatejson) -- [updateNxJson](../../devkit/documents/nrwl_devkit#updatenxjson) -- [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) -- [updateTsConfigsToJs](../../devkit/documents/nrwl_devkit#updatetsconfigstojs) -- [updateWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#updateworkspaceconfiguration) -- [visitNotIgnoredFiles](../../devkit/documents/nrwl_devkit#visitnotignoredfiles) -- [workspaceLayout](../../devkit/documents/nrwl_devkit#workspacelayout) -- [writeJson](../../devkit/documents/nrwl_devkit#writejson) -- [writeJsonFile](../../devkit/documents/nrwl_devkit#writejsonfile) +- [addDependenciesToPackageJson](../../devkit/documents/nx_devkit#adddependenciestopackagejson) +- [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) +- [applyAdditionalShared](../../devkit/documents/nx_devkit#applyadditionalshared) +- [applyChangesToString](../../devkit/documents/nx_devkit#applychangestostring) +- [applySharedFunction](../../devkit/documents/nx_devkit#applysharedfunction) +- [convertNxExecutor](../../devkit/documents/nx_devkit#convertnxexecutor) +- [convertNxGenerator](../../devkit/documents/nx_devkit#convertnxgenerator) +- [createProjectGraphAsync](../../devkit/documents/nx_devkit#createprojectgraphasync) +- [defaultTasksRunner](../../devkit/documents/nx_devkit#defaulttasksrunner) +- [detectPackageManager](../../devkit/documents/nx_devkit#detectpackagemanager) +- [detectWorkspaceScope](../../devkit/documents/nx_devkit#detectworkspacescope) +- [ensurePackage](../../devkit/documents/nx_devkit#ensurepackage) +- [extractLayoutDirectory](../../devkit/documents/nx_devkit#extractlayoutdirectory) +- [formatFiles](../../devkit/documents/nx_devkit#formatfiles) +- [generateFiles](../../devkit/documents/nx_devkit#generatefiles) +- [getDependentPackagesForProject](../../devkit/documents/nx_devkit#getdependentpackagesforproject) +- [getImportPath](../../devkit/documents/nx_devkit#getimportpath) +- [getNpmPackageSharedConfig](../../devkit/documents/nx_devkit#getnpmpackagesharedconfig) +- [getOutputsForTargetAndConfiguration](../../devkit/documents/nx_devkit#getoutputsfortargetandconfiguration) +- [getPackageManagerCommand](../../devkit/documents/nx_devkit#getpackagemanagercommand) +- [getPackageManagerVersion](../../devkit/documents/nx_devkit#getpackagemanagerversion) +- [getProjects](../../devkit/documents/nx_devkit#getprojects) +- [getWorkspaceLayout](../../devkit/documents/nx_devkit#getworkspacelayout) +- [getWorkspacePath](../../devkit/documents/nx_devkit#getworkspacepath) +- [installPackagesTask](../../devkit/documents/nx_devkit#installpackagestask) +- [isStandaloneProject](../../devkit/documents/nx_devkit#isstandaloneproject) +- [joinPathFragments](../../devkit/documents/nx_devkit#joinpathfragments) +- [mapRemotes](../../devkit/documents/nx_devkit#mapremotes) +- [mapRemotesForSSR](../../devkit/documents/nx_devkit#mapremotesforssr) +- [moveFilesToNewDirectory](../../devkit/documents/nx_devkit#movefilestonewdirectory) +- [names](../../devkit/documents/nx_devkit#names) +- [normalizePath](../../devkit/documents/nx_devkit#normalizepath) +- [offsetFromRoot](../../devkit/documents/nx_devkit#offsetfromroot) +- [parseJson](../../devkit/documents/nx_devkit#parsejson) +- [parseTargetString](../../devkit/documents/nx_devkit#parsetargetstring) +- [readAllWorkspaceConfiguration](../../devkit/documents/nx_devkit#readallworkspaceconfiguration) +- [readCachedProjectGraph](../../devkit/documents/nx_devkit#readcachedprojectgraph) +- [readJson](../../devkit/documents/nx_devkit#readjson) +- [readJsonFile](../../devkit/documents/nx_devkit#readjsonfile) +- [readNxJson](../../devkit/documents/nx_devkit#readnxjson) +- [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) +- [readRootPackageJson](../../devkit/documents/nx_devkit#readrootpackagejson) +- [readTargetOptions](../../devkit/documents/nx_devkit#readtargetoptions) +- [readWorkspaceConfiguration](../../devkit/documents/nx_devkit#readworkspaceconfiguration) +- [removeDependenciesFromPackageJson](../../devkit/documents/nx_devkit#removedependenciesfrompackagejson) +- [removeProjectConfiguration](../../devkit/documents/nx_devkit#removeprojectconfiguration) +- [reverse](../../devkit/documents/nx_devkit#reverse) +- [runExecutor](../../devkit/documents/nx_devkit#runexecutor) +- [runTasksInSerial](../../devkit/documents/nx_devkit#runtasksinserial) +- [serializeJson](../../devkit/documents/nx_devkit#serializejson) +- [sharePackages](../../devkit/documents/nx_devkit#sharepackages) +- [shareWorkspaceLibraries](../../devkit/documents/nx_devkit#shareworkspacelibraries) +- [stripIndents](../../devkit/documents/nx_devkit#stripindents) +- [stripJsonComments](../../devkit/documents/nx_devkit#stripjsoncomments) +- [targetToTargetString](../../devkit/documents/nx_devkit#targettotargetstring) +- [toJS](../../devkit/documents/nx_devkit#tojs) +- [updateJson](../../devkit/documents/nx_devkit#updatejson) +- [updateNxJson](../../devkit/documents/nx_devkit#updatenxjson) +- [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) +- [updateTsConfigsToJs](../../devkit/documents/nx_devkit#updatetsconfigstojs) +- [updateWorkspaceConfiguration](../../devkit/documents/nx_devkit#updateworkspaceconfiguration) +- [visitNotIgnoredFiles](../../devkit/documents/nx_devkit#visitnotignoredfiles) +- [workspaceLayout](../../devkit/documents/nx_devkit#workspacelayout) +- [writeJson](../../devkit/documents/nx_devkit#writejson) +- [writeJsonFile](../../devkit/documents/nx_devkit#writejsonfile) ## Enumerations @@ -478,34 +478,34 @@ use ProjectsConfigurations or NxJsonConfiguration ### AdditionalSharedConfig -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) })[] +Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) })[] --- ### CustomHasher -Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nrwl_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nx_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> #### Type declaration -▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> ##### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `task` | [`Task`](../../devkit/documents/nrwl_devkit#task) | -| `context` | [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext) | +| Name | Type | +| :-------- | :---------------------------------------------------------------- | +| `task` | [`Task`](../../devkit/documents/nx_devkit#task) | +| `context` | [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext) | ##### Returns -`Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +`Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> --- ### Executor -Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> +Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> #### Type parameters @@ -521,10 +521,10 @@ Implementation of a target of a project ##### Parameters -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `options` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :-------- | :-------------------------------------------------------------------- | +| `options` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | ##### Returns @@ -534,7 +534,7 @@ Implementation of a target of a project ### Generator -Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> #### Type parameters @@ -544,7 +544,7 @@ Implementation of a target of a project #### Type declaration -▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> A function that schedules updates to the filesystem to be done atomically @@ -557,7 +557,7 @@ A function that schedules updates to the filesystem to be done atomically ##### Returns -`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> --- @@ -589,7 +589,7 @@ A callback function that is executed after changes are made to the file system #### Index signature -▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency)<`T`\> +▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency)<`T`\> --- @@ -614,21 +614,21 @@ A callback function that is executed after changes are made to the file system ### ProjectGraphNode -Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) +Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nx_devkit#projectgraphexternalnode) **`Deprecated`** -this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) instead +this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) instead --- ### ProjectTargetConfigurator -Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> #### Type declaration -▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> ##### Parameters @@ -638,7 +638,7 @@ this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/doc ##### Returns -`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> --- @@ -658,22 +658,22 @@ Type of project supported ### SharedFunction -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) #### Type declaration -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) ##### Parameters -| Name | Type | -| :------------- | :------------------------------------------------------------------------------ | -| `libraryName` | `string` | -| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) | +| Name | Type | +| :------------- | :---------------------------------------------------------------------------- | +| `libraryName` | `string` | +| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) | ##### Returns -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) --- @@ -683,17 +683,17 @@ Type of project supported #### Type declaration -| Name | Type | -| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------- | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | +| Name | Type | +| :--------------------- | :-------------------------------------------------------------------------------------------------------------------------- | +| `getAliases` | () => `Record`<`string`, `string`\> | +| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | +| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | --- ### StringChange -Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nrwl_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nrwl_devkit#stringdeletion) +Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nx_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nx_devkit#stringdeletion) A change to be made to a string @@ -701,7 +701,7 @@ A change to be made to a string ### TaskGraphExecutor -Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<`Record`<`string`, { `success`: `boolean` ; `terminalOutput`: `string` }\>\> +Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<`Record`<`string`, { `success`: `boolean` ; `terminalOutput`: `string` }\>\> #### Type parameters @@ -717,12 +717,12 @@ Implementation of a target of a project that handles multiple projects to be bat ##### Parameters -| Name | Type | -| :---------- | :---------------------------------------------------------------------- | -| `taskGraph` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :---------- | :-------------------------------------------------------------------- | +| `taskGraph` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | +| `options` | `Record`<`string`, `T`\> | +| `overrides` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | ##### Returns @@ -732,7 +732,7 @@ Implementation of a target of a project that handles multiple projects to be bat ### WorkspaceConfiguration -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)\> +Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)\> **`Deprecated`** @@ -742,7 +742,7 @@ using NxJsonConfiguration ### WorkspaceJsonConfiguration -Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) +Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) **`Deprecated`** @@ -840,7 +840,7 @@ The root of the workspace ### addDependenciesToPackageJson -▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Add Dependencies and Dev Dependencies to package.json @@ -854,16 +854,16 @@ This will **add** `react` and `jest` to the dependencies and devDependencies sec #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :------------------------------------------------ | :--------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | Tree representing file system to modify | -| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | -| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | +| Name | Type | Default value | Description | +| :---------------- | :---------------------------------------------- | :--------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | Tree representing file system to modify | +| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | +| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Callback to install dependencies only if necessary, no-op otherwise @@ -877,12 +877,12 @@ Adds project configuration to the Nx workspace. #### Parameters -| Name | Type | Default value | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | the file system tree | -| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | `undefined` | project configuration | -| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------ | :------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | the file system tree | +| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) | `undefined` | project configuration | +| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | #### Returns @@ -903,11 +903,11 @@ hierarchy. #### Parameters -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------------------------------------------------- | :--------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nrwl_devkit#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | The Nx project graph | +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------------------------------------------- | :--------------------------------- | +| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | The original Shared Config | +| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nx_devkit#additionalsharedconfig) | The additional dependencies to add | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | The Nx project graph | #### Returns @@ -951,10 +951,10 @@ bootstrap({ #### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `text` | `string` | -| `changes` | [`StringChange`](../../devkit/documents/nrwl_devkit#stringchange)[] | +| Name | Type | +| :-------- | :---------------------------------------------------------------- | +| `text` | `string` | +| `changes` | [`StringChange`](../../devkit/documents/nx_devkit#stringchange)[] | #### Returns @@ -971,10 +971,10 @@ of the dependencies for the Module Federation build. #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------------------------------------------------- | :---------------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/documents/nrwl_devkit#sharedfunction) | The custom function to run | +| Name | Type | Description | +| :------------- | :------------------------------------------------------------------------------------------------- | :---------------------------------------- | +| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | +| `sharedFn` | [`SharedFunction`](../../devkit/documents/nx_devkit#sharedfunction) | The custom function to run | #### Returns @@ -992,9 +992,9 @@ Use this to expose a compatible Angular Builder #### Parameters -| Name | Type | -| :--------- | :---------------------------------------------------------------- | -| `executor` | [`Executor`](../../devkit/documents/nrwl_devkit#executor)<`any`\> | +| Name | Type | +| :--------- | :-------------------------------------------------------------- | +| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor)<`any`\> | #### Returns @@ -1016,10 +1016,10 @@ Convert an Nx Generator into an Angular Devkit Schematic. #### Parameters -| Name | Type | Default value | Description | -| :----------------------------- | :---------------------------------------------------------------- | :------------ | :---------------------------------------------------------- | -| `generator` | [`Generator`](../../devkit/documents/nrwl_devkit#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | -| `skipWritingConfigInOldFormat` | `boolean` | `false` | - | +| Name | Type | Default value | Description | +| :----------------------------- | :-------------------------------------------------------------- | :------------ | :---------------------------------------------------------- | +| `generator` | [`Generator`](../../devkit/documents/nx_devkit#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | +| `skipWritingConfigInOldFormat` | `boolean` | `false` | - | #### Returns @@ -1054,7 +1054,7 @@ Convert an Nx Generator into an Angular Devkit Schematic. ### createProjectGraphAsync -▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> +▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph)\> Computes and returns a ProjectGraph. @@ -1088,7 +1088,7 @@ stored in the daemon process. To reset both run: `nx reset`. #### Returns -`Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> +`Promise`<[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph)\> --- @@ -1101,19 +1101,19 @@ will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. #### Parameters -| Name | Type | -| :--------------------------- | :---------------------------------------------------------------------------------------------------- | -| `tasks` | [`Task`](../../devkit/documents/nrwl_devkit#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`Hasher`](../../devkit/documents/nrwl_devkit#hasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | +| Name | Type | +| :--------------------------- | :-------------------------------------------------------------------------------------------------- | +| `tasks` | [`Task`](../../devkit/documents/nx_devkit#task)[] | +| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) | +| `context?` | `Object` | +| `context.daemon?` | `DaemonClient` | +| `context.hasher?` | [`Hasher`](../../devkit/documents/nx_devkit#hasher) | +| `context.initiatingProject?` | `string` | +| `context.nxArgs` | `NxArgs` | +| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | +| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | +| `context.target?` | `string` | +| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | #### Returns @@ -1123,7 +1123,7 @@ will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. ### detectPackageManager -▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) +▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) Detects which package manager is used in the workspace based on the lock file. @@ -1135,7 +1135,7 @@ Detects which package manager is used in the workspace based on the lock file. #### Returns -[`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) +[`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) --- @@ -1170,22 +1170,22 @@ Use a package that has not been installed as a dependency. For example: ```typescript -ensurePackage(tree, '@nrwl/jest', nxVersion); +ensurePackage(tree, '@nx/jest', nxVersion); ``` -This install the @nrwl/jest@ and return the module +This install the @nx/jest@ and return the module When running with --dryRun, the function will throw when dependencies are missing. #### Parameters -| Name | Type | Description | -| :------------------------ | :------------------------------------------------ | :----------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `pkg` | `string` | the package to check (e.g. @nrwl/jest) | -| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) | -| `options?` | `Object` | - | -| `options.dev?` | `boolean` | - | -| `options.throwOnMissing?` | `boolean` | - | +| Name | Type | Description | +| :------------------------ | :---------------------------------------------- | :----------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `pkg` | `string` | the package to check (e.g. @nx/jest) | +| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) | +| `options?` | `Object` | - | +| `options.dev?` | `boolean` | - | +| `options.throwOnMissing?` | `boolean` | - | #### Returns @@ -1198,7 +1198,7 @@ Ensure that dependencies and devDependencies from package.json are installed at For example: ```typescript -ensurePackage(tree, '@nrwl/jest', nxVersion); +ensurePackage(tree, '@nx/jest', nxVersion); ``` #### Type parameters @@ -1251,9 +1251,9 @@ Formats all the created or updated files using Prettier #### Parameters -| Name | Type | Description | -| :----- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | +| Name | Type | Description | +| :----- | :---------------------------------------------- | :------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | #### Returns @@ -1289,12 +1289,12 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | Description | -| :-------------- | :------------------------------------------------ | :-------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `srcFolder` | `string` | the source folder of files (absolute path) | -| `target` | `string` | the target folder (relative to the tree root) | -| `substitutions` | `Object` | an object of key-value pairs | +| Name | Type | Description | +| :-------------- | :---------------------------------------------- | :-------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `srcFolder` | `string` | the source folder of files (absolute path) | +| `target` | `string` | the target folder (relative to the tree root) | +| `substitutions` | `Object` | an object of key-value pairs | #### Returns @@ -1308,19 +1308,19 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | -| :------------- | :---------------------------------------------------------------- | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `name` | `string` | +| Name | Type | +| :------------- | :-------------------------------------------------------------- | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | +| `name` | `string` | #### Returns `Object` -| Name | Type | -| :------------------- | :-------------------------------------------------------------------------- | -| `npmPackages` | `string`[] | -| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#workspacelibrary)[] | +| Name | Type | +| :------------------- | :------------------------------------------------------------------------ | +| `npmPackages` | `string`[] | +| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | --- @@ -1345,7 +1345,7 @@ Prefixes project name with npm scope ### getNpmPackageSharedConfig -▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` +▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) \| `undefined` Build the Module Federation Share Config for a specific package and the specified version of that package. @@ -1359,7 +1359,7 @@ specified version of that package. #### Returns -[`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` +[`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) \| `undefined` --- @@ -1371,10 +1371,10 @@ Returns the list of outputs that will be cached. #### Parameters -| Name | Type | Description | -| :----- | :-------------------------------------------------------------------------------------- | :-------------------------------------------------------- | -| `task` | `Pick`<[`Task`](../../devkit/documents/nrwl_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | -| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | +| Name | Type | Description | +| :----- | :------------------------------------------------------------------------------------ | :-------------------------------------------------------- | +| `task` | `Pick`<[`Task`](../../devkit/documents/nx_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | +| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | #### Returns @@ -1398,9 +1398,9 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`); #### Parameters -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | +| Name | Type | +| :--------------- | :------------------------------------------------------------------ | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | #### Returns @@ -1418,9 +1418,9 @@ but it can also be passed in explicitly. #### Parameters -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | +| Name | Type | +| :--------------- | :------------------------------------------------------------------ | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | #### Returns @@ -1430,21 +1430,21 @@ but it can also be passed in explicitly. ### getProjects -▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> +▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> Get a map of all projects in a workspace. -Use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) if only one project is needed. +Use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) if only one project is needed. #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> +`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> --- @@ -1463,9 +1463,9 @@ Example: #### Parameters -| Name | Type | Description | -| :----- | :------------------------------------------------ | :--------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | +| Name | Type | Description | +| :----- | :---------------------------------------------- | :--------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | file system tree | #### Returns @@ -1490,9 +1490,9 @@ all projects are configured using project.json #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns @@ -1509,12 +1509,12 @@ Runs `npm install` or `yarn install`. It will skip running the install if #### Parameters -| Name | Type | Default value | Description | -| :--------------- | :-------------------------------------------------------------------- | :------------ | :------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | the file system tree | -| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | -| `cwd` | `string` | `''` | - | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | `undefined` | - | +| Name | Type | Default value | Description | +| :--------------- | :------------------------------------------------------------------ | :------------ | :------------------------------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | the file system tree | +| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | +| `cwd` | `string` | `''` | - | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | `undefined` | - | #### Returns @@ -1534,10 +1534,10 @@ non-standalone projects were deprecated #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `project` | `string` | the project name | +| Name | Type | Description | +| :-------- | :---------------------------------------------- | :------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `project` | `string` | the project name | #### Returns @@ -1572,11 +1572,11 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------------------- | :---------------------------------------------------- | :------------------------------------------------------- | +| `remotes` | [`Remotes`](../../devkit/documents/nx_devkit#remotes) | The remotes to map | +| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns @@ -1593,11 +1593,11 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------------------- | :---------------------------------------------------- | :------------------------------------------------------- | +| `remotes` | [`Remotes`](../../devkit/documents/nx_devkit#remotes) | The remotes to map | +| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns @@ -1613,11 +1613,11 @@ Analogous to cp -r oldDir newDir #### Parameters -| Name | Type | -| :------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `oldDir` | `string` | -| `newDir` | `string` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `oldDir` | `string` | +| `newDir` | `string` | #### Returns @@ -1716,10 +1716,10 @@ By default javascript-style comments and trailing commas are allowed. #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :--------------------- | -| `input` | `string` | JSON content as string | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | JSON parse options | +| Name | Type | Description | +| :--------- | :---------------------------------------------------------------------- | :--------------------- | +| `input` | `string` | JSON content as string | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) | JSON parse options | #### Returns @@ -1731,7 +1731,7 @@ Object the JSON content represents ### parseTargetString -▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nrwl_devkit#target) +▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nx_devkit#target) @deprecated(v17) A project graph should be passed to parseTargetString for best accuracy. @@ -1743,9 +1743,9 @@ Object the JSON content represents #### Returns -[`Target`](../../devkit/documents/nrwl_devkit#target) +[`Target`](../../devkit/documents/nx_devkit#target) -▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nrwl_devkit#target) +▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nx_devkit#target) Parses a target string into {project, target, configuration} @@ -1758,20 +1758,20 @@ parseTargetString('proj:test:production', graph); // returns { project: "proj", #### Parameters -| Name | Type | Description | -| :------------- | :---------------------------------------------------------------- | :--------------- | -| `targetString` | `string` | target reference | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | - | +| Name | Type | Description | +| :------------- | :-------------------------------------------------------------- | :--------------- | +| `targetString` | `string` | target reference | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | - | #### Returns -[`Target`](../../devkit/documents/nrwl_devkit#target) +[`Target`](../../devkit/documents/nx_devkit#target) --- ### readAllWorkspaceConfiguration -▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) +▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) **`Deprecated`** @@ -1779,13 +1779,13 @@ Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) #### Returns -[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) +[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) --- ### readCachedProjectGraph -▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) Synchronously reads the latest cached copy of the workspace's ProjectGraph. @@ -1795,7 +1795,7 @@ if there is no cached ProjectGraph to read from #### Returns -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) --- @@ -1813,11 +1813,11 @@ Reads a json file, removes all comments and parses JSON. #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :-------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | -| `path` | `string` | file path | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | Optional JSON Parse Options | +| Name | Type | Description | +| :--------- | :---------------------------------------------------------------------- | :-------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | file system tree | +| `path` | `string` | file path | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) | Optional JSON Parse Options | #### Returns @@ -1854,35 +1854,35 @@ Object the JSON content of the file represents ### readNxJson -▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` **`Deprecated`** -You must pass a [Tree](../../devkit/documents/nrwl_devkit#tree) +You must pass a [Tree](../../devkit/documents/nx_devkit#tree) #### Returns -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` -▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` Reads nx.json #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` --- ### readProjectConfiguration -▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) +▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) Reads a project configuration. @@ -1892,14 +1892,14 @@ If supplied projectName cannot be found #### Parameters -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| Name | Type | Description | +| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | #### Returns -[`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) +[`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) --- @@ -1934,10 +1934,10 @@ Works as if you invoked the target yourself without passing any command lint ove #### Parameters -| Name | Type | -| :--------------- | :---------------------------------------------------------------------- | -| `«destructured»` | [`Target`](../../devkit/documents/nrwl_devkit#target) | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :--------------- | :-------------------------------------------------------------------- | +| `«destructured»` | [`Target`](../../devkit/documents/nx_devkit#target) | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | #### Returns @@ -1947,11 +1947,11 @@ Works as if you invoked the target yourself without passing any command lint ove ### readWorkspaceConfiguration -▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) +▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) Read general workspace configuration such as the default project or cli settings -This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) instead. +This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) instead. **`Deprecated`** @@ -1959,19 +1959,19 @@ use readNxJson #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -[`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) +[`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) --- ### removeDependenciesFromPackageJson -▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Remove Dependencies and Dev Dependencies from package.json @@ -1985,16 +1985,16 @@ This will **remove** `react` and `jest` from the dependencies and devDependencie #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :------------------------------------------------ | :--------------- | :-------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | - | -| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | -| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | - | +| Name | Type | Default value | Description | +| :---------------- | :---------------------------------------------- | :--------------- | :-------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | - | +| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | +| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | - | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary. @@ -2008,10 +2008,10 @@ Removes the configuration of an existing project. #### Parameters -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| Name | Type | Description | +| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | #### Returns @@ -2021,7 +2021,7 @@ Removes the configuration of an existing project. ### reverse -▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) Returns a new project graph where all the edges are reversed. @@ -2030,13 +2030,13 @@ B will depend on A. #### Parameters -| Name | Type | -| :------ | :---------------------------------------------------------------- | -| `graph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `graph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | #### Returns -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) --- @@ -2080,14 +2080,14 @@ Note that the return value is a promise of an iterator, so you need to await bef #### Parameters -| Name | Type | -| :--------------------------------- | :---------------------------------------------------------------------- | -| `targetDescription` | `Object` | -| `targetDescription.configuration?` | `string` | -| `targetDescription.project` | `string` | -| `targetDescription.target` | `string` | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :--------------------------------- | :-------------------------------------------------------------------- | +| `targetDescription` | `Object` | +| `targetDescription.configuration?` | `string` | +| `targetDescription.project` | `string` | +| `targetDescription.target` | `string` | +| `overrides` | `Object` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | #### Returns @@ -2097,19 +2097,19 @@ Note that the return value is a promise of an iterator, so you need to await bef ### runTasksInSerial -▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Run tasks in serial #### Parameters -| Name | Type | Description | -| :--------- | :---------------------------------------------------------------------------- | :-------------------------- | -| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)[] | The tasks to run in serial. | +| Name | Type | Description | +| :--------- | :-------------------------------------------------------------------------- | :-------------------------- | +| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)[] | The tasks to run in serial. | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) --- @@ -2128,10 +2128,10 @@ By default the JSON string is formatted with a 2 space indentation to be easy re #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :---------------------------------------- | -| `input` | `T` | Object which should be serialized to JSON | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | JSON serialize options | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------------------------ | :---------------------------------------- | +| `input` | `T` | Object which should be serialized to JSON | +| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | JSON serialize options | #### Returns @@ -2143,7 +2143,7 @@ the formatted JSON representation of the object ### sharePackages -▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> +▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> Create a dictionary of packages and their Module Federation Shared Config from an array of package names. @@ -2159,27 +2159,27 @@ workspace. #### Returns -`Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> +`Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> --- ### shareWorkspaceLibraries -▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) +▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) Build an object of functions to be used with the ModuleFederationPlugin to share Nx Workspace Libraries between Hosts and Remotes. #### Parameters -| Name | Type | Description | -| :------------- | :-------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | -| `libraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#workspacelibrary)[] | The Nx Workspace Libraries to share | -| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | +| Name | Type | Description | +| :------------- | :------------------------------------------------------------------------ | :--------------------------------------------------------------------------- | +| `libraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | The Nx Workspace Libraries to share | +| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | #### Returns -[`SharedWorkspaceLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) +[`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) --- @@ -2241,9 +2241,9 @@ Returns a string in the format "project:target[:configuration]" for the target #### Parameters -| Name | Type | Description | -| :------- | :---------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `target` | [`Target`](../../devkit/documents/nrwl_devkit#target) | target object Examples: `typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ` | +| Name | Type | Description | +| :------- | :-------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `target` | [`Target`](../../devkit/documents/nx_devkit#target) | target object Examples: `typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ` | #### Returns @@ -2259,9 +2259,9 @@ Rename and transpile any new typescript files created to javascript files #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns @@ -2284,12 +2284,12 @@ Updates a JSON value to the file system tree #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Parse and Serialize Options | +| Name | Type | Description | +| :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | Optional JSON Parse and Serialize Options | #### Returns @@ -2305,10 +2305,10 @@ Update nx.json #### Parameters -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | +| Name | Type | +| :------- | :-------------------------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | #### Returns @@ -2324,11 +2324,11 @@ Updates the configuration of an existing project. #### Parameters -| Name | Type | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | project configuration | +| Name | Type | Description | +| :--------------------- | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) | project configuration | #### Returns @@ -2342,11 +2342,11 @@ Updates the configuration of an existing project. #### Parameters -| Name | Type | -| :-------------------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `options` | `Object` | -| `options.projectRoot` | `string` | +| Name | Type | +| :-------------------- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `options` | `Object` | +| `options.projectRoot` | `string` | #### Returns @@ -2360,7 +2360,7 @@ Updates the configuration of an existing project. Update general workspace configuration such as the default project or cli settings. -This does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) instead. +This does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) instead. **`Deprecated`** @@ -2368,10 +2368,10 @@ use updateNxJson #### Parameters -| Name | Type | -| :---------------- | :------------------------------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) | +| Name | Type | +| :---------------- | :---------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) | #### Returns @@ -2387,11 +2387,11 @@ Utility to act on all files in a tree that are not ignored by git. #### Parameters -| Name | Type | Default value | -| :-------- | :------------------------------------------------ | :------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | -| `dirPath` | `string` | `tree.root` | -| `visitor` | (`path`: `string`) => `void` | `undefined` | +| Name | Type | Default value | +| :-------- | :---------------------------------------------- | :------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | +| `dirPath` | `string` | `tree.root` | +| `visitor` | (`path`: `string`) => `void` | `undefined` | #### Returns @@ -2430,12 +2430,12 @@ Writes a JSON value to the file system tree #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Serialize Options | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------------------------ | :------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `value` | `T` | Serializable value to write | +| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | Optional JSON Serialize Options | #### Returns diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 62ce4287bb0da..302d336a490a7 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -1454,7 +1454,7 @@ }, { "name": "Nx Devkit", - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "id": "packages-devkit", "isExternal": true, "children": [], @@ -1521,7 +1521,7 @@ }, { "name": "Nx Devkit", - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "id": "packages-devkit", "isExternal": true, "children": [], @@ -3048,6 +3048,14 @@ "children": [], "disableCollapsible": false }, + { + "name": "Rescope Packages from @nrwl to @nx", + "path": "/recipes/other/rescope", + "id": "rescope", + "isExternal": false, + "children": [], + "disableCollapsible": false + }, { "name": "Standalone NgRx APIs", "path": "/recipes/other/standalone-ngrx-apis", @@ -3307,6 +3315,14 @@ "children": [], "disableCollapsible": false }, + { + "name": "Rescope Packages from @nrwl to @nx", + "path": "/recipes/other/rescope", + "id": "rescope", + "isExternal": false, + "children": [], + "disableCollapsible": false + }, { "name": "Standalone NgRx APIs", "path": "/recipes/other/standalone-ngrx-apis", @@ -4314,8 +4330,8 @@ "children": [ { "name": "Overview", - "path": "/packages/devkit/documents/nrwl_devkit", - "id": "nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", + "id": "nx_devkit", "isExternal": false, "children": [], "disableCollapsible": false diff --git a/docs/generated/manifests/nx.json b/docs/generated/manifests/nx.json index 1706b81854457..44d4fddd96cb1 100644 --- a/docs/generated/manifests/nx.json +++ b/docs/generated/manifests/nx.json @@ -1814,7 +1814,7 @@ "file": "", "itemList": [], "isExternal": true, - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "tags": ["create-your-own-plugin"] }, { @@ -1892,14 +1892,14 @@ "path": "/packages", "tags": [] }, - "/packages/devkit/documents/nrwl_devkit": { + "/packages/devkit/documents/nx_devkit": { "id": "packages-devkit", "name": "Nx Devkit", "description": "", "file": "", "itemList": [], "isExternal": true, - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "tags": ["create-your-own-plugin"] }, "/reference/glossary": { diff --git a/docs/generated/manifests/packages.json b/docs/generated/manifests/packages.json index 8e755acb2171f..7a2c691edc2bf 100644 --- a/docs/generated/manifests/packages.json +++ b/docs/generated/manifests/packages.json @@ -2,7 +2,7 @@ "angular": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "angular", - "packageName": "@nrwl/angular", + "packageName": "@nx/angular", "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.", "documents": { "/packages/angular/documents/overview": { @@ -396,7 +396,7 @@ "cypress": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "cypress", - "packageName": "@nrwl/cypress", + "packageName": "@nx/cypress", "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.", "documents": { "/packages/cypress/documents/overview": { @@ -498,7 +498,7 @@ "detox": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "detox", - "packageName": "@nrwl/detox", + "packageName": "@nx/detox", "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.", "documents": { "/packages/detox/documents/overview": { @@ -560,19 +560,19 @@ "devkit": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "devkit", - "packageName": "@nrwl/devkit", + "packageName": "@nx/devkit", "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", "documents": { - "/packages/devkit/documents/nrwl_devkit": { - "id": "nrwl_devkit", + "/packages/devkit/documents/nx_devkit": { + "id": "nx_devkit", "name": "Overview", "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", - "file": "generated/packages/devkit/documents/nrwl_devkit", + "file": "generated/packages/devkit/documents/nx_devkit", "itemList": [], "isExternal": false, - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "tags": [], - "originalFilePath": "generated/devkit/nrwl_devkit" + "originalFilePath": "generated/devkit/nx_devkit" }, "/packages/devkit/documents/ngcli_adapter": { "id": "ngcli_adapter", @@ -595,7 +595,7 @@ "esbuild": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "esbuild", - "packageName": "@nrwl/esbuild", + "packageName": "@nx/esbuild", "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild", "documents": { "/packages/esbuild/documents/overview": { @@ -648,7 +648,7 @@ "eslint-plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "eslint-plugin", - "packageName": "@nrwl/eslint-plugin-nx", + "packageName": "@nx/eslint-plugin", "description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.", "documents": { "/packages/eslint-plugin/documents/overview": { @@ -683,7 +683,7 @@ "expo": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "expo", - "packageName": "@nrwl/expo", + "packageName": "@nx/expo", "description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.", "documents": { "/packages/expo/documents/overview": { @@ -844,7 +844,7 @@ "express": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "express", - "packageName": "@nrwl/express", + "packageName": "@nx/express", "description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.", "documents": { "/packages/express/documents/overview": { @@ -887,7 +887,7 @@ "jest": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "jest", - "packageName": "@nrwl/jest", + "packageName": "@nx/jest", "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.", "documents": { "/packages/jest/documents/overview": { @@ -940,7 +940,7 @@ "js": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "js", - "packageName": "@nrwl/js", + "packageName": "@nx/js", "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ", "documents": { "/packages/js/documents/overview": { @@ -1020,7 +1020,7 @@ "linter": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "linter", - "packageName": "@nrwl/linter", + "packageName": "@nx/linter", "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", "documents": { "/packages/linter/documents/overview": { @@ -1073,7 +1073,7 @@ "nest": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nest", - "packageName": "@nrwl/nest", + "packageName": "@nx/nest", "description": "The Nx Plugin for Nest contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.", "documents": { "/packages/nest/documents/overview": { @@ -1269,7 +1269,7 @@ "next": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "next", - "packageName": "@nrwl/next", + "packageName": "@nx/next", "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.", "documents": { "/packages/next/documents/overview": { @@ -1396,7 +1396,7 @@ "node": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "node", - "packageName": "@nrwl/node", + "packageName": "@nx/node", "description": "The Node Plugin for Nx contains generators and executors to manage Node applications within an Nx workspace.", "documents": { "/packages/node/documents/overview": { @@ -1772,7 +1772,7 @@ "plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "plugin", - "packageName": "@nrwl/nx-plugin", + "packageName": "@nx/plugin", "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.", "documents": { "/packages/plugin/documents/overview": { @@ -1879,7 +1879,7 @@ "react": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react", - "packageName": "@nrwl/react", + "packageName": "@nx/react", "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.", "documents": { "/packages/react/documents/overview": { @@ -2067,7 +2067,7 @@ "react-native": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react-native", - "packageName": "@nrwl/react-native", + "packageName": "@nx/react-native", "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.", "documents": { "/packages/react-native/documents/overview": { @@ -2255,7 +2255,7 @@ "rollup": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "rollup", - "packageName": "@nrwl/rollup", + "packageName": "@nx/rollup", "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.", "documents": {}, "root": "/packages/rollup", @@ -2296,7 +2296,7 @@ "storybook": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "storybook", - "packageName": "@nrwl/storybook", + "packageName": "@nx/storybook", "description": "The Nx Plugin for Storybook contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.", "documents": { "/packages/storybook/documents/overview": { @@ -2553,7 +2553,7 @@ "vite": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "vite", - "packageName": "@nrwl/vite", + "packageName": "@nx/vite", "description": "The Nx Plugin for building and testing applications using Vite", "documents": { "/packages/vite/documents/overview": { @@ -2653,7 +2653,7 @@ "web": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "web", - "packageName": "@nrwl/web", + "packageName": "@nx/web", "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.", "documents": { "/packages/web/documents/overview": { @@ -2715,7 +2715,7 @@ "webpack": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "webpack", - "packageName": "@nrwl/webpack", + "packageName": "@nx/webpack", "description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.", "documents": { "/packages/webpack/documents/overview": { @@ -2808,7 +2808,7 @@ "workspace": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "workspace", - "packageName": "@nrwl/workspace", + "packageName": "@nx/workspace", "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.", "documents": { "/packages/workspace/documents/overview": { diff --git a/docs/generated/manifests/recipes.json b/docs/generated/manifests/recipes.json index f3343f87ddd40..bce52fb9f6110 100644 --- a/docs/generated/manifests/recipes.json +++ b/docs/generated/manifests/recipes.json @@ -1587,6 +1587,16 @@ "path": "/recipes/other/identify-dependencies-between-folders", "tags": [] }, + { + "id": "rescope", + "name": "Rescope Packages from @nrwl to @nx", + "description": "", + "file": "shared/recipes/rescope", + "itemList": [], + "isExternal": false, + "path": "/recipes/other/rescope", + "tags": [] + }, { "id": "standalone-ngrx-apis", "name": "Standalone NgRx APIs", @@ -1912,6 +1922,16 @@ "path": "/recipes/other/identify-dependencies-between-folders", "tags": [] }, + "/recipes/other/rescope": { + "id": "rescope", + "name": "Rescope Packages from @nrwl to @nx", + "description": "", + "file": "shared/recipes/rescope", + "itemList": [], + "isExternal": false, + "path": "/recipes/other/rescope", + "tags": [] + }, "/recipes/other/standalone-ngrx-apis": { "id": "standalone-ngrx-apis", "name": "Standalone NgRx APIs", diff --git a/docs/generated/manifests/tags.json b/docs/generated/manifests/tags.json index 38b4ef1cffd44..767b9f6aaab7d 100644 --- a/docs/generated/manifests/tags.json +++ b/docs/generated/manifests/tags.json @@ -620,7 +620,7 @@ "file": "", "id": "packages-devkit", "name": "Nx Devkit", - "path": "/packages/devkit/documents/nrwl_devkit" + "path": "/packages/devkit/documents/nx_devkit" }, { "description": "", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index d36f5f969107d..18a63c5124f0e 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -364,7 +364,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "angular", - "packageName": "@nrwl/angular", + "packageName": "@nx/angular", "root": "/packages/angular", "source": "/packages/angular/src" }, @@ -487,7 +487,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "cypress", - "packageName": "@nrwl/cypress", + "packageName": "@nx/cypress", "root": "/packages/cypress", "source": "/packages/cypress/src" }, @@ -548,7 +548,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "detox", - "packageName": "@nrwl/detox", + "packageName": "@nx/detox", "root": "/packages/detox", "source": "/packages/detox/src" }, @@ -556,15 +556,15 @@ "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", "documents": [ { - "id": "nrwl_devkit", + "id": "nx_devkit", "name": "Overview", "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", - "file": "generated/packages/devkit/documents/nrwl_devkit", + "file": "generated/packages/devkit/documents/nx_devkit", "itemList": [], "isExternal": false, - "path": "devkit/documents/nrwl_devkit", + "path": "devkit/documents/nx_devkit", "tags": [], - "originalFilePath": "generated/devkit/nrwl_devkit" + "originalFilePath": "generated/devkit/nx_devkit" }, { "id": "ngcli_adapter", @@ -582,7 +582,7 @@ "generators": [], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "devkit", - "packageName": "@nrwl/devkit", + "packageName": "@nx/devkit", "root": "/packages/devkit", "source": "/packages/devkit/src" }, @@ -634,7 +634,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "esbuild", - "packageName": "@nrwl/esbuild", + "packageName": "@nx/esbuild", "root": "/packages/esbuild", "source": "/packages/esbuild/src" }, @@ -668,7 +668,7 @@ "generators": [], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "eslint-plugin", - "packageName": "@nrwl/eslint-plugin-nx", + "packageName": "@nx/eslint-plugin", "root": "/packages/eslint-plugin", "source": "/packages/eslint-plugin/src" }, @@ -828,7 +828,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "expo", - "packageName": "@nrwl/expo", + "packageName": "@nx/expo", "root": "/packages/expo", "source": "/packages/expo/src" }, @@ -870,7 +870,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "express", - "packageName": "@nrwl/express", + "packageName": "@nx/express", "root": "/packages/express", "source": "/packages/express/src" }, @@ -922,7 +922,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "jest", - "packageName": "@nrwl/jest", + "packageName": "@nx/jest", "root": "/packages/jest", "source": "/packages/jest/src" }, @@ -1001,7 +1001,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "js", - "packageName": "@nrwl/js", + "packageName": "@nx/js", "root": "/packages/js", "source": "/packages/js/src" }, @@ -1053,7 +1053,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "linter", - "packageName": "@nrwl/linter", + "packageName": "@nx/linter", "root": "/packages/linter", "source": "/packages/linter/src" }, @@ -1248,7 +1248,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nest", - "packageName": "@nrwl/nest", + "packageName": "@nx/nest", "root": "/packages/nest", "source": "/packages/nest/src" }, @@ -1374,7 +1374,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "next", - "packageName": "@nrwl/next", + "packageName": "@nx/next", "root": "/packages/next", "source": "/packages/next/src" }, @@ -1444,7 +1444,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "node", - "packageName": "@nrwl/node", + "packageName": "@nx/node", "root": "/packages/node", "source": "/packages/node/src" }, @@ -1854,7 +1854,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "plugin", - "packageName": "@nrwl/nx-plugin", + "packageName": "@nx/plugin", "root": "/packages/plugin", "source": "/packages/plugin/src" }, @@ -2041,7 +2041,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react", - "packageName": "@nrwl/react", + "packageName": "@nx/react", "root": "/packages/react", "source": "/packages/react/src" }, @@ -2228,7 +2228,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react-native", - "packageName": "@nrwl/react-native", + "packageName": "@nx/react-native", "root": "/packages/react-native", "source": "/packages/react-native/src" }, @@ -2268,7 +2268,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "rollup", - "packageName": "@nrwl/rollup", + "packageName": "@nx/rollup", "root": "/packages/rollup", "source": "/packages/rollup/src" }, @@ -2512,7 +2512,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "storybook", - "packageName": "@nrwl/storybook", + "packageName": "@nx/storybook", "root": "/packages/storybook", "source": "/packages/storybook/src" }, @@ -2622,7 +2622,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "vite", - "packageName": "@nrwl/vite", + "packageName": "@nx/vite", "root": "/packages/vite", "source": "/packages/vite/src" }, @@ -2683,7 +2683,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "web", - "packageName": "@nrwl/web", + "packageName": "@nx/web", "root": "/packages/web", "source": "/packages/web/src" }, @@ -2775,7 +2775,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "webpack", - "packageName": "@nrwl/webpack", + "packageName": "@nx/webpack", "root": "/packages/webpack", "source": "/packages/webpack/src" }, @@ -2901,7 +2901,7 @@ ], "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "workspace", - "packageName": "@nrwl/workspace", + "packageName": "@nx/workspace", "root": "/packages/workspace", "source": "/packages/workspace/src" } diff --git a/docs/generated/packages/angular/documents/overview.md b/docs/generated/packages/angular/documents/overview.md index 278ff1d3354e9..88e1aa4d0e4ab 100644 --- a/docs/generated/packages/angular/documents/overview.md +++ b/docs/generated/packages/angular/documents/overview.md @@ -20,11 +20,11 @@ more [here](/recipes/adopting-nx/migration-angular). Adding the Angular plugin to an existing Nx workspace can be done with the following: ```shell -yarn add -D @nrwl/angular +yarn add -D @nx/angular ``` ```shell -npm install -D @nrwl/angular +npm install -D @nx/angular ``` ## Using the Angular Plugin @@ -34,7 +34,7 @@ npm install -D @nrwl/angular It's straightforward to generate an Angular application: ```shell -nx g @nrwl/angular:app appName +nx g @nx/angular:app appName ``` By default, the application will be generated with: @@ -58,7 +58,7 @@ nx e2e appName Generating an Angular library is very similar to generating an application: ```shell -nx g @nrwl/angular:lib libName +nx g @nx/angular:lib libName ``` By default, the library will be generated with: @@ -81,12 +81,12 @@ Read more about: ### Fallback to `@schematics/angular` -If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on -to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will +If you try to invoke a generator that is not present in `@nx/angular`, the request will automatically be forwarded on +to `@schematics/angular`. So, even though there is no `@nx/angular:service` generator, the following command will successfully create a service: ```shell -nx g @nrwl/angular:service my-service +nx g @nx/angular:service my-service ``` ## More Documentation diff --git a/docs/generated/packages/angular/executors/delegate-build.json b/docs/generated/packages/angular/executors/delegate-build.json index f15df70011d57..065b5deab5422 100644 --- a/docs/generated/packages/angular/executors/delegate-build.json +++ b/docs/generated/packages/angular/executors/delegate-build.json @@ -33,7 +33,7 @@ }, "additionalProperties": false, "required": ["buildTarget", "outputPath", "tsConfig"], - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nrwl/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": false\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Watch for build changes\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nrwl/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nx/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": false\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Watch for build changes\" %}\nDelegate the build of the project to a different target.\n\n```json\n{\n \"prod-build\": {\n \"executor\": \"@nx/angular:delegate-build\",\n \"options\": {\n \"buildTarget\": \"app:build:production\",\n \"outputPath\": \"dist/apps/app/production\",\n \"tsConfig\": \"apps/app/tsconfig.json\",\n \"watch\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Delegates the build to a different target while supporting incremental builds.", diff --git a/docs/generated/packages/angular/executors/module-federation-dev-server.json b/docs/generated/packages/angular/executors/module-federation-dev-server.json index 18fb24395c87f..82305582cd68a 100644 --- a/docs/generated/packages/angular/executors/module-federation-dev-server.json +++ b/docs/generated/packages/angular/executors/module-federation-dev-server.json @@ -116,7 +116,7 @@ }, "additionalProperties": false, "required": ["browserTarget"], - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also. \nSee an example set up of it below:\n\n```json\n{\n \"serve\": {\n \"executor\": \"@nrwl/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\"\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Serve host with remotes that can be live reloaded\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve a set selection with live reloading enabled also. \nSee an example set up of it below:\n\n```json\n{\n \"serve-with-hmr-remotes\": {\n \"executor\": \"@nrwl/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\",\n \"devRemotes\": [\"remote1\", \"remote2\"]\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also. \nSee an example set up of it below:\n\n```json\n{\n \"serve\": {\n \"executor\": \"@nx/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\"\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Serve host with remotes that can be live reloaded\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve a set selection with live reloading enabled also. \nSee an example set up of it below:\n\n```json\n{\n \"serve-with-hmr-remotes\": {\n \"executor\": \"@nx/angular:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"host:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\",\n \"devRemotes\": [\"remote1\", \"remote2\"]\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host.", "aliases": [], diff --git a/docs/generated/packages/angular/executors/webpack-browser.json b/docs/generated/packages/angular/executors/webpack-browser.json index 92cafe962c7ab..1ba7e2a6db2e0 100644 --- a/docs/generated/packages/angular/executors/webpack-browser.json +++ b/docs/generated/packages/angular/executors/webpack-browser.json @@ -7,7 +7,7 @@ "$schema": "http://json-schema.org/draft-07/schema", "title": "Schema for Webpack Browser", "description": "The webpack-browser executor is very similar to the standard browser builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: \n- Supports Custom Webpack Configurations \n- Supports Incremental Building", - "examplesFile": "##### Using a custom webpack configuration\n\nThe executor supports providing a path to a custom webpack configuration. This allows you to customize how your Angular application is built. It currently supports the following types of webpack configurations:\n\n- `object`\n- `Function`\n- `Promise`\n\nThe executor will merge the provided configuration with the webpack configuration that Angular Devkit uses. The merge order is:\n\n- Angular Devkit Configuration\n- Provided Configuration\n\nTo use a custom webpack configuration when building your Angular application, change the `build` target in your `project.json` to match the following:\n\n```typescript\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n}\n```\n\n##### Incrementally Building your Application\n\nThe executor supports incrementally building your Angular application by building the workspace libraries it depends on _(that have been marked as buildable)_ and then building your application using the built source of the libraries.\n\nThis can improve build time as the building of the workspace libraries can be cached, meaning they only have to be rebuilt if they have changed.\n\n> Note: There may be some additional overhead in the linking of the built libraries' sources which may reduce the overall improvement in build time. Therefore this approach only benefits large applications and would likely have a negative impact on small and medium applications. \n> You can read more about when to use incremental builds [here](/more-concepts/incremental-builds#when-should-i-use-incremental-builds).\n\nTo allow your Angular application to take advantage of incremental building, change the `build` target in your `project.json` to match the following:\n\n```typescript\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"buildLibsFromSource\": false\n }\n}\n```\n", + "examplesFile": "##### Using a custom webpack configuration\n\nThe executor supports providing a path to a custom webpack configuration. This allows you to customize how your Angular application is built. It currently supports the following types of webpack configurations:\n\n- `object`\n- `Function`\n- `Promise`\n\nThe executor will merge the provided configuration with the webpack configuration that Angular Devkit uses. The merge order is:\n\n- Angular Devkit Configuration\n- Provided Configuration\n\nTo use a custom webpack configuration when building your Angular application, change the `build` target in your `project.json` to match the following:\n\n```typescript\n\"build\": {\n \"executor\": \"@nx/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n}\n```\n\n##### Incrementally Building your Application\n\nThe executor supports incrementally building your Angular application by building the workspace libraries it depends on _(that have been marked as buildable)_ and then building your application using the built source of the libraries.\n\nThis can improve build time as the building of the workspace libraries can be cached, meaning they only have to be rebuilt if they have changed.\n\n> Note: There may be some additional overhead in the linking of the built libraries' sources which may reduce the overall improvement in build time. Therefore this approach only benefits large applications and would likely have a negative impact on small and medium applications. \n> You can read more about when to use incremental builds [here](/more-concepts/incremental-builds#when-should-i-use-incremental-builds).\n\nTo allow your Angular application to take advantage of incremental building, change the `build` target in your `project.json` to match the following:\n\n```typescript\n\"build\": {\n \"executor\": \"@nx/angular:webpack-browser\",\n \"options\": {\n ...\n \"buildLibsFromSource\": false\n }\n}\n```\n", "type": "object", "presets": [ { diff --git a/docs/generated/packages/angular/executors/webpack-dev-server.json b/docs/generated/packages/angular/executors/webpack-dev-server.json index dc48a9996a0d3..26da9fcb57e61 100644 --- a/docs/generated/packages/angular/executors/webpack-dev-server.json +++ b/docs/generated/packages/angular/executors/webpack-dev-server.json @@ -7,7 +7,7 @@ "$schema": "http://json-schema.org/draft-07/schema", "title": "Schema for Webpack Dev Server", "description": "The webpack-dev-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.", - "examplesFile": "##### Seving an application with a custom webpack configuration\n\nThis executor should be used along with `@nrwl/angular:webpack-browser` to serve an application using a custom webpack configuration.\n\nYour `project.json` file should contain a `build` and `serve` target that matches the following:\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n},\n\"serve\": {\n \"executor\": \"@nrwl/angular:webpack-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"appName:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"appName:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n}\n```\n", + "examplesFile": "##### Seving an application with a custom webpack configuration\n\nThis executor should be used along with `@nx/angular:webpack-browser` to serve an application using a custom webpack configuration.\n\nYour `project.json` file should contain a `build` and `serve` target that matches the following:\n\n```json\n\"build\": {\n \"executor\": \"@nx/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/appName/webpack.config.js\"\n }\n }\n},\n\"serve\": {\n \"executor\": \"@nx/angular:webpack-dev-server\",\n \"configurations\": {\n \"production\": {\n \"browserTarget\": \"appName:build:production\"\n },\n \"development\": {\n \"browserTarget\": \"appName:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n}\n```\n", "type": "object", "presets": [ { "name": "Using a Different Port", "keys": ["browserTarget", "port"] } diff --git a/docs/generated/packages/angular/generators/application.json b/docs/generated/packages/angular/generators/application.json index 549762f8b30d0..2d0813f954715 100644 --- a/docs/generated/packages/angular/generators/application.json +++ b/docs/generated/packages/angular/generators/application.json @@ -165,7 +165,7 @@ }, "additionalProperties": false, "required": ["name"], - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nrwl/angular:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nrwl/angular:app my-app --directory=my-dir --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nrwl/angular:app my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Components application\" %}\n\nCreate an application that is setup to use standalone components:\n\n```bash\nnx g @nrwl/angular:app my-app --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nrwl/angular:app my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nx/angular:app my-app --directory=my-dir --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Components application\" %}\n\nCreate an application that is setup to use standalone components:\n\n```bash\nnx g @nx/angular:app my-app --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "aliases": ["app"], diff --git a/docs/generated/packages/angular/generators/component-cypress-spec.json b/docs/generated/packages/angular/generators/component-cypress-spec.json index 062b67af9afb3..0e77b25dcbfa6 100644 --- a/docs/generated/packages/angular/generators/component-cypress-spec.json +++ b/docs/generated/packages/angular/generators/component-cypress-spec.json @@ -62,7 +62,7 @@ "componentPath", "componentFileName" ], - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\n\nCreate a cypress spec for a component that is set up with Storybook.\n\n```bash\nnx g @nrwl/angular:component-cypress-spec --componentName=MyButtonComponent --componentPath=libs/ui/src/lib/button/button.component.ts --componentFileName=button.component --projectName=ui --projectPath=libs/ui\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\n\nCreate a cypress spec for a component that is set up with Storybook.\n\n```bash\nnx g @nx/angular:component-cypress-spec --componentName=MyButtonComponent --componentPath=libs/ui/src/lib/button/button.component.ts --componentFileName=button.component --projectName=ui --projectPath=libs/ui\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Creates a Cypress spec for a UI component that has a story.", diff --git a/docs/generated/packages/angular/generators/component-test.json b/docs/generated/packages/angular/generators/component-test.json index b673985f5389a..f9734067b1eac 100644 --- a/docs/generated/packages/angular/generators/component-test.json +++ b/docs/generated/packages/angular/generators/component-test.json @@ -51,7 +51,7 @@ "componentDir", "componentFileName" ], - "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nAngular component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you're wanting to create Cypress tests for a Storybook story, then check out the [component-cypress-spec generator docs](/packages/angular/generators/component-cypress-spec)\n\nIf you're wanting to create Storybook stories for a component, then check out the [stories generator docs](/packages/angular/generators/stories) or [component-story generator docs](/packages/angular/generators/component-cypress-spec)\n{% /callout %}\n\nThis generator is used to create a Cypress component test file for a given Angular component.\n\n```shell\nnx g @nrwl/angular:component-test --project=my-cool-angular-project --componentName=CoolBtnComponent --componentDir=src/cool-btn --componentFileName=cool-btn.component\n```\n\nTest file are generated with the `.cy.ts` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project.\n\nIt's currently expected the generated `.cy.ts` file will live side by side with the component. It is also assumed the project is already setup for component testing. If it isn't, then you can run the [cypress-component-project generator](/packages/angular/generators/cypress-component-configuration) to set up the project for component testing.\n", + "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nAngular component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you're wanting to create Cypress tests for a Storybook story, then check out the [component-cypress-spec generator docs](/packages/angular/generators/component-cypress-spec)\n\nIf you're wanting to create Storybook stories for a component, then check out the [stories generator docs](/packages/angular/generators/stories) or [component-story generator docs](/packages/angular/generators/component-cypress-spec)\n{% /callout %}\n\nThis generator is used to create a Cypress component test file for a given Angular component.\n\n```shell\nnx g @nx/angular:component-test --project=my-cool-angular-project --componentName=CoolBtnComponent --componentDir=src/cool-btn --componentFileName=cool-btn.component\n```\n\nTest file are generated with the `.cy.ts` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project.\n\nIt's currently expected the generated `.cy.ts` file will live side by side with the component. It is also assumed the project is already setup for component testing. If it isn't, then you can run the [cypress-component-project generator](/packages/angular/generators/cypress-component-configuration) to set up the project for component testing.\n", "presets": [] }, "description": "Creates a cypress component test file for a component.", diff --git a/docs/generated/packages/angular/generators/component.json b/docs/generated/packages/angular/generators/component.json index 28214facb3d76..1d786ff1a5a8b 100644 --- a/docs/generated/packages/angular/generators/component.json +++ b/docs/generated/packages/angular/generators/component.json @@ -125,7 +125,7 @@ } }, "required": ["name", "project"], - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component`:\n\n```bash\nnx g @nrwl/angular:component my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Component\" %}\n\nCreate a standalone component named `my-component`:\n\n```bash\nnx g @nrwl/angular:component my-component --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nrwl/angular:component my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nrwl/angular:component my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component`:\n\n```bash\nnx g @nx/angular:component my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Component\" %}\n\nCreate a standalone component named `my-component`:\n\n```bash\nnx g @nx/angular:component my-component --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nx/angular:component my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nx/angular:component my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n", "presets": [] }, "aliases": ["c"], diff --git a/docs/generated/packages/angular/generators/cypress-component-configuration.json b/docs/generated/packages/angular/generators/cypress-component-configuration.json index b118115cb596e..e342e31c87162 100644 --- a/docs/generated/packages/angular/generators/cypress-component-configuration.json +++ b/docs/generated/packages/angular/generators/cypress-component-configuration.json @@ -37,7 +37,7 @@ } }, "required": ["project"], - "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nAngular component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/angular/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your Angular project up and running with Cypress Component Testing.\n\n```shell\nnx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/angular/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/angular/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename),\n // extra options here\n },\n});\n```\n\n## Specifying a Build Target\n\nComponent testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-angular-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided.\n\nFor Angular projects, the build target needs to be using the `@nrwl/angular:webpack-browser` or\n`@angular-devkit/build-angular:browser` executor.\nThe generator will throw an error if a build target can't be found and suggest passing one in manually.\n\nLetting Nx infer the build target by default\n\n```shell\nnx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project\n```\n\nManually specifying the build target\n\n```shell\nnx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project --build-target:some-angular-app:build --generate-tests\n```\n\n{% callout type=\"note\" title=\"Build Target with Configuration\" %}\nIf you're wanting to use a build target with a specific configuration. i.e. `my-app:build:production`,\nthen manually providing `--build-target=my-app:build:production` is the best way to do that.\n{% /callout %}\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-angular-project\n```\n\nHere is an example of the project configuration that is generated. The `--build-target` option is added as the `devServerTarget` which can be changed as needed.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"/cypress.config.ts\",\n \"testingType\": \"component\",\n \"devServerTarget\": \"some-angular-app:build\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [React component testing](/packages/angular/generators/cypress-component-configuration).\n", + "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nAngular component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/angular/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your Angular project up and running with Cypress Component Testing.\n\n```shell\nnx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename),\n // extra options here\n },\n});\n```\n\n## Specifying a Build Target\n\nComponent testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-angular-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided.\n\nFor Angular projects, the build target needs to be using the `@nx/angular:webpack-browser` or\n`@angular-devkit/build-angular:browser` executor.\nThe generator will throw an error if a build target can't be found and suggest passing one in manually.\n\nLetting Nx infer the build target by default\n\n```shell\nnx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project\n```\n\nManually specifying the build target\n\n```shell\nnx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --build-target:some-angular-app:build --generate-tests\n```\n\n{% callout type=\"note\" title=\"Build Target with Configuration\" %}\nIf you're wanting to use a build target with a specific configuration. i.e. `my-app:build:production`,\nthen manually providing `--build-target=my-app:build:production` is the best way to do that.\n{% /callout %}\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-angular-project\n```\n\nHere is an example of the project configuration that is generated. The `--build-target` option is added as the `devServerTarget` which can be changed as needed.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"/cypress.config.ts\",\n \"testingType\": \"component\",\n \"devServerTarget\": \"some-angular-app:build\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [React component testing](/packages/angular/generators/cypress-component-configuration).\n", "presets": [] }, "description": "Setup Cypress component testing for a project.", diff --git a/docs/generated/packages/angular/generators/library-secondary-entry-point.json b/docs/generated/packages/angular/generators/library-secondary-entry-point.json index de9f14fc7116f..eaad99de8dd54 100644 --- a/docs/generated/packages/angular/generators/library-secondary-entry-point.json +++ b/docs/generated/packages/angular/generators/library-secondary-entry-point.json @@ -33,7 +33,7 @@ }, "additionalProperties": false, "required": ["name", "library"], - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nCreate a secondary entrypoint named `button` in the `ui` library.\n\n```bash\nnx g @nrwl/angular:library-secondary-entry-point --library=ui --name=button\n```\n\n{% /tab %}\n\n{% tab label=\"Skip generating module\" %}\nCreate a secondary entrypoint named `button` in the `ui` library but skip creating an NgModule.\n\n```bash\nnx g @nrwl/angular:library-secondary-entry-point --library=ui --name=button --skipModule\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nCreate a secondary entrypoint named `button` in the `ui` library.\n\n```bash\nnx g @nx/angular:library-secondary-entry-point --library=ui --name=button\n```\n\n{% /tab %}\n\n{% tab label=\"Skip generating module\" %}\nCreate a secondary entrypoint named `button` in the `ui` library but skip creating an NgModule.\n\n```bash\nnx g @nx/angular:library-secondary-entry-point --library=ui --name=button --skipModule\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "aliases": ["secondary-entry-point", "entry-point"], diff --git a/docs/generated/packages/angular/generators/library.json b/docs/generated/packages/angular/generators/library.json index e0332f642b5b0..d224a8362da6d 100644 --- a/docs/generated/packages/angular/generators/library.json +++ b/docs/generated/packages/angular/generators/library.json @@ -199,7 +199,7 @@ }, "additionalProperties": false, "required": ["name"], - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nrwl/angular:library my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nrwl/angular:library my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nrwl/angular:library my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n```bash\nnx g @nrwl/angular:library --directory=nested --importPath=@myorg/nested/my-lib my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone component\"%}\nCreates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector.\n\n```bash\nnx g @nrwl/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib\n```\n\n{% /tab %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n```bash\nnx g @nx/angular:library --directory=nested --importPath=@myorg/nested/my-lib my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone component\"%}\nCreates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector.\n\n```bash\nnx g @nx/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib\n```\n\n{% /tab %}\n", "presets": [] }, "aliases": ["lib"], diff --git a/docs/generated/packages/angular/generators/ng-add.json b/docs/generated/packages/angular/generators/ng-add.json index 607f6f87d32fd..1a9af69b95dc7 100644 --- a/docs/generated/packages/angular/generators/ng-add.json +++ b/docs/generated/packages/angular/generators/ng-add.json @@ -69,7 +69,7 @@ } }, "additionalProperties": false, - "examplesFile": "## Information\n\nThis generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nrwl/angular`.\n\nYou can read more about [migrating from Angular CLI to Nx here](https://nx.dev/recipes/adopting-nx/migration-angular).\n", + "examplesFile": "## Information\n\nThis generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nx/angular`.\n\nYou can read more about [migrating from Angular CLI to Nx here](https://nx.dev/recipes/adopting-nx/migration-angular).\n", "presets": [] }, "description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace.", diff --git a/docs/generated/packages/angular/generators/scam-to-standalone.json b/docs/generated/packages/angular/generators/scam-to-standalone.json index f77d84c8fff94..1c64ecc99a0d1 100644 --- a/docs/generated/packages/angular/generators/scam-to-standalone.json +++ b/docs/generated/packages/angular/generators/scam-to-standalone.json @@ -28,7 +28,7 @@ "x-priority": "internal" } }, - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\n\nThis generator allows you to convert an Inline SCAM to a Standalone Component. It's important that the SCAM you wish to convert has it's NgModule within the same file for the generator to be able to correctly convert the component to Standalone.\n\n```bash\n\nnx g @nrwl/angular:scam-to-standalone --component=libs/mylib/src/lib/myscam/myscam.component.ts --project=mylib\n\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\n\nThis generator allows you to convert an Inline SCAM to a Standalone Component. It's important that the SCAM you wish to convert has it's NgModule within the same file for the generator to be able to correctly convert the component to Standalone.\n\n```bash\n\nnx g @nx/angular:scam-to-standalone --component=libs/mylib/src/lib/myscam/myscam.component.ts --project=mylib\n\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Convert an existing Single Component Angular Module (SCAM) to a Standalone Component.", diff --git a/docs/generated/packages/angular/generators/setup-tailwind.json b/docs/generated/packages/angular/generators/setup-tailwind.json index 8efbb2de4b47f..0db295b6d9050 100644 --- a/docs/generated/packages/angular/generators/setup-tailwind.json +++ b/docs/generated/packages/angular/generators/setup-tailwind.json @@ -38,7 +38,7 @@ }, "additionalProperties": false, "required": ["project"], - "examplesFile": "## Examples\n\nThe `setup-tailwind` generator can be used to add [Tailwind](https://tailwindcss.com) configuration to apps and publishable libraries.\n\n{% tabs %}\n\n{% tab label=\"Standard Setup\" %}\n\nTo generate a standard Tailwind setup, just run the following command.\n\n```bash\nnx g @nrwl/angular:setup-tailwind myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Specifying the Styles Entrypoint\" %}\n\nTo specify the styles file that should be used as the entrypoint for Tailwind, simply pass the `--stylesEntryPoint` flag, relative to workspace root.\n\n```bash\nnx g @nrwl/angular:setup-tailwind myapp --stylesEntryPoint=apps/myapp/src/styles.css\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\nThe `setup-tailwind` generator can be used to add [Tailwind](https://tailwindcss.com) configuration to apps and publishable libraries.\n\n{% tabs %}\n\n{% tab label=\"Standard Setup\" %}\n\nTo generate a standard Tailwind setup, just run the following command.\n\n```bash\nnx g @nx/angular:setup-tailwind myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Specifying the Styles Entrypoint\" %}\n\nTo specify the styles file that should be used as the entrypoint for Tailwind, simply pass the `--stylesEntryPoint` flag, relative to workspace root.\n\n```bash\nnx g @nx/angular:setup-tailwind myapp --stylesEntryPoint=apps/myapp/src/styles.css\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Configures Tailwind CSS for an application or a buildable/publishable library.", diff --git a/docs/generated/packages/angular/generators/stories.json b/docs/generated/packages/angular/generators/stories.json index 13e22d73b2b42..bd89a9bbee66e 100644 --- a/docs/generated/packages/angular/generators/stories.json +++ b/docs/generated/packages/angular/generators/stories.json @@ -49,7 +49,7 @@ }, "additionalProperties": false, "required": ["name"], - "examplesFile": "This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/).\n\n```bash\nnx g @nrwl/angular:stories project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#auto-generate-stories).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nrwl/angular:stories ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*\n```\n\nThis will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n", + "examplesFile": "This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/).\n\n```bash\nnx g @nx/angular:stories project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#auto-generate-stories).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nx/angular:stories ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*\n```\n\nThis will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n", "presets": [] }, "description": "Creates stories/specs for all components declared in a project.", diff --git a/docs/generated/packages/angular/generators/storybook-configuration.json b/docs/generated/packages/angular/generators/storybook-configuration.json index 134fca072e24a..3cfd079eeaf5f 100644 --- a/docs/generated/packages/angular/generators/storybook-configuration.json +++ b/docs/generated/packages/angular/generators/storybook-configuration.json @@ -94,7 +94,7 @@ }, "additionalProperties": false, "required": ["name"], - "examplesFile": "This generator will set up Storybook for your Angular project.\n\n```bash\nnx g @nrwl/angular:storybook-configuration project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#generate-storybook-configuration-for-an-angular-project).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance. You can read more about this in the [Storybook for Angular - Cypress section](/packages/storybook/documents/overview-angular#cypress-tests-for-stories).\n- Whether you want to `generateStories` for the components in your project. If you choose `yes`, a `.stories.ts` file will be generated next to each of your components in your project.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nrwl/angular:storybook-configuration ui --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nrwl/angular:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts\n```\n\nThis will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate Storybook configuration for Storybook version 7\n\n```bash\nnx g @nrwl/angular:storybook-configuration ui --storybook7Configuration=true\n```\n\n{% callout type=\"info\" title=\"For Nx versions <15.9\" %}\nThe flag is called `storybook7betaConfiguration` for Nx versions <15.9.\n{% /callout %}\n\nThis will generate a Storybook configuration for the `ui` project using Storybook version 7. It will install the Storybook version 7 dependencies and configure the Storybook configuration files (the files inside the `.storybook` directory) to use Storybook version 7. You can read more about Storybook 7 Nx support in the [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n", + "examplesFile": "This generator will set up Storybook for your Angular project.\n\n```bash\nnx g @nx/angular:storybook-configuration project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#generate-storybook-configuration-for-an-angular-project).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance. You can read more about this in the [Storybook for Angular - Cypress section](/packages/storybook/documents/overview-angular#cypress-tests-for-stories).\n- Whether you want to `generateStories` for the components in your project. If you choose `yes`, a `.stories.ts` file will be generated next to each of your components in your project.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nx/angular:storybook-configuration ui --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nx/angular:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts\n```\n\nThis will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate Storybook configuration for Storybook version 7\n\n```bash\nnx g @nx/angular:storybook-configuration ui --storybook7Configuration=true\n```\n\n{% callout type=\"info\" title=\"For Nx versions <15.9\" %}\nThe flag is called `storybook7betaConfiguration` for Nx versions <15.9.\n{% /callout %}\n\nThis will generate a Storybook configuration for the `ui` project using Storybook version 7. It will install the Storybook version 7 dependencies and configure the Storybook configuration files (the files inside the `.storybook` directory) to use Storybook version 7. You can read more about Storybook 7 Nx support in the [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n", "presets": [] }, "description": "Adds Storybook configuration to a project.", diff --git a/docs/generated/packages/angular/generators/web-worker.json b/docs/generated/packages/angular/generators/web-worker.json index 3c6ee9e445832..34551b6f15c26 100644 --- a/docs/generated/packages/angular/generators/web-worker.json +++ b/docs/generated/packages/angular/generators/web-worker.json @@ -42,7 +42,7 @@ }, "additionalProperties": false, "required": ["name", "project"], - "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Simple Usage\" %}\n\nThe basic usage of the `web-worker` generator is defined below. You must provide a name for the web worker and the project to assign it to.\n\n```bash\nnx g @nrwl/angular:web-worker myWebWorker --project=myapp\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Simple Usage\" %}\n\nThe basic usage of the `web-worker` generator is defined below. You must provide a name for the web worker and the project to assign it to.\n\n```bash\nnx g @nx/angular:web-worker myWebWorker --project=myapp\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Creates a Web Worker.", diff --git a/docs/generated/packages/cypress/documents/cypress-component-testing.md b/docs/generated/packages/cypress/documents/cypress-component-testing.md index 89702e0a1c92c..8c3a3b4a75d69 100644 --- a/docs/generated/packages/cypress/documents/cypress-component-testing.md +++ b/docs/generated/packages/cypress/documents/cypress-component-testing.md @@ -8,14 +8,14 @@ directly to a project, like [Jest](/packages/jest) ## Add Component Testing to a Project -> Currently only [@nrwl/react](/packages/react/generators/cypress-component-configuration) and [@nrwl/angular](/packages/angular/generators/cypress-component-configuration) plugins support component testing +> Currently only [@nx/react](/packages/react/generators/cypress-component-configuration) and [@nx/angular](/packages/angular/generators/cypress-component-configuration) plugins support component testing Use the `cypress-component-configuration` generator from the respective plugin to add component testing to a project. ```shell -nx g @nrwl/react:cypress-component-configuration --project=your-project +nx g @nx/react:cypress-component-configuration --project=your-project -nx g @nrwl/angular:cypress-component-configuration --project=your-project +nx g @nx/angular:cypress-component-configuration --project=your-project ``` You can optionally pass in `--generate-tests` to create component tests for all components within the library. @@ -23,15 +23,15 @@ You can optionally pass in `--generate-tests` to create component tests for all Component testing supports both applications and libraries. By default, the generator attempts to find the build target for you based on the project's dependent apps. But you can manually specify the build target to use via the `--build-target` option. Note, in most cases, the build target will be from a different project than the one being configured. The only case where the build targets are from the same project is when the component tests are being added to an application. ```shell -nx g @nrwl/react:cypress-component-configuration --project=your-project --build-target=my-react-app:build +nx g @nx/react:cypress-component-configuration --project=your-project --build-target=my-react-app:build -nx g @nrwl/angular:cypress-component-configuration --project=your-project --build-target=my-ng-app:build +nx g @nx/angular:cypress-component-configuration --project=your-project --build-target=my-ng-app:build ``` The build target option can be changed later via updating the `devServerTarget` option in the `component-test` target. {% callout type="warning" title="Executor Options" %} -When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nrwl/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator. +When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nx/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator. {% /callout %} ## Testing Projects diff --git a/docs/generated/packages/cypress/documents/overview.md b/docs/generated/packages/cypress/documents/overview.md index 85566f8ea40de..472c050b47c62 100644 --- a/docs/generated/packages/cypress/documents/overview.md +++ b/docs/generated/packages/cypress/documents/overview.md @@ -13,14 +13,14 @@ Cypress is a test runner built for the modern web. It has a lot of great feature > > Info about [using Cypress and Storybook can be found here](/packages/storybook/documents/overview-react#cypress-tests-for-storiesbook) -If the `@nrwl/cypress` package is not installed, install the version that matches your `nx` package version. +If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version. ```shell -yarn add --dev @nrwl/cypress +yarn add --dev @nx/cypress ``` ```shell -npm install --save-dev @nrwl/cypress +npm install --save-dev @nx/cypress ``` ## E2E Testing @@ -28,7 +28,7 @@ npm install --save-dev @nrwl/cypress By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project. ```shell -nx g @nrwl/web:app frontend +nx g @nx/web:app frontend ``` ### Creating a Cypress E2E project for an existing project @@ -36,13 +36,13 @@ nx g @nrwl/web:app frontend To generate an E2E project based on an existing project, run the following generator ```shell -nx g @nrwl/cypress:cypress-project your-app-name-e2e --project=your-app-name +nx g @nx/cypress:cypress-project your-app-name-e2e --project=your-app-name ``` Optionally, you can use the `--baseUrl` option if you don't want cypress plugin to serve `your-app-name`. ```shell -nx g @nrwl/cypress:cypress-project your-app-name-e2e --baseUrl=http://localhost:4200 +nx g @nx/cypress:cypress-project your-app-name-e2e --baseUrl=http://localhost:4200 ``` Replace `your-app-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`. @@ -114,7 +114,7 @@ There are a handful of ways to pass environment variables to Cypress, but the mo Create a `cypress.env.json` file in the projects root i.e. `apps/my-cool-app-e2e/cypress.env.json`. Cypress will automatically pick up this file. This method is helpful for configurations that you want to not commit. Just don't forget to add the file to the `.gitignore` and add documentation so people in your repo know what values to popluate in their local copy of the `cypress.env.json` file. -Using [@nrwl/cypress:cypress](/packages/cypress/executors/cypress) env executor option is a good way to add values you want to define that you don't mine commit to the repository, such as a base API url. You can leverage [target configurations](/reference/project-configuration#targets) to define different values as well. +Using [@nx/cypress:cypress](/packages/cypress/executors/cypress) env executor option is a good way to add values you want to define that you don't mine commit to the repository, such as a base API url. You can leverage [target configurations](/reference/project-configuration#targets) to define different values as well. Optionally, you can pass environment variables via the commandline with the `--env` flag. diff --git a/docs/generated/packages/cypress/documents/v11-migration-guide.md b/docs/generated/packages/cypress/documents/v11-migration-guide.md index 74eb9b4802402..a9f5a7f042ffc 100644 --- a/docs/generated/packages/cypress/documents/v11-migration-guide.md +++ b/docs/generated/packages/cypress/documents/v11-migration-guide.md @@ -15,7 +15,7 @@ As of nx v15.1.0, if your project was already using Cypress v10, then your proje {% /callout %} ```shell -nx g @nrwl/cypress:migrate-to-cypress-11 +nx g @nx/cypress:migrate-to-cypress-11 ``` In general, these are the steps taken to migrate your project: diff --git a/docs/generated/packages/cypress/executors/cypress.json b/docs/generated/packages/cypress/executors/cypress.json index aae9e0db56f13..0447d3d6aa7b7 100644 --- a/docs/generated/packages/cypress/executors/cypress.json +++ b/docs/generated/packages/cypress/executors/cypress.json @@ -142,7 +142,7 @@ }, "additionalProperties": true, "required": ["cypressConfig"], - "examplesFile": "Depending on your testing type, the Cypress executor is configured in different ways. The following are sample configurations that are created via the [cypress-project](/packages/cypress/generators/cypress-project) and [cypress-component-project](/packages/cypress/generators/cypress-component-project) generators.\n\n{% tabs %}\n{% tab label=\"E2E Testing\" %}\n\n```json\n\"targets\": {\n \"e2e\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app-e2e/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:serve\",\n \"testingType\": \"e2e\"\n }\n }\n}\n```\n\n{% callout type=\"note\" title=\"API Testing\" %}\nAPI testing with Cypress is the same setup as e2e testing. Just change which `devServerTarget` is used!\n{% /callout %}\n\n### Providing a Base URL\n\nIf `devServerTarget` is provided, the url returned from started the dev server will be passed to cypress as the `baseUrl` option.\n\nDefining a `baseUrl` in the executor options will override the inferred `baseUrl` from the `devServerTarget`.\n\nThe `baseUrl` defined in the Cypress config file is the last value used if no url is found in the `devServerTarget` or executor options.\n\n### Static Serving\n\nWhen running in CI it doesn't make sense to start up a dev server since there aren't changes to watch for.\n\nYou can use [`@nrwl/web:file-server`](/packages/web/executors/file-server) to serve the pre-built static files of your frontend project.\n\nIn some _frontend_ application, add a 'static-serve' target.\n\n```json\n\"serve-static\": {\n \"executor\": \"@nrwl/web:file-server\",\n \"options\":{\n \"buildTarget\": \"frontend:build\"\n }\n}\n```\n\nIn the _e2e_ application add a configuration to change `devServerTarget` to point to the `static-serve` from the _frontend_ application\n\n```json\n\"e2e\": {\n //...\n \"configurations\": {\n \"ci\": {\n \"devServerTarget\": \"frontend:serve-static\"\n }\n }\n}\n```\n\n{% callout type=\"note\" title=\"What about Node projects?\" %}\nThe same can be done for backend node apps with [`@nrwl/js:node` executor](/packages/js/executors/node)\n{% /callout %}\n\n```bash\nnx e2e my-app-e2e --configuration=ci\n```\n\n{% /tab %}\n{% tab label=\"Component Testing\" %}\n\n{% callout type=\"note\" title=\"Cypress Component Testing\" %}\nWhen adding component testing to a project, it's best to use the framework specific generator, instead `cypress-component-project` directly.\n\n- [React component testing](/packages/react/generators/cypress-component-configuration)\n- [Angular component testing](/packages/angular/generators/cypress-component-configuration)\n\n{% /callout %}\n\n```json\n\"targets\": {\n \"component-test\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:build\",\n \"testingType\": \"component\",\n \"skipServe\": true\n }\n }\n}\n```\n\nIt's important `skipServe` is set to true. Nx doesn't need to run the `devServerTarget`, Cypress creates its own dev server for component testing.\nInstead, Nx needs to know what build target to create the correct configuration to pass to Cypress, which is why it's still used in component testing.\n\n{% /tab %}\n{% /tabs %}\n\n### Environment Variables\n\nUsing [executor configurations](/recipe/use-executor-configurations#use-executor-configurations) offers flexibility to set environment variables\n\n```json\n\"targets\": {\n \"e2e\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app-e2e/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:serve\",\n \"testingType\": \"e2e\"\n },\n \"configurations\": {\n \"qa\": {\n \"env\": {\n \"API_URL\": \"https://api.qa.company.com\"\n }\n },\n \"dev\": {\n \"env\": {\n \"API_URL\": \"http://locahost:3333/api\"\n }\n }\n }\n }\n}\n```\n\nRead more on different ways to use [environment variables for cypress executor](/packages/cypress#environment-variables)\n" + "examplesFile": "Depending on your testing type, the Cypress executor is configured in different ways. The following are sample configurations that are created via the [cypress-project](/packages/cypress/generators/cypress-project) and [cypress-component-project](/packages/cypress/generators/cypress-component-project) generators.\n\n{% tabs %}\n{% tab label=\"E2E Testing\" %}\n\n```json\n\"targets\": {\n \"e2e\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app-e2e/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:serve\",\n \"testingType\": \"e2e\"\n }\n }\n}\n```\n\n{% callout type=\"note\" title=\"API Testing\" %}\nAPI testing with Cypress is the same setup as e2e testing. Just change which `devServerTarget` is used!\n{% /callout %}\n\n### Providing a Base URL\n\nIf `devServerTarget` is provided, the url returned from started the dev server will be passed to cypress as the `baseUrl` option.\n\nDefining a `baseUrl` in the executor options will override the inferred `baseUrl` from the `devServerTarget`.\n\nThe `baseUrl` defined in the Cypress config file is the last value used if no url is found in the `devServerTarget` or executor options.\n\n### Static Serving\n\nWhen running in CI it doesn't make sense to start up a dev server since there aren't changes to watch for.\n\nYou can use [`@nx/web:file-server`](/packages/web/executors/file-server) to serve the pre-built static files of your frontend project.\n\nIn some _frontend_ application, add a 'static-serve' target.\n\n```json\n\"serve-static\": {\n \"executor\": \"@nx/web:file-server\",\n \"options\":{\n \"buildTarget\": \"frontend:build\"\n }\n}\n```\n\nIn the _e2e_ application add a configuration to change `devServerTarget` to point to the `static-serve` from the _frontend_ application\n\n```json\n\"e2e\": {\n //...\n \"configurations\": {\n \"ci\": {\n \"devServerTarget\": \"frontend:serve-static\"\n }\n }\n}\n```\n\n{% callout type=\"note\" title=\"What about Node projects?\" %}\nThe same can be done for backend node apps with [`@nx/js:node` executor](/packages/js/executors/node)\n{% /callout %}\n\n```bash\nnx e2e my-app-e2e --configuration=ci\n```\n\n{% /tab %}\n{% tab label=\"Component Testing\" %}\n\n{% callout type=\"note\" title=\"Cypress Component Testing\" %}\nWhen adding component testing to a project, it's best to use the framework specific generator, instead `cypress-component-project` directly.\n\n- [React component testing](/packages/react/generators/cypress-component-configuration)\n- [Angular component testing](/packages/angular/generators/cypress-component-configuration)\n\n{% /callout %}\n\n```json\n\"targets\": {\n \"component-test\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:build\",\n \"testingType\": \"component\",\n \"skipServe\": true\n }\n }\n}\n```\n\nIt's important `skipServe` is set to true. Nx doesn't need to run the `devServerTarget`, Cypress creates its own dev server for component testing.\nInstead, Nx needs to know what build target to create the correct configuration to pass to Cypress, which is why it's still used in component testing.\n\n{% /tab %}\n{% /tabs %}\n\n### Environment Variables\n\nUsing [executor configurations](/recipe/use-executor-configurations#use-executor-configurations) offers flexibility to set environment variables\n\n```json\n\"targets\": {\n \"e2e\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"apps/app-e2e/cypres.config.ts\",\n \"devServerTarget\": \"my-react-app:serve\",\n \"testingType\": \"e2e\"\n },\n \"configurations\": {\n \"qa\": {\n \"env\": {\n \"API_URL\": \"https://api.qa.company.com\"\n }\n },\n \"dev\": {\n \"env\": {\n \"API_URL\": \"http://locahost:3333/api\"\n }\n }\n }\n }\n}\n```\n\nRead more on different ways to use [environment variables for cypress executor](/packages/cypress#environment-variables)\n" }, "description": "Run Cypress E2E tests.", "aliases": [], diff --git a/docs/generated/packages/cypress/generators/cypress-e2e-configuration.json b/docs/generated/packages/cypress/generators/cypress-e2e-configuration.json index 2cefaf1da7b71..c4e9c9375db5d 100644 --- a/docs/generated/packages/cypress/generators/cypress-e2e-configuration.json +++ b/docs/generated/packages/cypress/generators/cypress-e2e-configuration.json @@ -84,7 +84,7 @@ } }, "required": ["project"], - "examplesFile": "This is a generator to add a cypress e2e configuration to an existing project.\n\n```bash\nnx g cypress-e2e-configuration --project=my-cool-project --devServerTarget=some-app:serve\n```\n\nRunning this generator, adds the required files to run cypress tests for a project,\nMainly a `cypress.config.ts` file and default files in the `/cypress/` directory.\nTests will be located in `/cypress/e2e/*` by default.\n\nYou can customize the directory used via the `--directory` flag, the value is relative to the project root.\n\nFor example if you wanted to place the files inside an `e2e` folder\n\n```bash\nnx g cypress-e2e-configuration --project=my-cool-project --devServerTarget=some-app:serve --directory=e2e\n```\n\nProviding a `--devServerTarget` is optional if you provide a `--baseUrl` or the project you're adding the configuration to has a `serve` target already.\nOtherwise, a `--devServerTarget` is recommend for the `@nrwl/cypress:cypress` executor to spin up the dev server for you automatically when needed.\n\n## Feature Based Testing\n\nThis generator helps in creating feature based e2e/integration testing setups where you can place the feature tests in the same project as the feature library.\nThis differs from creating a separate e2e project that contained all tests for an application which can easily cause more tests to run than is strictly necessary.\n\nTake the following workspace where the `feature-cart` project is affected.\n\n{% graph height=\"450px\" %}\n\n```json\n{\n \"projects\": [\n {\n \"type\": \"app\",\n \"name\": \"fancy-app\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"app\",\n \"name\": \"fancy-app-e2e\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-user\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-dashboard\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-cart\",\n \"data\": {\n \"tags\": []\n }\n }\n ],\n \"groupByFolder\": false,\n \"workspaceLayout\": {\n \"appsDir\": \"apps\",\n \"libsDir\": \"libs\"\n },\n \"dependencies\": {\n \"fancy-app\": [\n {\n \"target\": \"feature-user\",\n \"source\": \"fancy-app\",\n \"type\": \"static\"\n },\n {\n \"target\": \"feature-cart\",\n \"source\": \"fancy-app\",\n \"type\": \"static\"\n }\n ],\n \"fancy-app-e2e\": [\n {\n \"target\": \"fancy-app\",\n \"source\": \"fancy-app-e2e\",\n \"type\": \"implicit\"\n }\n ],\n \"feature-user\": [\n {\n \"target\": \"feature-dashboard\",\n \"source\": \"feature-user\",\n \"type\": \"direct\"\n }\n ],\n \"feature-cart\": [],\n \"feature-dashboard\": []\n },\n \"affectedProjectIds\": [\"feature-cart\", \"fancy-app\", \"fancy-app-e2e\"]\n}\n```\n\n{% /graph %}\n\nIn this case, if tests for the all the `feature-*` projects where contained in the `fancy-app-e2e` project, then all of those features will be tested in the app, when only the `feature-cart` tests need to run.\n\nRunning these e2e/integration tests more often than they should results in longer CI times.\n\nBrining those e2e test closer to each feature can result is lowering CI times since we don't need to test those features if they did not change.\n\nBuilding this way leaves the `fancy-app-e2e` for mostly smoke type testing instead of more in-depth feature testing.\n\nUsing the `cypress-e2e-configuration` generator can help you accomplish this in your workspace.\n\n```bash\nnx g cypress-e2e-configuration --project=feature-cart --devServerTarget=fancy-app:serve\nnx g cypress-e2e-configuration --project=feature-user --devServerTarget=fancy-app:serve\nnx g cypress-e2e-configuration --project=feature-dashboard --devServerTarget=fancy-app:serve\n```\n\nEach project will now get their own `e2e` target, where the feature project is only concerned with itself. This allows for more focused tests without worrying about forcing unrelated tests to also run.\n\nIt's important to remember that these feature tests are still going to be leveraging the same app to run the tests against so if you plan to run in parallel, you can leverage using a file server and the ability for `@nrwl/cypress:cypress` executor to pass through a port or find a free port to allow running tests in parallel. Read more [about the --port flag](/packages/cypress/executors/cypress#port)\n", + "examplesFile": "This is a generator to add a cypress e2e configuration to an existing project.\n\n```bash\nnx g cypress-e2e-configuration --project=my-cool-project --devServerTarget=some-app:serve\n```\n\nRunning this generator, adds the required files to run cypress tests for a project,\nMainly a `cypress.config.ts` file and default files in the `/cypress/` directory.\nTests will be located in `/cypress/e2e/*` by default.\n\nYou can customize the directory used via the `--directory` flag, the value is relative to the project root.\n\nFor example if you wanted to place the files inside an `e2e` folder\n\n```bash\nnx g cypress-e2e-configuration --project=my-cool-project --devServerTarget=some-app:serve --directory=e2e\n```\n\nProviding a `--devServerTarget` is optional if you provide a `--baseUrl` or the project you're adding the configuration to has a `serve` target already.\nOtherwise, a `--devServerTarget` is recommend for the `@nx/cypress:cypress` executor to spin up the dev server for you automatically when needed.\n\n## Feature Based Testing\n\nThis generator helps in creating feature based e2e/integration testing setups where you can place the feature tests in the same project as the feature library.\nThis differs from creating a separate e2e project that contained all tests for an application which can easily cause more tests to run than is strictly necessary.\n\nTake the following workspace where the `feature-cart` project is affected.\n\n{% graph height=\"450px\" %}\n\n```json\n{\n \"projects\": [\n {\n \"type\": \"app\",\n \"name\": \"fancy-app\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"app\",\n \"name\": \"fancy-app-e2e\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-user\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-dashboard\",\n \"data\": {\n \"tags\": []\n }\n },\n {\n \"type\": \"lib\",\n \"name\": \"feature-cart\",\n \"data\": {\n \"tags\": []\n }\n }\n ],\n \"groupByFolder\": false,\n \"workspaceLayout\": {\n \"appsDir\": \"apps\",\n \"libsDir\": \"libs\"\n },\n \"dependencies\": {\n \"fancy-app\": [\n {\n \"target\": \"feature-user\",\n \"source\": \"fancy-app\",\n \"type\": \"static\"\n },\n {\n \"target\": \"feature-cart\",\n \"source\": \"fancy-app\",\n \"type\": \"static\"\n }\n ],\n \"fancy-app-e2e\": [\n {\n \"target\": \"fancy-app\",\n \"source\": \"fancy-app-e2e\",\n \"type\": \"implicit\"\n }\n ],\n \"feature-user\": [\n {\n \"target\": \"feature-dashboard\",\n \"source\": \"feature-user\",\n \"type\": \"direct\"\n }\n ],\n \"feature-cart\": [],\n \"feature-dashboard\": []\n },\n \"affectedProjectIds\": [\"feature-cart\", \"fancy-app\", \"fancy-app-e2e\"]\n}\n```\n\n{% /graph %}\n\nIn this case, if tests for the all the `feature-*` projects where contained in the `fancy-app-e2e` project, then all of those features will be tested in the app, when only the `feature-cart` tests need to run.\n\nRunning these e2e/integration tests more often than they should results in longer CI times.\n\nBrining those e2e test closer to each feature can result is lowering CI times since we don't need to test those features if they did not change.\n\nBuilding this way leaves the `fancy-app-e2e` for mostly smoke type testing instead of more in-depth feature testing.\n\nUsing the `cypress-e2e-configuration` generator can help you accomplish this in your workspace.\n\n```bash\nnx g cypress-e2e-configuration --project=feature-cart --devServerTarget=fancy-app:serve\nnx g cypress-e2e-configuration --project=feature-user --devServerTarget=fancy-app:serve\nnx g cypress-e2e-configuration --project=feature-dashboard --devServerTarget=fancy-app:serve\n```\n\nEach project will now get their own `e2e` target, where the feature project is only concerned with itself. This allows for more focused tests without worrying about forcing unrelated tests to also run.\n\nIt's important to remember that these feature tests are still going to be leveraging the same app to run the tests against so if you plan to run in parallel, you can leverage using a file server and the ability for `@nx/cypress:cypress` executor to pass through a port or find a free port to allow running tests in parallel. Read more [about the --port flag](/packages/cypress/executors/cypress#port)\n", "presets": [] }, "description": "Add a Cypress E2E Configuration to an existing project.", diff --git a/docs/generated/packages/cypress/generators/cypress-project.json b/docs/generated/packages/cypress/generators/cypress-project.json index 2664ff37123e8..4db500f46656e 100644 --- a/docs/generated/packages/cypress/generators/cypress-project.json +++ b/docs/generated/packages/cypress/generators/cypress-project.json @@ -73,7 +73,7 @@ } }, "required": ["name"], - "examplesFile": "Adding Cypress to an existing application requires two options. The name of the e2e app to create and what project that e2e app is for.\n\n```bash\nnx g cypress-project --name=my-app-e2e --project=my-app\n```\n\nWhen providing `--project` option, the generator will look for the `serve` target in that given project. This allows the [cypress executor](/packages/cypress/executors/cypress) to spin up the project and start the cypress runner.\n\nIf you prefer to not have the project served automatically, you can provide a `--base-url` argument in place of `--project`\n\n```bash\nnx g cypress-project --name=my-app-e2e --base-url=http://localhost:1234\n```\n\n{% callout type=\"note\" title=\"What about API Projects?\" %}\nYou can also run the `cypress-project` generator against API projects like a [Nest API](/packages/nest/generators/application#@nrwl/nest:application).\nIf there is a URL to visit then you can test it with Cypress!\n{% /callout %}\n\n## Using Cypress with Vite.js\n\nNow, you can generate your Cypress project with Vite.js as the bundler:\n\n```bash\nnx g cypress-project --name=my-app-e2e --project=my-app --bundler=vite\n```\n\nThis generator will pass the `bundler` information (`bundler: 'vite'`) to our `nxE2EPreset`, in your project's `cypress.config.ts` file (eg. `my-app-e2e/cypress.config.ts`).\n\n### Customizing the Vite.js configuration\n\nThe `nxE2EPreset` will then use the `bundler` information to generate the correct settings for your Cypress project to use Vite.js. In the background, the way this works is that it's using a custom Vite preprocessor for your files, that's called on the `file:preprocessor` event. If you want to customize this behaviour, you can do so like this in your project's `cypress.config.ts` file:\n\n```ts\nimport { defineConfig } from 'cypress';\nimport { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';\n\nconst config = nxE2EPreset(__filename, { bundler: 'vite' });\nexport default defineConfig({\n e2e: {\n ...config,\n setupNodeEvents(on, config): {\n config.setupNodeEvents(on);\n // Your settings here\n }\n },\n});\n```\n", + "examplesFile": "Adding Cypress to an existing application requires two options. The name of the e2e app to create and what project that e2e app is for.\n\n```bash\nnx g cypress-project --name=my-app-e2e --project=my-app\n```\n\nWhen providing `--project` option, the generator will look for the `serve` target in that given project. This allows the [cypress executor](/packages/cypress/executors/cypress) to spin up the project and start the cypress runner.\n\nIf you prefer to not have the project served automatically, you can provide a `--base-url` argument in place of `--project`\n\n```bash\nnx g cypress-project --name=my-app-e2e --base-url=http://localhost:1234\n```\n\n{% callout type=\"note\" title=\"What about API Projects?\" %}\nYou can also run the `cypress-project` generator against API projects like a [Nest API](/packages/nest/generators/application#@nx/nest:application).\nIf there is a URL to visit then you can test it with Cypress!\n{% /callout %}\n\n## Using Cypress with Vite.js\n\nNow, you can generate your Cypress project with Vite.js as the bundler:\n\n```bash\nnx g cypress-project --name=my-app-e2e --project=my-app --bundler=vite\n```\n\nThis generator will pass the `bundler` information (`bundler: 'vite'`) to our `nxE2EPreset`, in your project's `cypress.config.ts` file (eg. `my-app-e2e/cypress.config.ts`).\n\n### Customizing the Vite.js configuration\n\nThe `nxE2EPreset` will then use the `bundler` information to generate the correct settings for your Cypress project to use Vite.js. In the background, the way this works is that it's using a custom Vite preprocessor for your files, that's called on the `file:preprocessor` event. If you want to customize this behaviour, you can do so like this in your project's `cypress.config.ts` file:\n\n```ts\nimport { defineConfig } from 'cypress';\nimport { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';\n\nconst config = nxE2EPreset(__filename, { bundler: 'vite' });\nexport default defineConfig({\n e2e: {\n ...config,\n setupNodeEvents(on, config): {\n config.setupNodeEvents(on);\n // Your settings here\n }\n },\n});\n```\n", "presets": [] }, "description": "Add a Cypress E2E Project.", diff --git a/docs/generated/packages/detox/documents/overview.md b/docs/generated/packages/detox/documents/overview.md index 7559a5f798928..816370dee1ac1 100644 --- a/docs/generated/packages/detox/documents/overview.md +++ b/docs/generated/packages/detox/documents/overview.md @@ -28,21 +28,21 @@ npm install -g jest By default, when creating a mobile application, Nx will use Detox to create the e2e tests project. ```shell -nx g @nrwl/react-native:app frontend +nx g @nx/react-native:app frontend ``` ### Creating a Detox E2E project for an existing project You can create a new Detox E2E project for an existing mobile project. -If the `@nrwl/detox` package is not installed, install the version that matches your `@nrwl/workspace` version. +If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version. {% tabs %} {%tab label="npm"%} ```sh # npm -npm install --save-dev @nrwl/detox +npm install --save-dev @nx/detox ``` {% /tab %} @@ -50,7 +50,7 @@ npm install --save-dev @nrwl/detox ```sh # yarn -yarn add --dev @nrwl/detox +yarn add --dev @nx/detox ``` {% /tab %} @@ -59,7 +59,7 @@ yarn add --dev @nrwl/detox Next, generate an E2E project based on an existing project. ```sh -nx g @nrwl/detox:app your-app-name-e2e --project=your-app-name +nx g @nx/detox:app your-app-name-e2e --project=your-app-name ``` Replace `your-app-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`. diff --git a/docs/generated/packages/devkit/documents/ngcli_adapter.md b/docs/generated/packages/devkit/documents/ngcli_adapter.md index 281b0570b0bc9..49bf7022494bd 100644 --- a/docs/generated/packages/devkit/documents/ngcli_adapter.md +++ b/docs/generated/packages/devkit/documents/ngcli_adapter.md @@ -68,12 +68,12 @@ Example: ```typescript overrideCollectionResolutionForTesting({ - '@nrwl/workspace': path.join( + '@nx/workspace': path.join( __dirname, '../../../../workspace/generators.json' ), - '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json'), + '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), + '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), }); ``` @@ -91,7 +91,7 @@ overrideCollectionResolutionForTesting({ ### wrapAngularDevkitSchematic -▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nrwl_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> +▸ **wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/nx_devkit#tree), `generatorOptions`: { `[k: string]`: `any`; }) => `Promise`<`any`\> #### Parameters @@ -108,10 +108,10 @@ overrideCollectionResolutionForTesting({ ##### Parameters -| Name | Type | -| :----------------- | :------------------------------------------------ | -| `host` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `generatorOptions` | `Object` | +| Name | Type | +| :----------------- | :---------------------------------------------- | +| `host` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `generatorOptions` | `Object` | ##### Returns diff --git a/docs/generated/packages/devkit/documents/nrwl_devkit.md b/docs/generated/packages/devkit/documents/nx_devkit.md similarity index 60% rename from docs/generated/packages/devkit/documents/nrwl_devkit.md rename to docs/generated/packages/devkit/documents/nx_devkit.md index ce0df73d52ec0..bb34792585efd 100644 --- a/docs/generated/packages/devkit/documents/nrwl_devkit.md +++ b/docs/generated/packages/devkit/documents/nx_devkit.md @@ -1,4 +1,4 @@ -# Module: @nrwl/devkit +# Module: @nx/devkit The Nx Devkit is the underlying technology used to customize Nx to support different technologies and custom use-cases. It contains many utility @@ -13,152 +13,152 @@ It only uses language primitives and immutable objects ### Enumerations -- [ChangeType](../../devkit/documents/nrwl_devkit#changetype) -- [DependencyType](../../devkit/documents/nrwl_devkit#dependencytype) +- [ChangeType](../../devkit/documents/nx_devkit#changetype) +- [DependencyType](../../devkit/documents/nx_devkit#dependencytype) ### Classes -- [Hasher](../../devkit/documents/nrwl_devkit#hasher) -- [ProjectGraphBuilder](../../devkit/documents/nrwl_devkit#projectgraphbuilder) -- [Workspaces](../../devkit/documents/nrwl_devkit#workspaces) +- [Hasher](../../devkit/documents/nx_devkit#hasher) +- [ProjectGraphBuilder](../../devkit/documents/nx_devkit#projectgraphbuilder) +- [Workspaces](../../devkit/documents/nx_devkit#workspaces) ### Interfaces -- [DefaultTasksRunnerOptions](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) -- [ExecutorContext](../../devkit/documents/nrwl_devkit#executorcontext) -- [ExecutorsJson](../../devkit/documents/nrwl_devkit#executorsjson) -- [FileChange](../../devkit/documents/nrwl_devkit#filechange) -- [FileData](../../devkit/documents/nrwl_devkit#filedata) -- [GeneratorsJson](../../devkit/documents/nrwl_devkit#generatorsjson) -- [Hash](../../devkit/documents/nrwl_devkit#hash) -- [HasherContext](../../devkit/documents/nrwl_devkit#hashercontext) -- [ImplicitJsonSubsetDependency](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency) -- [JsonParseOptions](../../devkit/documents/nrwl_devkit#jsonparseoptions) -- [JsonSerializeOptions](../../devkit/documents/nrwl_devkit#jsonserializeoptions) -- [MigrationsJson](../../devkit/documents/nrwl_devkit#migrationsjson) -- [ModuleFederationConfig](../../devkit/documents/nrwl_devkit#modulefederationconfig) -- [NxAffectedConfig](../../devkit/documents/nrwl_devkit#nxaffectedconfig) -- [NxJsonConfiguration](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) -- [NxPlugin](../../devkit/documents/nrwl_devkit#nxplugin) -- [ProjectConfiguration](../../devkit/documents/nrwl_devkit#projectconfiguration) -- [ProjectFileMap](../../devkit/documents/nrwl_devkit#projectfilemap) -- [ProjectGraph](../../devkit/documents/nrwl_devkit#projectgraph) -- [ProjectGraphDependency](../../devkit/documents/nrwl_devkit#projectgraphdependency) -- [ProjectGraphExternalNode](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) -- [ProjectGraphProcessorContext](../../devkit/documents/nrwl_devkit#projectgraphprocessorcontext) -- [ProjectGraphProjectNode](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) -- [ProjectsConfigurations](../../devkit/documents/nrwl_devkit#projectsconfigurations) -- [RemoteCache](../../devkit/documents/nrwl_devkit#remotecache) -- [SharedLibraryConfig](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) -- [StringDeletion](../../devkit/documents/nrwl_devkit#stringdeletion) -- [StringInsertion](../../devkit/documents/nrwl_devkit#stringinsertion) -- [Target](../../devkit/documents/nrwl_devkit#target) -- [TargetConfiguration](../../devkit/documents/nrwl_devkit#targetconfiguration) -- [TargetDependencyConfig](../../devkit/documents/nrwl_devkit#targetdependencyconfig) -- [Task](../../devkit/documents/nrwl_devkit#task) -- [TaskGraph](../../devkit/documents/nrwl_devkit#taskgraph) -- [Tree](../../devkit/documents/nrwl_devkit#tree) -- [Workspace](../../devkit/documents/nrwl_devkit#workspace) +- [DefaultTasksRunnerOptions](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) +- [ExecutorContext](../../devkit/documents/nx_devkit#executorcontext) +- [ExecutorsJson](../../devkit/documents/nx_devkit#executorsjson) +- [FileChange](../../devkit/documents/nx_devkit#filechange) +- [FileData](../../devkit/documents/nx_devkit#filedata) +- [GeneratorsJson](../../devkit/documents/nx_devkit#generatorsjson) +- [Hash](../../devkit/documents/nx_devkit#hash) +- [HasherContext](../../devkit/documents/nx_devkit#hashercontext) +- [ImplicitJsonSubsetDependency](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency) +- [JsonParseOptions](../../devkit/documents/nx_devkit#jsonparseoptions) +- [JsonSerializeOptions](../../devkit/documents/nx_devkit#jsonserializeoptions) +- [MigrationsJson](../../devkit/documents/nx_devkit#migrationsjson) +- [ModuleFederationConfig](../../devkit/documents/nx_devkit#modulefederationconfig) +- [NxAffectedConfig](../../devkit/documents/nx_devkit#nxaffectedconfig) +- [NxJsonConfiguration](../../devkit/documents/nx_devkit#nxjsonconfiguration) +- [NxPlugin](../../devkit/documents/nx_devkit#nxplugin) +- [ProjectConfiguration](../../devkit/documents/nx_devkit#projectconfiguration) +- [ProjectFileMap](../../devkit/documents/nx_devkit#projectfilemap) +- [ProjectGraph](../../devkit/documents/nx_devkit#projectgraph) +- [ProjectGraphDependency](../../devkit/documents/nx_devkit#projectgraphdependency) +- [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) +- [ProjectGraphProcessorContext](../../devkit/documents/nx_devkit#projectgraphprocessorcontext) +- [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) +- [ProjectsConfigurations](../../devkit/documents/nx_devkit#projectsconfigurations) +- [RemoteCache](../../devkit/documents/nx_devkit#remotecache) +- [SharedLibraryConfig](../../devkit/documents/nx_devkit#sharedlibraryconfig) +- [StringDeletion](../../devkit/documents/nx_devkit#stringdeletion) +- [StringInsertion](../../devkit/documents/nx_devkit#stringinsertion) +- [Target](../../devkit/documents/nx_devkit#target) +- [TargetConfiguration](../../devkit/documents/nx_devkit#targetconfiguration) +- [TargetDependencyConfig](../../devkit/documents/nx_devkit#targetdependencyconfig) +- [Task](../../devkit/documents/nx_devkit#task) +- [TaskGraph](../../devkit/documents/nx_devkit#taskgraph) +- [Tree](../../devkit/documents/nx_devkit#tree) +- [Workspace](../../devkit/documents/nx_devkit#workspace) ### Type Aliases -- [AdditionalSharedConfig](../../devkit/documents/nrwl_devkit#additionalsharedconfig) -- [CustomHasher](../../devkit/documents/nrwl_devkit#customhasher) -- [Executor](../../devkit/documents/nrwl_devkit#executor) -- [Generator](../../devkit/documents/nrwl_devkit#generator) -- [GeneratorCallback](../../devkit/documents/nrwl_devkit#generatorcallback) -- [ImplicitDependencyEntry](../../devkit/documents/nrwl_devkit#implicitdependencyentry) -- [ModuleFederationLibrary](../../devkit/documents/nrwl_devkit#modulefederationlibrary) -- [PackageManager](../../devkit/documents/nrwl_devkit#packagemanager) -- [ProjectGraphNode](../../devkit/documents/nrwl_devkit#projectgraphnode) -- [ProjectTargetConfigurator](../../devkit/documents/nrwl_devkit#projecttargetconfigurator) -- [ProjectType](../../devkit/documents/nrwl_devkit#projecttype) -- [Remotes](../../devkit/documents/nrwl_devkit#remotes) -- [SharedFunction](../../devkit/documents/nrwl_devkit#sharedfunction) -- [SharedWorkspaceLibraryConfig](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) -- [StringChange](../../devkit/documents/nrwl_devkit#stringchange) -- [TaskGraphExecutor](../../devkit/documents/nrwl_devkit#taskgraphexecutor) -- [WorkspaceConfiguration](../../devkit/documents/nrwl_devkit#workspaceconfiguration) -- [WorkspaceJsonConfiguration](../../devkit/documents/nrwl_devkit#workspacejsonconfiguration) -- [WorkspaceLibrary](../../devkit/documents/nrwl_devkit#workspacelibrary) -- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nrwl_devkit#workspacelibrarysecondaryentrypoint) +- [AdditionalSharedConfig](../../devkit/documents/nx_devkit#additionalsharedconfig) +- [CustomHasher](../../devkit/documents/nx_devkit#customhasher) +- [Executor](../../devkit/documents/nx_devkit#executor) +- [Generator](../../devkit/documents/nx_devkit#generator) +- [GeneratorCallback](../../devkit/documents/nx_devkit#generatorcallback) +- [ImplicitDependencyEntry](../../devkit/documents/nx_devkit#implicitdependencyentry) +- [ModuleFederationLibrary](../../devkit/documents/nx_devkit#modulefederationlibrary) +- [PackageManager](../../devkit/documents/nx_devkit#packagemanager) +- [ProjectGraphNode](../../devkit/documents/nx_devkit#projectgraphnode) +- [ProjectTargetConfigurator](../../devkit/documents/nx_devkit#projecttargetconfigurator) +- [ProjectType](../../devkit/documents/nx_devkit#projecttype) +- [Remotes](../../devkit/documents/nx_devkit#remotes) +- [SharedFunction](../../devkit/documents/nx_devkit#sharedfunction) +- [SharedWorkspaceLibraryConfig](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) +- [StringChange](../../devkit/documents/nx_devkit#stringchange) +- [TaskGraphExecutor](../../devkit/documents/nx_devkit#taskgraphexecutor) +- [WorkspaceConfiguration](../../devkit/documents/nx_devkit#workspaceconfiguration) +- [WorkspaceJsonConfiguration](../../devkit/documents/nx_devkit#workspacejsonconfiguration) +- [WorkspaceLibrary](../../devkit/documents/nx_devkit#workspacelibrary) +- [WorkspaceLibrarySecondaryEntryPoint](../../devkit/documents/nx_devkit#workspacelibrarysecondaryentrypoint) ### Variables -- [NX_VERSION](../../devkit/documents/nrwl_devkit#nx_version) -- [appRootPath](../../devkit/documents/nrwl_devkit#approotpath) -- [cacheDir](../../devkit/documents/nrwl_devkit#cachedir) -- [logger](../../devkit/documents/nrwl_devkit#logger) -- [output](../../devkit/documents/nrwl_devkit#output) -- [workspaceRoot](../../devkit/documents/nrwl_devkit#workspaceroot) +- [NX_VERSION](../../devkit/documents/nx_devkit#nx_version) +- [appRootPath](../../devkit/documents/nx_devkit#approotpath) +- [cacheDir](../../devkit/documents/nx_devkit#cachedir) +- [logger](../../devkit/documents/nx_devkit#logger) +- [output](../../devkit/documents/nx_devkit#output) +- [workspaceRoot](../../devkit/documents/nx_devkit#workspaceroot) ### Functions -- [addDependenciesToPackageJson](../../devkit/documents/nrwl_devkit#adddependenciestopackagejson) -- [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) -- [applyAdditionalShared](../../devkit/documents/nrwl_devkit#applyadditionalshared) -- [applyChangesToString](../../devkit/documents/nrwl_devkit#applychangestostring) -- [applySharedFunction](../../devkit/documents/nrwl_devkit#applysharedfunction) -- [convertNxExecutor](../../devkit/documents/nrwl_devkit#convertnxexecutor) -- [convertNxGenerator](../../devkit/documents/nrwl_devkit#convertnxgenerator) -- [createProjectGraphAsync](../../devkit/documents/nrwl_devkit#createprojectgraphasync) -- [defaultTasksRunner](../../devkit/documents/nrwl_devkit#defaulttasksrunner) -- [detectPackageManager](../../devkit/documents/nrwl_devkit#detectpackagemanager) -- [detectWorkspaceScope](../../devkit/documents/nrwl_devkit#detectworkspacescope) -- [ensurePackage](../../devkit/documents/nrwl_devkit#ensurepackage) -- [extractLayoutDirectory](../../devkit/documents/nrwl_devkit#extractlayoutdirectory) -- [formatFiles](../../devkit/documents/nrwl_devkit#formatfiles) -- [generateFiles](../../devkit/documents/nrwl_devkit#generatefiles) -- [getDependentPackagesForProject](../../devkit/documents/nrwl_devkit#getdependentpackagesforproject) -- [getImportPath](../../devkit/documents/nrwl_devkit#getimportpath) -- [getNpmPackageSharedConfig](../../devkit/documents/nrwl_devkit#getnpmpackagesharedconfig) -- [getOutputsForTargetAndConfiguration](../../devkit/documents/nrwl_devkit#getoutputsfortargetandconfiguration) -- [getPackageManagerCommand](../../devkit/documents/nrwl_devkit#getpackagemanagercommand) -- [getPackageManagerVersion](../../devkit/documents/nrwl_devkit#getpackagemanagerversion) -- [getProjects](../../devkit/documents/nrwl_devkit#getprojects) -- [getWorkspaceLayout](../../devkit/documents/nrwl_devkit#getworkspacelayout) -- [getWorkspacePath](../../devkit/documents/nrwl_devkit#getworkspacepath) -- [installPackagesTask](../../devkit/documents/nrwl_devkit#installpackagestask) -- [isStandaloneProject](../../devkit/documents/nrwl_devkit#isstandaloneproject) -- [joinPathFragments](../../devkit/documents/nrwl_devkit#joinpathfragments) -- [mapRemotes](../../devkit/documents/nrwl_devkit#mapremotes) -- [mapRemotesForSSR](../../devkit/documents/nrwl_devkit#mapremotesforssr) -- [moveFilesToNewDirectory](../../devkit/documents/nrwl_devkit#movefilestonewdirectory) -- [names](../../devkit/documents/nrwl_devkit#names) -- [normalizePath](../../devkit/documents/nrwl_devkit#normalizepath) -- [offsetFromRoot](../../devkit/documents/nrwl_devkit#offsetfromroot) -- [parseJson](../../devkit/documents/nrwl_devkit#parsejson) -- [parseTargetString](../../devkit/documents/nrwl_devkit#parsetargetstring) -- [readAllWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readallworkspaceconfiguration) -- [readCachedProjectGraph](../../devkit/documents/nrwl_devkit#readcachedprojectgraph) -- [readJson](../../devkit/documents/nrwl_devkit#readjson) -- [readJsonFile](../../devkit/documents/nrwl_devkit#readjsonfile) -- [readNxJson](../../devkit/documents/nrwl_devkit#readnxjson) -- [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) -- [readRootPackageJson](../../devkit/documents/nrwl_devkit#readrootpackagejson) -- [readTargetOptions](../../devkit/documents/nrwl_devkit#readtargetoptions) -- [readWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#readworkspaceconfiguration) -- [removeDependenciesFromPackageJson](../../devkit/documents/nrwl_devkit#removedependenciesfrompackagejson) -- [removeProjectConfiguration](../../devkit/documents/nrwl_devkit#removeprojectconfiguration) -- [reverse](../../devkit/documents/nrwl_devkit#reverse) -- [runExecutor](../../devkit/documents/nrwl_devkit#runexecutor) -- [runTasksInSerial](../../devkit/documents/nrwl_devkit#runtasksinserial) -- [serializeJson](../../devkit/documents/nrwl_devkit#serializejson) -- [sharePackages](../../devkit/documents/nrwl_devkit#sharepackages) -- [shareWorkspaceLibraries](../../devkit/documents/nrwl_devkit#shareworkspacelibraries) -- [stripIndents](../../devkit/documents/nrwl_devkit#stripindents) -- [stripJsonComments](../../devkit/documents/nrwl_devkit#stripjsoncomments) -- [targetToTargetString](../../devkit/documents/nrwl_devkit#targettotargetstring) -- [toJS](../../devkit/documents/nrwl_devkit#tojs) -- [updateJson](../../devkit/documents/nrwl_devkit#updatejson) -- [updateNxJson](../../devkit/documents/nrwl_devkit#updatenxjson) -- [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) -- [updateTsConfigsToJs](../../devkit/documents/nrwl_devkit#updatetsconfigstojs) -- [updateWorkspaceConfiguration](../../devkit/documents/nrwl_devkit#updateworkspaceconfiguration) -- [visitNotIgnoredFiles](../../devkit/documents/nrwl_devkit#visitnotignoredfiles) -- [workspaceLayout](../../devkit/documents/nrwl_devkit#workspacelayout) -- [writeJson](../../devkit/documents/nrwl_devkit#writejson) -- [writeJsonFile](../../devkit/documents/nrwl_devkit#writejsonfile) +- [addDependenciesToPackageJson](../../devkit/documents/nx_devkit#adddependenciestopackagejson) +- [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) +- [applyAdditionalShared](../../devkit/documents/nx_devkit#applyadditionalshared) +- [applyChangesToString](../../devkit/documents/nx_devkit#applychangestostring) +- [applySharedFunction](../../devkit/documents/nx_devkit#applysharedfunction) +- [convertNxExecutor](../../devkit/documents/nx_devkit#convertnxexecutor) +- [convertNxGenerator](../../devkit/documents/nx_devkit#convertnxgenerator) +- [createProjectGraphAsync](../../devkit/documents/nx_devkit#createprojectgraphasync) +- [defaultTasksRunner](../../devkit/documents/nx_devkit#defaulttasksrunner) +- [detectPackageManager](../../devkit/documents/nx_devkit#detectpackagemanager) +- [detectWorkspaceScope](../../devkit/documents/nx_devkit#detectworkspacescope) +- [ensurePackage](../../devkit/documents/nx_devkit#ensurepackage) +- [extractLayoutDirectory](../../devkit/documents/nx_devkit#extractlayoutdirectory) +- [formatFiles](../../devkit/documents/nx_devkit#formatfiles) +- [generateFiles](../../devkit/documents/nx_devkit#generatefiles) +- [getDependentPackagesForProject](../../devkit/documents/nx_devkit#getdependentpackagesforproject) +- [getImportPath](../../devkit/documents/nx_devkit#getimportpath) +- [getNpmPackageSharedConfig](../../devkit/documents/nx_devkit#getnpmpackagesharedconfig) +- [getOutputsForTargetAndConfiguration](../../devkit/documents/nx_devkit#getoutputsfortargetandconfiguration) +- [getPackageManagerCommand](../../devkit/documents/nx_devkit#getpackagemanagercommand) +- [getPackageManagerVersion](../../devkit/documents/nx_devkit#getpackagemanagerversion) +- [getProjects](../../devkit/documents/nx_devkit#getprojects) +- [getWorkspaceLayout](../../devkit/documents/nx_devkit#getworkspacelayout) +- [getWorkspacePath](../../devkit/documents/nx_devkit#getworkspacepath) +- [installPackagesTask](../../devkit/documents/nx_devkit#installpackagestask) +- [isStandaloneProject](../../devkit/documents/nx_devkit#isstandaloneproject) +- [joinPathFragments](../../devkit/documents/nx_devkit#joinpathfragments) +- [mapRemotes](../../devkit/documents/nx_devkit#mapremotes) +- [mapRemotesForSSR](../../devkit/documents/nx_devkit#mapremotesforssr) +- [moveFilesToNewDirectory](../../devkit/documents/nx_devkit#movefilestonewdirectory) +- [names](../../devkit/documents/nx_devkit#names) +- [normalizePath](../../devkit/documents/nx_devkit#normalizepath) +- [offsetFromRoot](../../devkit/documents/nx_devkit#offsetfromroot) +- [parseJson](../../devkit/documents/nx_devkit#parsejson) +- [parseTargetString](../../devkit/documents/nx_devkit#parsetargetstring) +- [readAllWorkspaceConfiguration](../../devkit/documents/nx_devkit#readallworkspaceconfiguration) +- [readCachedProjectGraph](../../devkit/documents/nx_devkit#readcachedprojectgraph) +- [readJson](../../devkit/documents/nx_devkit#readjson) +- [readJsonFile](../../devkit/documents/nx_devkit#readjsonfile) +- [readNxJson](../../devkit/documents/nx_devkit#readnxjson) +- [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) +- [readRootPackageJson](../../devkit/documents/nx_devkit#readrootpackagejson) +- [readTargetOptions](../../devkit/documents/nx_devkit#readtargetoptions) +- [readWorkspaceConfiguration](../../devkit/documents/nx_devkit#readworkspaceconfiguration) +- [removeDependenciesFromPackageJson](../../devkit/documents/nx_devkit#removedependenciesfrompackagejson) +- [removeProjectConfiguration](../../devkit/documents/nx_devkit#removeprojectconfiguration) +- [reverse](../../devkit/documents/nx_devkit#reverse) +- [runExecutor](../../devkit/documents/nx_devkit#runexecutor) +- [runTasksInSerial](../../devkit/documents/nx_devkit#runtasksinserial) +- [serializeJson](../../devkit/documents/nx_devkit#serializejson) +- [sharePackages](../../devkit/documents/nx_devkit#sharepackages) +- [shareWorkspaceLibraries](../../devkit/documents/nx_devkit#shareworkspacelibraries) +- [stripIndents](../../devkit/documents/nx_devkit#stripindents) +- [stripJsonComments](../../devkit/documents/nx_devkit#stripjsoncomments) +- [targetToTargetString](../../devkit/documents/nx_devkit#targettotargetstring) +- [toJS](../../devkit/documents/nx_devkit#tojs) +- [updateJson](../../devkit/documents/nx_devkit#updatejson) +- [updateNxJson](../../devkit/documents/nx_devkit#updatenxjson) +- [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) +- [updateTsConfigsToJs](../../devkit/documents/nx_devkit#updatetsconfigstojs) +- [updateWorkspaceConfiguration](../../devkit/documents/nx_devkit#updateworkspaceconfiguration) +- [visitNotIgnoredFiles](../../devkit/documents/nx_devkit#visitnotignoredfiles) +- [workspaceLayout](../../devkit/documents/nx_devkit#workspacelayout) +- [writeJson](../../devkit/documents/nx_devkit#writejson) +- [writeJsonFile](../../devkit/documents/nx_devkit#writejsonfile) ## Enumerations @@ -478,34 +478,34 @@ use ProjectsConfigurations or NxJsonConfiguration ### AdditionalSharedConfig -Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) })[] +Ƭ **AdditionalSharedConfig**: (`string` \| [libraryName: string, sharedConfig: SharedLibraryConfig] \| { `libraryName`: `string` ; `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) })[] --- ### CustomHasher -Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nrwl_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +Ƭ **CustomHasher**: (`task`: [`Task`](../../devkit/documents/nx_devkit#task), `context`: [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext)) => `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> #### Type declaration -▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +▸ (`task`, `context`): `Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> ##### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `task` | [`Task`](../../devkit/documents/nrwl_devkit#task) | -| `context` | [`HasherContext`](../../devkit/documents/nrwl_devkit#hashercontext) | +| Name | Type | +| :-------- | :---------------------------------------------------------------- | +| `task` | [`Task`](../../devkit/documents/nx_devkit#task) | +| `context` | [`HasherContext`](../../devkit/documents/nx_devkit#hashercontext) | ##### Returns -`Promise`<[`Hash`](../../devkit/documents/nrwl_devkit#hash)\> +`Promise`<[`Hash`](../../devkit/documents/nx_devkit#hash)\> --- ### Executor -Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> +Ƭ **Executor**<`T`\>: (`options`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<{ `success`: `boolean` }\> \| `AsyncIterableIterator`<{ `success`: `boolean` }\> #### Type parameters @@ -521,10 +521,10 @@ Implementation of a target of a project ##### Parameters -| Name | Type | -| :-------- | :---------------------------------------------------------------------- | -| `options` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :-------- | :-------------------------------------------------------------------- | +| `options` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | ##### Returns @@ -534,7 +534,7 @@ Implementation of a target of a project ### Generator -Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +Ƭ **Generator**<`T`\>: (`tree`: `any`, `schema`: `T`) => `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> #### Type parameters @@ -544,7 +544,7 @@ Implementation of a target of a project #### Type declaration -▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +▸ (`tree`, `schema`): `void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> A function that schedules updates to the filesystem to be done atomically @@ -557,7 +557,7 @@ A function that schedules updates to the filesystem to be done atomically ##### Returns -`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)\> +`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) \| `Promise`<`void` \| [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)\> --- @@ -589,7 +589,7 @@ A callback function that is executed after changes are made to the file system #### Index signature -▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nrwl_devkit#implicitjsonsubsetdependency)<`T`\> +▪ [key: `string`]: `T` \| [`ImplicitJsonSubsetDependency`](../../devkit/documents/nx_devkit#implicitjsonsubsetdependency)<`T`\> --- @@ -614,21 +614,21 @@ A callback function that is executed after changes are made to the file system ### ProjectGraphNode -Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) +Ƭ **ProjectGraphNode**: [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) \| [`ProjectGraphExternalNode`](../../devkit/documents/nx_devkit#projectgraphexternalnode) **`Deprecated`** -this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nrwl_devkit#projectgraphexternalnode) instead +this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/documents/nx_devkit#projectgraphprojectnode) or [ProjectGraphExternalNode](../../devkit/documents/nx_devkit#projectgraphexternalnode) instead --- ### ProjectTargetConfigurator -Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +Ƭ **ProjectTargetConfigurator**: (`file`: `string`) => `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> #### Type declaration -▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +▸ (`file`): `Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> ##### Parameters @@ -638,7 +638,7 @@ this type will be removed in v16. Use [ProjectGraphProjectNode](../../devkit/doc ##### Returns -`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nrwl_devkit#targetconfiguration)\> +`Record`<`string`, [`TargetConfiguration`](../../devkit/documents/nx_devkit#targetconfiguration)\> --- @@ -658,22 +658,22 @@ Type of project supported ### SharedFunction -Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +Ƭ **SharedFunction**: (`libraryName`: `string`, `sharedConfig`: [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)) => `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) #### Type declaration -▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +▸ (`libraryName`, `sharedConfig`): `undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) ##### Parameters -| Name | Type | -| :------------- | :------------------------------------------------------------------------------ | -| `libraryName` | `string` | -| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) | +| Name | Type | +| :------------- | :---------------------------------------------------------------------------- | +| `libraryName` | `string` | +| `sharedConfig` | [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) | ##### Returns -`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) +`undefined` \| `false` \| [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) --- @@ -683,17 +683,17 @@ Type of project supported #### Type declaration -| Name | Type | -| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------- | -| `getAliases` | () => `Record`<`string`, `string`\> | -| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | -| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | +| Name | Type | +| :--------------------- | :-------------------------------------------------------------------------------------------------------------------------- | +| `getAliases` | () => `Record`<`string`, `string`\> | +| `getLibraries` | (`eager?`: `boolean`) => `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | +| `getReplacementPlugin` | () => `NormalModuleReplacementPlugin` | --- ### StringChange -Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nrwl_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nrwl_devkit#stringdeletion) +Ƭ **StringChange**: [`StringInsertion`](../../devkit/documents/nx_devkit#stringinsertion) \| [`StringDeletion`](../../devkit/documents/nx_devkit#stringdeletion) A change to be made to a string @@ -701,7 +701,7 @@ A change to be made to a string ### TaskGraphExecutor -Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext)) => `Promise`<`Record`<`string`, { `success`: `boolean` ; `terminalOutput`: `string` }\>\> +Ƭ **TaskGraphExecutor**<`T`\>: (`taskGraph`: [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph), `options`: `Record`<`string`, `T`\>, `overrides`: `T`, `context`: [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext)) => `Promise`<`Record`<`string`, { `success`: `boolean` ; `terminalOutput`: `string` }\>\> #### Type parameters @@ -717,12 +717,12 @@ Implementation of a target of a project that handles multiple projects to be bat ##### Parameters -| Name | Type | -| :---------- | :---------------------------------------------------------------------- | -| `taskGraph` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | -| `options` | `Record`<`string`, `T`\> | -| `overrides` | `T` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :---------- | :-------------------------------------------------------------------- | +| `taskGraph` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | +| `options` | `Record`<`string`, `T`\> | +| `overrides` | `T` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | ##### Returns @@ -732,7 +732,7 @@ Implementation of a target of a project that handles multiple projects to be bat ### WorkspaceConfiguration -Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)\> +Ƭ **WorkspaceConfiguration**: `Omit`<[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations), `"projects"`\> & `Partial`<[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)\> **`Deprecated`** @@ -742,7 +742,7 @@ using NxJsonConfiguration ### WorkspaceJsonConfiguration -Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) +Ƭ **WorkspaceJsonConfiguration**: [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) **`Deprecated`** @@ -840,7 +840,7 @@ The root of the workspace ### addDependenciesToPackageJson -▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **addDependenciesToPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Add Dependencies and Dev Dependencies to package.json @@ -854,16 +854,16 @@ This will **add** `react` and `jest` to the dependencies and devDependencies sec #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :------------------------------------------------ | :--------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | Tree representing file system to modify | -| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | -| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | +| Name | Type | Default value | Description | +| :---------------- | :---------------------------------------------- | :--------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | Tree representing file system to modify | +| `dependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the dependencies section of package.json | +| `devDependencies` | `Record`<`string`, `string`\> | `undefined` | Dependencies to be added to the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | Path to package.json | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Callback to install dependencies only if necessary, no-op otherwise @@ -877,12 +877,12 @@ Adds project configuration to the Nx workspace. #### Parameters -| Name | Type | Default value | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | the file system tree | -| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | `undefined` | project configuration | -| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | +| Name | Type | Default value | Description | +| :--------------------- | :------------------------------------------------------------------------------ | :------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | the file system tree | +| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) | `undefined` | project configuration | +| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not | #### Returns @@ -903,11 +903,11 @@ hierarchy. #### Parameters -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------------------------------------------------- | :--------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config | -| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nrwl_devkit#additionalsharedconfig) | The additional dependencies to add | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | The Nx project graph | +| Name | Type | Description | +| :----------------- | :------------------------------------------------------------------------------------------------- | :--------------------------------- | +| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | The original Shared Config | +| `additionalShared` | [`AdditionalSharedConfig`](../../devkit/documents/nx_devkit#additionalsharedconfig) | The additional dependencies to add | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | The Nx project graph | #### Returns @@ -951,10 +951,10 @@ bootstrap({ #### Parameters -| Name | Type | -| :-------- | :------------------------------------------------------------------ | -| `text` | `string` | -| `changes` | [`StringChange`](../../devkit/documents/nrwl_devkit#stringchange)[] | +| Name | Type | +| :-------- | :---------------------------------------------------------------- | +| `text` | `string` | +| `changes` | [`StringChange`](../../devkit/documents/nx_devkit#stringchange)[] | #### Returns @@ -971,10 +971,10 @@ of the dependencies for the Module Federation build. #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------------------------------------------------- | :---------------------------------------- | -| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | -| `sharedFn` | [`SharedFunction`](../../devkit/documents/nrwl_devkit#sharedfunction) | The custom function to run | +| Name | Type | Description | +| :------------- | :------------------------------------------------------------------------------------------------- | :---------------------------------------- | +| `sharedConfig` | `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> | The original Shared Config to be modified | +| `sharedFn` | [`SharedFunction`](../../devkit/documents/nx_devkit#sharedfunction) | The custom function to run | #### Returns @@ -992,9 +992,9 @@ Use this to expose a compatible Angular Builder #### Parameters -| Name | Type | -| :--------- | :---------------------------------------------------------------- | -| `executor` | [`Executor`](../../devkit/documents/nrwl_devkit#executor)<`any`\> | +| Name | Type | +| :--------- | :-------------------------------------------------------------- | +| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor)<`any`\> | #### Returns @@ -1016,10 +1016,10 @@ Convert an Nx Generator into an Angular Devkit Schematic. #### Parameters -| Name | Type | Default value | Description | -| :----------------------------- | :---------------------------------------------------------------- | :------------ | :---------------------------------------------------------- | -| `generator` | [`Generator`](../../devkit/documents/nrwl_devkit#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | -| `skipWritingConfigInOldFormat` | `boolean` | `false` | - | +| Name | Type | Default value | Description | +| :----------------------------- | :-------------------------------------------------------------- | :------------ | :---------------------------------------------------------- | +| `generator` | [`Generator`](../../devkit/documents/nx_devkit#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. | +| `skipWritingConfigInOldFormat` | `boolean` | `false` | - | #### Returns @@ -1054,7 +1054,7 @@ Convert an Nx Generator into an Angular Devkit Schematic. ### createProjectGraphAsync -▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> +▸ **createProjectGraphAsync**(`opts?`): `Promise`<[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph)\> Computes and returns a ProjectGraph. @@ -1088,7 +1088,7 @@ stored in the daemon process. To reset both run: `nx reset`. #### Returns -`Promise`<[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph)\> +`Promise`<[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph)\> --- @@ -1101,19 +1101,19 @@ will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. #### Parameters -| Name | Type | -| :--------------------------- | :---------------------------------------------------------------------------------------------------- | -| `tasks` | [`Task`](../../devkit/documents/nrwl_devkit#task)[] | -| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nrwl_devkit#defaulttasksrunneroptions) | -| `context?` | `Object` | -| `context.daemon?` | `DaemonClient` | -| `context.hasher?` | [`Hasher`](../../devkit/documents/nrwl_devkit#hasher) | -| `context.initiatingProject?` | `string` | -| `context.nxArgs` | `NxArgs` | -| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | -| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `context.target?` | `string` | -| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nrwl_devkit#taskgraph) | +| Name | Type | +| :--------------------------- | :-------------------------------------------------------------------------------------------------- | +| `tasks` | [`Task`](../../devkit/documents/nx_devkit#task)[] | +| `options` | [`DefaultTasksRunnerOptions`](../../devkit/documents/nx_devkit#defaulttasksrunneroptions) | +| `context?` | `Object` | +| `context.daemon?` | `DaemonClient` | +| `context.hasher?` | [`Hasher`](../../devkit/documents/nx_devkit#hasher) | +| `context.initiatingProject?` | `string` | +| `context.nxArgs` | `NxArgs` | +| `context.nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | +| `context.projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | +| `context.target?` | `string` | +| `context.taskGraph?` | [`TaskGraph`](../../devkit/documents/nx_devkit#taskgraph) | #### Returns @@ -1123,7 +1123,7 @@ will change to Promise<{ [id: string]: TaskStatus }> after Nx 15 is released. ### detectPackageManager -▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) +▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) Detects which package manager is used in the workspace based on the lock file. @@ -1135,7 +1135,7 @@ Detects which package manager is used in the workspace based on the lock file. #### Returns -[`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) +[`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) --- @@ -1170,22 +1170,22 @@ Use a package that has not been installed as a dependency. For example: ```typescript -ensurePackage(tree, '@nrwl/jest', nxVersion); +ensurePackage(tree, '@nx/jest', nxVersion); ``` -This install the @nrwl/jest@ and return the module +This install the @nx/jest@ and return the module When running with --dryRun, the function will throw when dependencies are missing. #### Parameters -| Name | Type | Description | -| :------------------------ | :------------------------------------------------ | :----------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `pkg` | `string` | the package to check (e.g. @nrwl/jest) | -| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) | -| `options?` | `Object` | - | -| `options.dev?` | `boolean` | - | -| `options.throwOnMissing?` | `boolean` | - | +| Name | Type | Description | +| :------------------------ | :---------------------------------------------- | :----------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `pkg` | `string` | the package to check (e.g. @nx/jest) | +| `requiredVersion` | `string` | the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) | +| `options?` | `Object` | - | +| `options.dev?` | `boolean` | - | +| `options.throwOnMissing?` | `boolean` | - | #### Returns @@ -1198,7 +1198,7 @@ Ensure that dependencies and devDependencies from package.json are installed at For example: ```typescript -ensurePackage(tree, '@nrwl/jest', nxVersion); +ensurePackage(tree, '@nx/jest', nxVersion); ``` #### Type parameters @@ -1251,9 +1251,9 @@ Formats all the created or updated files using Prettier #### Parameters -| Name | Type | Description | -| :----- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | +| Name | Type | Description | +| :----- | :---------------------------------------------- | :------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | #### Returns @@ -1289,12 +1289,12 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | Description | -| :-------------- | :------------------------------------------------ | :-------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `srcFolder` | `string` | the source folder of files (absolute path) | -| `target` | `string` | the target folder (relative to the tree root) | -| `substitutions` | `Object` | an object of key-value pairs | +| Name | Type | Description | +| :-------------- | :---------------------------------------------- | :-------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `srcFolder` | `string` | the source folder of files (absolute path) | +| `target` | `string` | the target folder (relative to the tree root) | +| `substitutions` | `Object` | an object of key-value pairs | #### Returns @@ -1308,19 +1308,19 @@ doesn't get confused about incorrect TypeScript files. #### Parameters -| Name | Type | -| :------------- | :---------------------------------------------------------------- | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | -| `name` | `string` | +| Name | Type | +| :------------- | :-------------------------------------------------------------- | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | +| `name` | `string` | #### Returns `Object` -| Name | Type | -| :------------------- | :-------------------------------------------------------------------------- | -| `npmPackages` | `string`[] | -| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#workspacelibrary)[] | +| Name | Type | +| :------------------- | :------------------------------------------------------------------------ | +| `npmPackages` | `string`[] | +| `workspaceLibraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | --- @@ -1345,7 +1345,7 @@ Prefixes project name with npm scope ### getNpmPackageSharedConfig -▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` +▸ **getNpmPackageSharedConfig**(`pkgName`, `version`): [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) \| `undefined` Build the Module Federation Share Config for a specific package and the specified version of that package. @@ -1359,7 +1359,7 @@ specified version of that package. #### Returns -[`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig) \| `undefined` +[`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig) \| `undefined` --- @@ -1371,10 +1371,10 @@ Returns the list of outputs that will be cached. #### Parameters -| Name | Type | Description | -| :----- | :-------------------------------------------------------------------------------------- | :-------------------------------------------------------- | -| `task` | `Pick`<[`Task`](../../devkit/documents/nrwl_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | -| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nrwl_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | +| Name | Type | Description | +| :----- | :------------------------------------------------------------------------------------ | :-------------------------------------------------------- | +| `task` | `Pick`<[`Task`](../../devkit/documents/nx_devkit#task), `"overrides"` \| `"target"`\> | target + overrides | +| `node` | [`ProjectGraphProjectNode`](../../devkit/documents/nx_devkit#projectgraphprojectnode) | ProjectGraphProjectNode object that the task runs against | #### Returns @@ -1398,9 +1398,9 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`); #### Parameters -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | +| Name | Type | +| :--------------- | :------------------------------------------------------------------ | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | #### Returns @@ -1418,9 +1418,9 @@ but it can also be passed in explicitly. #### Parameters -| Name | Type | -| :--------------- | :-------------------------------------------------------------------- | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | +| Name | Type | +| :--------------- | :------------------------------------------------------------------ | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | #### Returns @@ -1430,21 +1430,21 @@ but it can also be passed in explicitly. ### getProjects -▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> +▸ **getProjects**(`tree`): `Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> Get a map of all projects in a workspace. -Use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) if only one project is needed. +Use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) if only one project is needed. #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration)\> +`Map`<`string`, [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration)\> --- @@ -1463,9 +1463,9 @@ Example: #### Parameters -| Name | Type | Description | -| :----- | :------------------------------------------------ | :--------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | +| Name | Type | Description | +| :----- | :---------------------------------------------- | :--------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | file system tree | #### Returns @@ -1490,9 +1490,9 @@ all projects are configured using project.json #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns @@ -1509,12 +1509,12 @@ Runs `npm install` or `yarn install`. It will skip running the install if #### Parameters -| Name | Type | Default value | Description | -| :--------------- | :-------------------------------------------------------------------- | :------------ | :------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | the file system tree | -| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | -| `cwd` | `string` | `''` | - | -| `packageManager` | [`PackageManager`](../../devkit/documents/nrwl_devkit#packagemanager) | `undefined` | - | +| Name | Type | Default value | Description | +| :--------------- | :------------------------------------------------------------------ | :------------ | :------------------------------------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | the file system tree | +| `alwaysRun` | `boolean` | `false` | always run the command even if `package.json` hasn't changed. | +| `cwd` | `string` | `''` | - | +| `packageManager` | [`PackageManager`](../../devkit/documents/nx_devkit#packagemanager) | `undefined` | - | #### Returns @@ -1534,10 +1534,10 @@ non-standalone projects were deprecated #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------------ | :------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `project` | `string` | the project name | +| Name | Type | Description | +| :-------- | :---------------------------------------------- | :------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `project` | `string` | the project name | #### Returns @@ -1572,11 +1572,11 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------------------- | :---------------------------------------------------- | :------------------------------------------------------- | +| `remotes` | [`Remotes`](../../devkit/documents/nx_devkit#remotes) | The remotes to map | +| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns @@ -1593,11 +1593,11 @@ Federation. #### Parameters -| Name | Type | Description | -| :------------------- | :------------------------------------------------------ | :------------------------------------------------------- | -| `remotes` | [`Remotes`](../../devkit/documents/nrwl_devkit#remotes) | The remotes to map | -| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | -| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | +| Name | Type | Description | +| :------------------- | :---------------------------------------------------- | :------------------------------------------------------- | +| `remotes` | [`Remotes`](../../devkit/documents/nx_devkit#remotes) | The remotes to map | +| `remoteEntryExt` | `"js"` \| `"mjs"` | The file extension of the remoteEntry file | +| `determineRemoteUrl` | (`remote`: `string`) => `string` | The function used to lookup the URL of the served remote | #### Returns @@ -1613,11 +1613,11 @@ Analogous to cp -r oldDir newDir #### Parameters -| Name | Type | -| :------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `oldDir` | `string` | -| `newDir` | `string` | +| Name | Type | +| :------- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `oldDir` | `string` | +| `newDir` | `string` | #### Returns @@ -1716,10 +1716,10 @@ By default javascript-style comments and trailing commas are allowed. #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :--------------------- | -| `input` | `string` | JSON content as string | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | JSON parse options | +| Name | Type | Description | +| :--------- | :---------------------------------------------------------------------- | :--------------------- | +| `input` | `string` | JSON content as string | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) | JSON parse options | #### Returns @@ -1731,7 +1731,7 @@ Object the JSON content represents ### parseTargetString -▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nrwl_devkit#target) +▸ **parseTargetString**(`targetString`): [`Target`](../../devkit/documents/nx_devkit#target) @deprecated(v17) A project graph should be passed to parseTargetString for best accuracy. @@ -1743,9 +1743,9 @@ Object the JSON content represents #### Returns -[`Target`](../../devkit/documents/nrwl_devkit#target) +[`Target`](../../devkit/documents/nx_devkit#target) -▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nrwl_devkit#target) +▸ **parseTargetString**(`targetString`, `projectGraph`): [`Target`](../../devkit/documents/nx_devkit#target) Parses a target string into {project, target, configuration} @@ -1758,20 +1758,20 @@ parseTargetString('proj:test:production', graph); // returns { project: "proj", #### Parameters -| Name | Type | Description | -| :------------- | :---------------------------------------------------------------- | :--------------- | -| `targetString` | `string` | target reference | -| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | - | +| Name | Type | Description | +| :------------- | :-------------------------------------------------------------- | :--------------- | +| `targetString` | `string` | target reference | +| `projectGraph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | - | #### Returns -[`Target`](../../devkit/documents/nrwl_devkit#target) +[`Target`](../../devkit/documents/nx_devkit#target) --- ### readAllWorkspaceConfiguration -▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) +▸ **readAllWorkspaceConfiguration**(): [`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) **`Deprecated`** @@ -1779,13 +1779,13 @@ Use readProjectsConfigurationFromProjectGraph(await createProjectGraphAsync()) #### Returns -[`ProjectsConfigurations`](../../devkit/documents/nrwl_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) +[`ProjectsConfigurations`](../../devkit/documents/nx_devkit#projectsconfigurations) & [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) --- ### readCachedProjectGraph -▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +▸ **readCachedProjectGraph**(): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) Synchronously reads the latest cached copy of the workspace's ProjectGraph. @@ -1795,7 +1795,7 @@ if there is no cached ProjectGraph to read from #### Returns -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) --- @@ -1813,11 +1813,11 @@ Reads a json file, removes all comments and parses JSON. #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------ | :-------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | file system tree | -| `path` | `string` | file path | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) | Optional JSON Parse Options | +| Name | Type | Description | +| :--------- | :---------------------------------------------------------------------- | :-------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | file system tree | +| `path` | `string` | file path | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) | Optional JSON Parse Options | #### Returns @@ -1854,35 +1854,35 @@ Object the JSON content of the file represents ### readNxJson -▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +▸ **readNxJson**(): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` **`Deprecated`** -You must pass a [Tree](../../devkit/documents/nrwl_devkit#tree) +You must pass a [Tree](../../devkit/documents/nx_devkit#tree) #### Returns -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` -▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +▸ **readNxJson**(`tree`): [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` Reads nx.json #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -[`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration) \| `null` +[`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration) \| `null` --- ### readProjectConfiguration -▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) +▸ **readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) Reads a project configuration. @@ -1892,14 +1892,14 @@ If supplied projectName cannot be found #### Parameters -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| Name | Type | Description | +| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | #### Returns -[`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) +[`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) --- @@ -1934,10 +1934,10 @@ Works as if you invoked the target yourself without passing any command lint ove #### Parameters -| Name | Type | -| :--------------- | :---------------------------------------------------------------------- | -| `«destructured»` | [`Target`](../../devkit/documents/nrwl_devkit#target) | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :--------------- | :-------------------------------------------------------------------- | +| `«destructured»` | [`Target`](../../devkit/documents/nx_devkit#target) | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | #### Returns @@ -1947,11 +1947,11 @@ Works as if you invoked the target yourself without passing any command lint ove ### readWorkspaceConfiguration -▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) +▸ **readWorkspaceConfiguration**(`tree`): [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) Read general workspace configuration such as the default project or cli settings -This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nrwl_devkit#readprojectconfiguration) instead. +This does _not_ provide projects configuration, use [readProjectConfiguration](../../devkit/documents/nx_devkit#readprojectconfiguration) instead. **`Deprecated`** @@ -1959,19 +1959,19 @@ use readNxJson #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns -[`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) +[`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) --- ### removeDependenciesFromPackageJson -▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **removeDependenciesFromPackageJson**(`tree`, `dependencies`, `devDependencies`, `packageJsonPath?`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Remove Dependencies and Dev Dependencies from package.json @@ -1985,16 +1985,16 @@ This will **remove** `react` and `jest` from the dependencies and devDependencie #### Parameters -| Name | Type | Default value | Description | -| :---------------- | :------------------------------------------------ | :--------------- | :-------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | - | -| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | -| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | -| `packageJsonPath` | `string` | `'package.json'` | - | +| Name | Type | Default value | Description | +| :---------------- | :---------------------------------------------- | :--------------- | :-------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | - | +| `dependencies` | `string`[] | `undefined` | Dependencies to be removed from the dependencies section of package.json | +| `devDependencies` | `string`[] | `undefined` | Dependencies to be removed from the devDependencies section of package.json | +| `packageJsonPath` | `string` | `'package.json'` | - | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary. @@ -2008,10 +2008,10 @@ Removes the configuration of an existing project. #### Parameters -| Name | Type | Description | -| :------------ | :------------------------------------------------ | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| Name | Type | Description | +| :------------ | :---------------------------------------------- | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | #### Returns @@ -2021,7 +2021,7 @@ Removes the configuration of an existing project. ### reverse -▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +▸ **reverse**(`graph`): [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) Returns a new project graph where all the edges are reversed. @@ -2030,13 +2030,13 @@ B will depend on A. #### Parameters -| Name | Type | -| :------ | :---------------------------------------------------------------- | -| `graph` | [`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) | +| Name | Type | +| :------ | :-------------------------------------------------------------- | +| `graph` | [`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) | #### Returns -[`ProjectGraph`](../../devkit/documents/nrwl_devkit#projectgraph) +[`ProjectGraph`](../../devkit/documents/nx_devkit#projectgraph) --- @@ -2080,14 +2080,14 @@ Note that the return value is a promise of an iterator, so you need to await bef #### Parameters -| Name | Type | -| :--------------------------------- | :---------------------------------------------------------------------- | -| `targetDescription` | `Object` | -| `targetDescription.configuration?` | `string` | -| `targetDescription.project` | `string` | -| `targetDescription.target` | `string` | -| `overrides` | `Object` | -| `context` | [`ExecutorContext`](../../devkit/documents/nrwl_devkit#executorcontext) | +| Name | Type | +| :--------------------------------- | :-------------------------------------------------------------------- | +| `targetDescription` | `Object` | +| `targetDescription.configuration?` | `string` | +| `targetDescription.project` | `string` | +| `targetDescription.target` | `string` | +| `overrides` | `Object` | +| `context` | [`ExecutorContext`](../../devkit/documents/nx_devkit#executorcontext) | #### Returns @@ -2097,19 +2097,19 @@ Note that the return value is a promise of an iterator, so you need to await bef ### runTasksInSerial -▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +▸ **runTasksInSerial**(`...tasks`): [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) Run tasks in serial #### Parameters -| Name | Type | Description | -| :--------- | :---------------------------------------------------------------------------- | :-------------------------- | -| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback)[] | The tasks to run in serial. | +| Name | Type | Description | +| :--------- | :-------------------------------------------------------------------------- | :-------------------------- | +| `...tasks` | [`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback)[] | The tasks to run in serial. | #### Returns -[`GeneratorCallback`](../../devkit/documents/nrwl_devkit#generatorcallback) +[`GeneratorCallback`](../../devkit/documents/nx_devkit#generatorcallback) --- @@ -2128,10 +2128,10 @@ By default the JSON string is formatted with a 2 space indentation to be easy re #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :---------------------------------------- | -| `input` | `T` | Object which should be serialized to JSON | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | JSON serialize options | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------------------------ | :---------------------------------------- | +| `input` | `T` | Object which should be serialized to JSON | +| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | JSON serialize options | #### Returns @@ -2143,7 +2143,7 @@ the formatted JSON representation of the object ### sharePackages -▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> +▸ **sharePackages**(`packages`): `Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> Create a dictionary of packages and their Module Federation Shared Config from an array of package names. @@ -2159,27 +2159,27 @@ workspace. #### Returns -`Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedlibraryconfig)\> +`Record`<`string`, [`SharedLibraryConfig`](../../devkit/documents/nx_devkit#sharedlibraryconfig)\> --- ### shareWorkspaceLibraries -▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) +▸ **shareWorkspaceLibraries**(`libraries`, `tsConfigPath?`): [`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) Build an object of functions to be used with the ModuleFederationPlugin to share Nx Workspace Libraries between Hosts and Remotes. #### Parameters -| Name | Type | Description | -| :------------- | :-------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | -| `libraries` | [`WorkspaceLibrary`](../../devkit/documents/nrwl_devkit#workspacelibrary)[] | The Nx Workspace Libraries to share | -| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | +| Name | Type | Description | +| :------------- | :------------------------------------------------------------------------ | :--------------------------------------------------------------------------- | +| `libraries` | [`WorkspaceLibrary`](../../devkit/documents/nx_devkit#workspacelibrary)[] | The Nx Workspace Libraries to share | +| `tsConfigPath` | `string` | The path to TS Config File that contains the Path Mappings for the Libraries | #### Returns -[`SharedWorkspaceLibraryConfig`](../../devkit/documents/nrwl_devkit#sharedworkspacelibraryconfig) +[`SharedWorkspaceLibraryConfig`](../../devkit/documents/nx_devkit#sharedworkspacelibraryconfig) --- @@ -2241,9 +2241,9 @@ Returns a string in the format "project:target[:configuration]" for the target #### Parameters -| Name | Type | Description | -| :------- | :---------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `target` | [`Target`](../../devkit/documents/nrwl_devkit#target) | target object Examples: `typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ` | +| Name | Type | Description | +| :------- | :-------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `target` | [`Target`](../../devkit/documents/nx_devkit#target) | target object Examples: `typescript targetToTargetString({ project: "proj", target: "test" }) // returns "proj:test" targetToTargetString({ project: "proj", target: "test", configuration: "production" }) // returns "proj:test:production" ` | #### Returns @@ -2259,9 +2259,9 @@ Rename and transpile any new typescript files created to javascript files #### Parameters -| Name | Type | -| :----- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | +| Name | Type | +| :----- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | #### Returns @@ -2284,12 +2284,12 @@ Updates a JSON value to the file system tree #### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | -| `options?` | [`JsonParseOptions`](../../devkit/documents/nrwl_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Parse and Serialize Options | +| Name | Type | Description | +| :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `updater` | (`value`: `T`) => `U` | Function that maps the current value of a JSON document to a new value to be written to the document | +| `options?` | [`JsonParseOptions`](../../devkit/documents/nx_devkit#jsonparseoptions) & [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | Optional JSON Parse and Serialize Options | #### Returns @@ -2305,10 +2305,10 @@ Update nx.json #### Parameters -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nrwl_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | +| Name | Type | +| :------- | :-------------------------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `nxJson` | [`NxJsonConfiguration`](../../devkit/documents/nx_devkit#nxjsonconfiguration)<`string`[] \| `"*"`\> | #### Returns @@ -2324,11 +2324,11 @@ Updates the configuration of an existing project. #### Parameters -| Name | Type | Description | -| :--------------------- | :-------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | the file system tree | -| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | -| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nrwl_devkit#projectconfiguration) | project configuration | +| Name | Type | Description | +| :--------------------- | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | the file system tree | +| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) | +| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/nx_devkit#projectconfiguration) | project configuration | #### Returns @@ -2342,11 +2342,11 @@ Updates the configuration of an existing project. #### Parameters -| Name | Type | -| :-------------------- | :------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `options` | `Object` | -| `options.projectRoot` | `string` | +| Name | Type | +| :-------------------- | :---------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `options` | `Object` | +| `options.projectRoot` | `string` | #### Returns @@ -2360,7 +2360,7 @@ Updates the configuration of an existing project. Update general workspace configuration such as the default project or cli settings. -This does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/documents/nrwl_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nrwl_devkit#addprojectconfiguration) instead. +This does _not_ update projects configuration, use [updateProjectConfiguration](../../devkit/documents/nx_devkit#updateprojectconfiguration) or [addProjectConfiguration](../../devkit/documents/nx_devkit#addprojectconfiguration) instead. **`Deprecated`** @@ -2368,10 +2368,10 @@ use updateNxJson #### Parameters -| Name | Type | -| :---------------- | :------------------------------------------------------------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | -| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nrwl_devkit#workspaceconfiguration) | +| Name | Type | +| :---------------- | :---------------------------------------------------------------------------------- | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | +| `workspaceConfig` | [`WorkspaceConfiguration`](../../devkit/documents/nx_devkit#workspaceconfiguration) | #### Returns @@ -2387,11 +2387,11 @@ Utility to act on all files in a tree that are not ignored by git. #### Parameters -| Name | Type | Default value | -| :-------- | :------------------------------------------------ | :------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | `undefined` | -| `dirPath` | `string` | `tree.root` | -| `visitor` | (`path`: `string`) => `void` | `undefined` | +| Name | Type | Default value | +| :-------- | :---------------------------------------------- | :------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | `undefined` | +| `dirPath` | `string` | `tree.root` | +| `visitor` | (`path`: `string`) => `void` | `undefined` | #### Returns @@ -2430,12 +2430,12 @@ Writes a JSON value to the file system tree #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------------------------------------------------- | :------------------------------ | -| `tree` | [`Tree`](../../devkit/documents/nrwl_devkit#tree) | File system tree | -| `path` | `string` | Path of JSON file in the Tree | -| `value` | `T` | Serializable value to write | -| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nrwl_devkit#jsonserializeoptions) | Optional JSON Serialize Options | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------------------------ | :------------------------------ | +| `tree` | [`Tree`](../../devkit/documents/nx_devkit#tree) | File system tree | +| `path` | `string` | Path of JSON file in the Tree | +| `value` | `T` | Serializable value to write | +| `options?` | [`JsonSerializeOptions`](../../devkit/documents/nx_devkit#jsonserializeoptions) | Optional JSON Serialize Options | #### Returns diff --git a/docs/generated/packages/esbuild/documents/overview.md b/docs/generated/packages/esbuild/documents/overview.md index 3323df1e44519..5dba8a19770a4 100644 --- a/docs/generated/packages/esbuild/documents/overview.md +++ b/docs/generated/packages/esbuild/documents/overview.md @@ -17,14 +17,14 @@ To add the esbuild plugin to an existing workspace, run the following: {% tab label="npm" %} ```shell -npm install -D @nrwl/esbuild +npm install -D @nx/esbuild ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/esbuild +yarn add -D @nx/esbuild ``` {% /tab %} @@ -35,10 +35,10 @@ yarn add -D @nrwl/esbuild You can add a new library that builds using esbuild with: ```shell -nx g @nrwl/js:lib mylib --bundler=esbuild +nx g @nx/js:lib mylib --bundler=esbuild ``` -This command will install the esbuild plugin if needed, and set `@nrwl/esbuild:esbuild` executor for the `build` target. +This command will install the esbuild plugin if needed, and set `@nx/esbuild:esbuild` executor for the `build` target. ### Adding esbuild target to existing libraries @@ -70,7 +70,7 @@ Assets are non-JS and non-TS files, such as images, CSS, etc. You can add them t ```jsonc "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { //... "assets": [ @@ -120,7 +120,7 @@ Extra API options for esbuild can be passed in the `esbuildOptions` object for y ```jsonc "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { //... "esbuildOptions": { diff --git a/docs/generated/packages/esbuild/executors/esbuild.json b/docs/generated/packages/esbuild/executors/esbuild.json index 9e52f09c4b0a7..67783d869a46c 100644 --- a/docs/generated/packages/esbuild/executors/esbuild.json +++ b/docs/generated/packages/esbuild/executors/esbuild.json @@ -206,7 +206,7 @@ } }, "additionalProperties": true, - "examplesFile": "`/project.json`:\n\n```json\n{\n //...\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\"\n }\n }\n }\n}\n```\n\n```bash\nnx build \n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"CommonJS output\" %}\n\nThe CommonJS format is required in some environments, such as Electron applications. By default, `esbuild` will use the ESM format, which is recommended for Web and Node applications. You may also output to multiple formats.\n\n```bash\nnx build --format=cjs\nnx build --format=esm,cjs\nnx build # defaults to es# defaults to esm\n```\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"format\": [\"esm\", \"cjs\"]\n}\n```\n\n{% /tab %}\n{% tab label=\"External packages\" %}\n\nYou can avoid packages from being bundled by providing the `external` option with a list of packages to skip.\n\nYou can also use `*` wildcard to match assets.\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"external\": [\"lodash\", \"*.png\"]\n}\n```\n\n{% /tab %}\n{% tab label=\"Skip type checking\" %}\n\nType checking is the slowest part of the build. You may want to skip type checking during build and run it as another job in CI.\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"skipTypeCheck\": true\n}\n```\n\n{% /tab %}\n{% tab label=\"Additional esbuild options\" %}\n\nAdditional [esbuild options](https://esbuild.github.io/api/) can be passed using `esbuildOptions` in your project configuration.\n\n```json\n\"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"esbuildOptions\": {\n \"legalComments\": \"inline\"\n \"banner\": {\n \".js\": \"// banner\"\n },\n \"footer\": {\n \".js\": \"// footer\"\n }\n }\n}\n```\n\n{% /tab %}\n{% tabs %}\n", + "examplesFile": "`/project.json`:\n\n```json\n{\n //...\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\"\n }\n }\n }\n}\n```\n\n```bash\nnx build \n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"CommonJS output\" %}\n\nThe CommonJS format is required in some environments, such as Electron applications. By default, `esbuild` will use the ESM format, which is recommended for Web and Node applications. You may also output to multiple formats.\n\n```bash\nnx build --format=cjs\nnx build --format=esm,cjs\nnx build # defaults to es# defaults to esm\n```\n\n```json\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"format\": [\"esm\", \"cjs\"]\n}\n```\n\n{% /tab %}\n{% tab label=\"External packages\" %}\n\nYou can avoid packages from being bundled by providing the `external` option with a list of packages to skip.\n\nYou can also use `*` wildcard to match assets.\n\n```json\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"external\": [\"lodash\", \"*.png\"]\n}\n```\n\n{% /tab %}\n{% tab label=\"Skip type checking\" %}\n\nType checking is the slowest part of the build. You may want to skip type checking during build and run it as another job in CI.\n\n```json\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"skipTypeCheck\": true\n}\n```\n\n{% /tab %}\n{% tab label=\"Additional esbuild options\" %}\n\nAdditional [esbuild options](https://esbuild.github.io/api/) can be passed using `esbuildOptions` in your project configuration.\n\n```json\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n \"main\": \"\",\n \"tsConfig\": \"/tsconfig.app.json\",\n \"outputPath\": \"dist/\",\n \"esbuildOptions\": {\n \"legalComments\": \"inline\"\n \"banner\": {\n \".js\": \"// banner\"\n },\n \"footer\": {\n \".js\": \"// footer\"\n }\n }\n}\n```\n\n{% /tab %}\n{% tabs %}\n", "presets": [] }, "description": "Bundle a package using EsBuild.", diff --git a/docs/generated/packages/esbuild/generators/esbuild-project.json b/docs/generated/packages/esbuild/generators/esbuild-project.json index 434d89b8d7a00..88d72a8c5383e 100644 --- a/docs/generated/packages/esbuild/generators/esbuild-project.json +++ b/docs/generated/packages/esbuild/generators/esbuild-project.json @@ -58,7 +58,7 @@ } }, "required": [], - "examplesFile": "```bash\nnx g @nrwl/esbuild:esbuild-project my-package\n```\n\n{% callout type=\"note\" title=\"Overwriting existing build option\" %}\nThe `esbuild-projet` generator validates that an existing `build` target isn't already defined for the project. If you are adding esbuild to a project with an existing `build` target, pass the `--skipValidation` option.\n{% /callout %}\n\nYou may also provide a custom main entry file, or a custom tsconfig file if the defaults don't work. By default, the generator will look for a main file matching `src/index.ts` or `src/main.ts`, and a tsconfig file matching `tsconfig.app.json` or `tsconfig.lib.json`.\n\n```bash\nnx g @nrwl/esbuild:esbuild-project my-package \\\n--main=packages/my-package/src/entry.ts \\\n--tsConfig=packages/my-package/tsconfig.custom.json\n```\n", + "examplesFile": "```bash\nnx g @nx/esbuild:esbuild-project my-package\n```\n\n{% callout type=\"note\" title=\"Overwriting existing build option\" %}\nThe `esbuild-projet` generator validates that an existing `build` target isn't already defined for the project. If you are adding esbuild to a project with an existing `build` target, pass the `--skipValidation` option.\n{% /callout %}\n\nYou may also provide a custom main entry file, or a custom tsconfig file if the defaults don't work. By default, the generator will look for a main file matching `src/index.ts` or `src/main.ts`, and a tsconfig file matching `tsconfig.app.json` or `tsconfig.lib.json`.\n\n```bash\nnx g @nx/esbuild:esbuild-project my-package \\\n--main=packages/my-package/src/entry.ts \\\n--tsConfig=packages/my-package/tsconfig.custom.json\n```\n", "presets": [] }, "description": "Add esbuild configuration to a project.", diff --git a/docs/generated/packages/eslint-plugin/documents/enforce-module-boundaries.md b/docs/generated/packages/eslint-plugin/documents/enforce-module-boundaries.md index 7e2b539cd7731..6af916e671ee7 100644 --- a/docs/generated/packages/eslint-plugin/documents/enforce-module-boundaries.md +++ b/docs/generated/packages/eslint-plugin/documents/enforce-module-boundaries.md @@ -1,4 +1,4 @@ -The `@nrwl/nx/enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps to prevent unplanned cross-dependencies. +The `@nx/enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps to prevent unplanned cross-dependencies. ## Usage @@ -11,7 +11,7 @@ You can use the `enforce-module-boundaries` rule by adding it to your ESLint rul { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { - "@nrwl/nx/enforce-module-boundaries": [ + "@nx/enforce-module-boundaries": [ "error", { // ...rule specific configuration diff --git a/docs/generated/packages/eslint-plugin/documents/overview.md b/docs/generated/packages/eslint-plugin/documents/overview.md index 9a577e5821f65..7c966c2c24aba 100644 --- a/docs/generated/packages/eslint-plugin/documents/overview.md +++ b/docs/generated/packages/eslint-plugin/documents/overview.md @@ -1,23 +1,23 @@ -The `@nrwl/eslint-plugin-nx` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called [enforce-module-boundaries](#enforce-module-boundaries-rule). +The `@nx/eslint-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called [enforce-module-boundaries](#enforce-module-boundaries-rule). ## Setting Up ESLint Plugin ### Installation -In any Nx workspace, you can install `@nrwl/eslint-plugin-nx` by running the following commands if the package is not already installed: +In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed: {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/eslint-plugin-nx +npm i --save-dev @nx/eslint-plugin ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/eslint-plugin-nx +yarn add --dev @nx/eslint-plugin ``` {% /tab %} @@ -29,28 +29,28 @@ The plugin contains the following rule configurations divided into sub-plugins. ### JavaScript -The `@nrwl/nx/javascript` ESLint plugin contains best practices when using JavaScript. +The `@nx/javascript` ESLint plugin contains best practices when using JavaScript. ### TypeScript -The `@nrwl/nx/typescript` ESLint plugin contains best practices when using TypeSript. +The `@nx/typescript` ESLint plugin contains best practices when using TypeSript. ### Angular Contains configurations matching best practices when using Angular framework: -- `@nrwl/nx/angular` -- `@nrwl/nx/angular-template` +- `@nx/angular` +- `@nx/angular-template` ### React Contains configurations matching best practices when using React framework: -- `@nrwl/nx/react-base` -- `@nrwl/nx/react-jsx` -- `@nrwl/nx/react-typescript` +- `@nx/react-base` +- `@nx/react-jsx` +- `@nx/react-typescript` -You can also use `@nrwl/nx/react` which includes all three `@nrwl/nx/react-*` plugins +You can also use `@nx/react` which includes all three `@nx/react-*` plugins ### Enforce Module Boundaries rule diff --git a/docs/generated/packages/expo/documents/overview.md b/docs/generated/packages/expo/documents/overview.md index e8f3da33a4e8a..2bd3082683376 100644 --- a/docs/generated/packages/expo/documents/overview.md +++ b/docs/generated/packages/expo/documents/overview.md @@ -18,14 +18,14 @@ Install the expo plugin {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/expo +npm i --save-dev @nx/expo ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/expo +yarn add --dev @nx/expo ``` {% /tab %} @@ -36,7 +36,7 @@ yarn add --dev @nrwl/expo Add a new application to your workspace with the following command: ```shell -nx g @nrwl/expo:app my-app +nx g @nx/expo:app my-app ``` Start the application by running: @@ -50,7 +50,7 @@ nx start my-app To generate a new library run: ```shell -npx nx g @nrwl/react-native:lib your-lib-name +npx nx g @nx/react-native:lib your-lib-name ``` ### Generating Components @@ -58,7 +58,7 @@ npx nx g @nrwl/react-native:lib your-lib-name To generate a new component inside library run: ```shell -npx nx g @nrwl/react-native:component your-component-name --project=your-lib-name --export +npx nx g @nx/react-native:component your-component-name --project=your-lib-name --export ``` Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json` diff --git a/docs/generated/packages/expo/executors/build-list.json b/docs/generated/packages/expo/executors/build-list.json index 7f7b50c377e92..87e3874d6251e 100644 --- a/docs/generated/packages/expo/executors/build-list.json +++ b/docs/generated/packages/expo/executors/build-list.json @@ -75,7 +75,7 @@ } }, "required": [], - "examplesFile": "The `build-list` command allows to check the details of your Expo Application Services (EAS) build status.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-list\": {\n \"executor\": \"@nrwl/expo:build-list\",\n \"options\": {}\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:build-list\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Get Status of Different Platforms\" %}\nThe `platform` option allows you to check build status of different platform (e.g. android, ios, all):\n\n```json\n \"build-list\": {\n \"executor\": \"@nrwl/expo:build-list\",\n \"options\": {\n \"platform\": \"ios\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Get Status Interactively\" %}\n\nThe `interactive` option allows you to specify whether to use interactive mode:\n\n```json\n \"build-list\": {\n \"executor\": \"@nrwl/expo:build-list\",\n \"options\": {\n \"interactive\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Get Status in JSON Format\" %}\n\nThe `json` option allows you to print the output in JSON format:\n\n```json\n \"build-list\": {\n \"executor\": \"@nrwl/expo:build-list\",\n \"options\": {\n \"interactive\": false,\n \"json\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "The `build-list` command allows to check the details of your Expo Application Services (EAS) build status.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-list\": {\n \"executor\": \"@nx/expo:build-list\",\n \"options\": {}\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:build-list\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Get Status of Different Platforms\" %}\nThe `platform` option allows you to check build status of different platform (e.g. android, ios, all):\n\n```json\n \"build-list\": {\n \"executor\": \"@nx/expo:build-list\",\n \"options\": {\n \"platform\": \"ios\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Get Status Interactively\" %}\n\nThe `interactive` option allows you to specify whether to use interactive mode:\n\n```json\n \"build-list\": {\n \"executor\": \"@nx/expo:build-list\",\n \"options\": {\n \"interactive\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Get Status in JSON Format\" %}\n\nThe `json` option allows you to print the output in JSON format:\n\n```json\n \"build-list\": {\n \"executor\": \"@nx/expo:build-list\",\n \"options\": {\n \"interactive\": false,\n \"json\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "List all EAS builds for your Expo project", diff --git a/docs/generated/packages/expo/executors/prebuild.json b/docs/generated/packages/expo/executors/prebuild.json index 362dc71a79b39..634210cb1f081 100644 --- a/docs/generated/packages/expo/executors/prebuild.json +++ b/docs/generated/packages/expo/executors/prebuild.json @@ -34,7 +34,7 @@ "description": "Project template to clone from. File path pointing to a local tar file or a github repo" } }, - "examplesFile": "The `prebuild` command generates native code before a native app can compile.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"prebuild\": {\n \"executor\": \"@nrwl/expo:prebuild\",\n \"options\": {}\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:prebuild\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Generate Native Code for Different Platforms\" %}\nThe `platform` option allows you to specify the platform to generate native code for (e.g. android, ios, all).\n\n```json\n \"prebuild\": {\n \"executor\": \"@nrwl/expo:prebuild\",\n \"options\": {\n \"platform\": \"android\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Regenerate Native Code\" %}\n\nThe `clean` option allows you to delete the native folders and regenerate them before apply changes.\n\n```json\n \"prebuild\": {\n \"executor\": \"@nrwl/expo:prebuild\",\n \"options\": {\n \"clean\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Install NPM Packages and CocoaPods\" %}\n\nThe `install` option allows you to install NPM Packages and CocoaPods.\n\n```json\n \"prebuild\": {\n \"executor\": \"@nrwl/expo:prebuild\",\n \"options\": {\n \"install\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "The `prebuild` command generates native code before a native app can compile.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"prebuild\": {\n \"executor\": \"@nx/expo:prebuild\",\n \"options\": {}\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:prebuild\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Generate Native Code for Different Platforms\" %}\nThe `platform` option allows you to specify the platform to generate native code for (e.g. android, ios, all).\n\n```json\n \"prebuild\": {\n \"executor\": \"@nx/expo:prebuild\",\n \"options\": {\n \"platform\": \"android\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Regenerate Native Code\" %}\n\nThe `clean` option allows you to delete the native folders and regenerate them before apply changes.\n\n```json\n \"prebuild\": {\n \"executor\": \"@nx/expo:prebuild\",\n \"options\": {\n \"clean\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Install NPM Packages and CocoaPods\" %}\n\nThe `install` option allows you to install NPM Packages and CocoaPods.\n\n```json\n \"prebuild\": {\n \"executor\": \"@nx/expo:prebuild\",\n \"options\": {\n \"install\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Create native iOS and Android project files for building natively.", diff --git a/docs/generated/packages/expo/executors/run.json b/docs/generated/packages/expo/executors/run.json index 0543b87d9c944..f71a5f5140444 100644 --- a/docs/generated/packages/expo/executors/run.json +++ b/docs/generated/packages/expo/executors/run.json @@ -70,7 +70,7 @@ } }, "required": ["platform"], - "examplesFile": "The `run` command allows you to compile your app locally.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-ios\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"ios\"\n }\n },\n \"run-android\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"android\"\n }\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:run-ios\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Compile Android with Different Variants\" %}\nThe `variant` option allows you to specify the compile Android app with variants defined in `build.gradle` file (e.g. debug, release).\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"android\",\n \"variant\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Compile iOS with Different Configurations\" %}\n\nThe `xcodeConfiguration` option allows you to specify Xcode configuration to use (e.g. Debug or Release).\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"ios\",\n \"xcodeConfiguration\": \"Release\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run on a device\" %}\n\nThe `device` option allows you to launch your app in a specific device name or UDID.\nTo see all your iOS simulators: run `xcrun simctl list devices available`.\nTo see all your Android emulators, run: `emulator -list-avds`.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"ios\",\n \"device\": \"iPhone 14\"\n }\n },\n \"run-android\": {\n \"executor\": \"@nrwl/expo:run\",\n \"options\": {\n \"platform\": \"android\",\n \"device\": \"Pixel_XL_API_Tiramisu\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "The `run` command allows you to compile your app locally.\n\n`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-ios\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"ios\"\n }\n },\n \"run-android\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"android\"\n }\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:run-ios\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Compile Android with Different Variants\" %}\nThe `variant` option allows you to specify the compile Android app with variants defined in `build.gradle` file (e.g. debug, release).\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"android\",\n \"variant\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Compile iOS with Different Configurations\" %}\n\nThe `xcodeConfiguration` option allows you to specify Xcode configuration to use (e.g. Debug or Release).\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"ios\",\n \"xcodeConfiguration\": \"Release\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run on a device\" %}\n\nThe `device` option allows you to launch your app in a specific device name or UDID.\nTo see all your iOS simulators: run `xcrun simctl list devices available`.\nTo see all your Android emulators, run: `emulator -list-avds`.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"ios\",\n \"device\": \"iPhone 14\"\n }\n },\n \"run-android\": {\n \"executor\": \"@nx/expo:run\",\n \"options\": {\n \"platform\": \"android\",\n \"device\": \"Pixel_XL_API_Tiramisu\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Run the Android app binary locally or run the iOS app binary locally", diff --git a/docs/generated/packages/expo/executors/start.json b/docs/generated/packages/expo/executors/start.json index 7e4e333aeeb19..ecb4fb5427941 100644 --- a/docs/generated/packages/expo/executors/start.json +++ b/docs/generated/packages/expo/executors/start.json @@ -86,7 +86,7 @@ "description": "Allows this command to run while offline" } }, - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Specify starting on platform\" %}\nThe `ios`, `android` and `web` option allows you to start the server on different platforms.\n\nOpens your app in Expo Go in a currently running iOS simulator on your computer:\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"ios\": true\n }\n }\n```\n\nOpens your app in Expo Go on a connected Android device\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"android\": true\n }\n }\n```\n\nOpens your app in a web browser:\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"web\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Specify the host\" %}\nThe `host` option allows you to specify the type of host to use. `lan` uses the local network; `tunnel` ues any network by tunnel through ngrok; `localhost` connects to the dev server over localhost.\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"host\": \"localhost\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `clear` option allows you to remove Metro bundler cache.\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"clear\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n //...\n }\n}\n```\n\n```shell\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Specify starting on platform\" %}\nThe `ios`, `android` and `web` option allows you to start the server on different platforms.\n\nOpens your app in Expo Go in a currently running iOS simulator on your computer:\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"ios\": true\n }\n }\n```\n\nOpens your app in Expo Go on a connected Android device\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"android\": true\n }\n }\n```\n\nOpens your app in a web browser:\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"web\": true\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Specify the host\" %}\nThe `host` option allows you to specify the type of host to use. `lan` uses the local network; `tunnel` ues any network by tunnel through ngrok; `localhost` connects to the dev server over localhost.\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"host\": \"localhost\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `clear` option allows you to remove Metro bundler cache.\n\n```json\n \"start\": {\n \"executor\": \"@nx/expo:start\",\n \"options\": {\n \"port\": 8081,\n \"clear\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Start a local dev server for the app or start a Webpack dev server for the web app", diff --git a/docs/generated/packages/express/documents/overview.md b/docs/generated/packages/express/documents/overview.md index e26cc61b983ad..3b46eaaa38f7c 100644 --- a/docs/generated/packages/express/documents/overview.md +++ b/docs/generated/packages/express/documents/overview.md @@ -17,14 +17,14 @@ Install the express plugin {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/express +npm i --save-dev @nx/express ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/express +yarn add --dev @nx/express ``` {% /tab %} @@ -35,7 +35,7 @@ yarn add --dev @nrwl/express Add a new application to your workspace with the following command: ```shell -nx g @nrwl/express:app my-app +nx g @nx/express:app my-app ``` Serve the application by running @@ -46,7 +46,7 @@ nx serve my-app This starts the application on localhost:3333/api by default. -> Express does not come with any library generators, but you can leverage the[`@nrwl/js`](/packages/js#create-libraries) plugin to generate a Node.js library for your express application. +> Express does not come with any library generators, but you can leverage the[`@nx/js`](/packages/js#create-libraries) plugin to generate a Node.js library for your express application. ### Application Proxies @@ -54,7 +54,7 @@ The Express application generator has an option to configure other projects in t can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/express:app --frontendProject my-react-app +nx g @nx/express:app --frontendProject my-react-app ``` ## Using Express @@ -89,5 +89,5 @@ before serving the Express application. ## More Documentation - [Using Jest](/packages/jest) -- [@nrwl/js](/packages/js) +- [@nx/js](/packages/js) - [Express](https://expressjs.com/) diff --git a/docs/generated/packages/jest/documents/overview.md b/docs/generated/packages/jest/documents/overview.md index dbd920e158c6c..95f6c6d9f31ec 100644 --- a/docs/generated/packages/jest/documents/overview.md +++ b/docs/generated/packages/jest/documents/overview.md @@ -9,27 +9,27 @@ By default, Nx will use Jest when creating applications and libraries. ```shell -nx g @nrwl/web:app frontend +nx g @nx/web:app frontend ``` ### Adding Jest to an Existing Project -Add Jest to a project using the `jest-project` generator from `@nrwl/jest`. +Add Jest to a project using the `jest-project` generator from `@nx/jest`. -First, install `@nrwl/jest`, if not already installed using your preferred package manager. +First, install `@nx/jest`, if not already installed using your preferred package manager. ```shell -npm install --save-dev @nrwl/jest +npm install --save-dev @nx/jest ``` ```shell -yarn add --dev @nrwl/jest +yarn add --dev @nx/jest ``` Once installed, run the `jest-project` generator ```shell -nx g @nrwl/jest:jest-project --project= +nx g @nx/jest:jest-project --project= ``` > Hint: You can use the `--dry-run` flag to see what will be generated. @@ -99,12 +99,12 @@ Primary configurations for Jest will be via the `jest.config.ts` file that gener The root level `jest.config.ts` file configures [Jest multi project support](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig). This configuration allows editor/IDE integrations to pick up individual project's configurations rather than the one at the root. -The set of Jest projects within Nx workspaces tends to change. Instead of statically defining a list in `jest.config.ts`, Nx provides a utility function called `getJestProjects` which queries for Jest configurations defined for targets which use the `@nrwl/jest:jest` executor. +The set of Jest projects within Nx workspaces tends to change. Instead of statically defining a list in `jest.config.ts`, Nx provides a utility function called `getJestProjects` which queries for Jest configurations defined for targets which use the `@nx/jest:jest` executor. You can add Jest projects which are not included in `getJestProjects()`, because they do not use the Nx Jest executor, by doing something like the following: ```typescript {% fileName="jest.config.ts"} -import { getJestProjects } from '@nrwl/jest'; +import { getJestProjects } from '@nx/jest'; export default { projects: [...getJestProjects(), '/path/to/jest.config.ts'], @@ -135,7 +135,7 @@ In order to use Jest's global setup/teardown functions that reference nx librari Nx provides a helper function that you can import within your setup/teardown file. ```typescript {% fileName="global-setup.ts" %} -import { registerTsProject } from '@nrwl/js/src/internal'; +import { registerTsProject } from '@nx/js/src/internal'; const cleanupRegisteredPaths = registerTsProject('.', 'tsconfig.base.json'); import { yourFancyFunction } from '@some-org/my-util-library'; @@ -166,4 +166,4 @@ export default { ## More Documentation - [Jest Docs](https://jestjs.io/) -- [@nrwl/jest options](/packages/jest) +- [@nx/jest options](/packages/jest) diff --git a/docs/generated/packages/jest/executors/jest.json b/docs/generated/packages/jest/executors/jest.json index cfa82e272299b..9db6ae9442a2c 100644 --- a/docs/generated/packages/jest/executors/jest.json +++ b/docs/generated/packages/jest/executors/jest.json @@ -190,7 +190,7 @@ } }, "required": ["jestConfig"], - "examplesFile": "Jest can be configured in many ways, but primarily you'll need to at least have the jestConfig options\n\n```json\n\"test\": {\n \"executor\": \"@nrwl/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\"\n }\n}\n```\n\nIt is also helpful to have `passWithNoTests: true` set so your project doesn't fail testing while tests are still being added.\n\n```json\n\"test\": {\n \"executor\": \"@nrwl/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\",\n \"passWithNoTests\": true\n }\n}\n```\n\n### Snapshots\n\nUpdate snapshots running with `--update-snapshot` or `-u` for short.\n\n```bash\nnx test my-project -u\n```\n\nOther times you might not want to allow updating snapshots such as in CI.\nAdding a _ci_ configuration is helpful for adding this behavior.\n\n```json\n\"test\": {\n \"executor\": \"@nrwl/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\",\n \"passWithNoTests\": true\n },\n \"configurations\": {\n \"ci\": {\n \"ci\": true\n }\n }\n}\n```\n\n```bash\nnx affected --target=test --configuration=ci\n```\n\nLearn more [about _affected_](/concepts/affected)\n" + "examplesFile": "Jest can be configured in many ways, but primarily you'll need to at least have the jestConfig options\n\n```json\n\"test\": {\n \"executor\": \"@nx/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\"\n }\n}\n```\n\nIt is also helpful to have `passWithNoTests: true` set so your project doesn't fail testing while tests are still being added.\n\n```json\n\"test\": {\n \"executor\": \"@nx/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\",\n \"passWithNoTests\": true\n }\n}\n```\n\n### Snapshots\n\nUpdate snapshots running with `--update-snapshot` or `-u` for short.\n\n```bash\nnx test my-project -u\n```\n\nOther times you might not want to allow updating snapshots such as in CI.\nAdding a _ci_ configuration is helpful for adding this behavior.\n\n```json\n\"test\": {\n \"executor\": \"@nx/jest:jest\",\n \"options\": {\n \"jestConfig\": \"libs/my-lib/jest.config.ts\",\n \"passWithNoTests\": true\n },\n \"configurations\": {\n \"ci\": {\n \"ci\": true\n }\n }\n}\n```\n\n```bash\nnx affected --target=test --configuration=ci\n```\n\nLearn more [about _affected_](/concepts/affected)\n" }, "description": "Run Jest unit tests.", "aliases": [], diff --git a/docs/generated/packages/js/documents/overview.md b/docs/generated/packages/js/documents/overview.md index ccb0c3a4d8afb..dac4c68489dee 100644 --- a/docs/generated/packages/js/documents/overview.md +++ b/docs/generated/packages/js/documents/overview.md @@ -4,20 +4,20 @@ The JS plugin contains executors and generators that are useful for JavaScript/T ### Installation -In any Nx workspace, you can install `@nrwl/js` by running the following commands if `@nrwl/js` package is not installed: +In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed: {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/js +npm i --save-dev @nx/js ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/js +yarn add --dev @nx/js ``` {% /tab %} @@ -25,7 +25,7 @@ yarn add --dev @nrwl/js ### `ts` Preset -When initializing a new Nx workspace, specifying `--preset=ts` will generate a workspace with `@nrwl/js` pre-installed. +When initializing a new Nx workspace, specifying `--preset=ts` will generate a workspace with `@nx/js` pre-installed. {% tabs %} {%tab label="npm"%} @@ -49,7 +49,7 @@ yarn create nx-workspace my-org --preset=ts You can add a new JS/TS library with the following command: ```shell -nx g @nrwl/js:lib my-lib +nx g @nx/js:lib my-lib ``` ## Build @@ -57,7 +57,7 @@ nx g @nrwl/js:lib my-lib You can `build` libraries that are generated with a bundler specified. ```shell -nx g @nrwl/js:lib my-buildable-lib --bundler=rollup +nx g @nx/js:lib my-buildable-lib --bundler=rollup ``` Generating a library with `--bundler` specified will add a `build` target to the library's `project.json` file allows the library to be built. @@ -84,9 +84,9 @@ nx lint my-lib ## Compiler -By default, `@nrwl/js` uses [TypeScript Compiler (TSC)](https://www.typescriptlang.org/docs/handbook/2/basic-types.html#tsc-the-typescript-compiler), via `@nrwl/js:tsc` executor, to compile your libraries. Optionally, you can switch `tsc` out for a different compiler with `--compiler` flag when executing the generators. +By default, `@nx/js` uses [TypeScript Compiler (TSC)](https://www.typescriptlang.org/docs/handbook/2/basic-types.html#tsc-the-typescript-compiler), via `@nx/js:tsc` executor, to compile your libraries. Optionally, you can switch `tsc` out for a different compiler with `--compiler` flag when executing the generators. -Currently, `@nrwl/js` supports the following compilers: +Currently, `@nx/js` supports the following compilers: - [Speedy Web Compiler (SWC)](https://swc.rs) @@ -95,15 +95,15 @@ Currently, `@nrwl/js` supports the following compilers: - Create a buildable library with `swc` ```shell -nx g @nrwl/js:lib my-swc-lib --bundler=swc +nx g @nx/js:lib my-swc-lib --bundler=swc ``` - Convert a `tsc` library to use `swc` ```shell -nx g @nrwl/js:convert-to-swc my-buildable-lib +nx g @nx/js:convert-to-swc my-buildable-lib ``` -Now the `build` command will use `@nrwl/js:swc` executor to compile your libraries. +Now the `build` command will use `@nx/js:swc` executor to compile your libraries. -> The first time you generate a `swc` library or convert a `tsc` library over to `swc`, `@nrwl/js` will install the necessary dependencies to use `swc`. +> The first time you generate a `swc` library or convert a `tsc` library over to `swc`, `@nx/js` will install the necessary dependencies to use `swc`. diff --git a/docs/generated/packages/js/executors/swc.json b/docs/generated/packages/js/executors/swc.json index 106578f4ef448..48bec366c3f6f 100644 --- a/docs/generated/packages/js/executors/swc.json +++ b/docs/generated/packages/js/executors/swc.json @@ -158,7 +158,7 @@ ] } }, - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Inline libraries\" %}\n\n`@nrwl/js:swc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nrwl/js:swc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% tab label=\"Custom swcrc\" %}\n\n`@nrwl/js:swc` can compile your code with a custom `.swcrc`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"swcrc\": \"libs/ts-lib/.dev.swcrc\"\n },\n \"configurations\": {\n \"production\": {\n \"swcrc\": \"libs/ts-lib/.prod.swcrc\"\n }\n }\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Inline libraries\" %}\n\n`@nx/js:swc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nx/js:swc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% tab label=\"Custom swcrc\" %}\n\n`@nx/js:swc` can compile your code with a custom `.swcrc`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:swc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"swcrc\": \"libs/ts-lib/.dev.swcrc\"\n },\n \"configurations\": {\n \"production\": {\n \"swcrc\": \"libs/ts-lib/.prod.swcrc\"\n }\n }\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "description": "Build a project using SWC.", diff --git a/docs/generated/packages/js/executors/tsc.json b/docs/generated/packages/js/executors/tsc.json index 2fbe6d64e2aed..607e5b5c5481f 100644 --- a/docs/generated/packages/js/executors/tsc.json +++ b/docs/generated/packages/js/executors/tsc.json @@ -171,7 +171,7 @@ ] } }, - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Using TypeScript Transformer Plugins\" %}\n\n`@nrwl/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"transformers\": [\n \"@nestjs/swagger/plugin\",\n {\n \"name\": \"@automapper/classes/transformer-plugin\",\n \"options\": {}\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Inline libraries\" %}\n\n`@nrwl/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nrwl/js:tsc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nrwl/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Using TypeScript Transformer Plugins\" %}\n\n`@nx/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"transformers\": [\n \"@nestjs/swagger/plugin\",\n {\n \"name\": \"@automapper/classes/transformer-plugin\",\n \"options\": {}\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Inline libraries\" %}\n\n`@nx/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nx/js:tsc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "description": "Build a project using TypeScript.", diff --git a/docs/generated/packages/js/generators/library.json b/docs/generated/packages/js/generators/library.json index 81ce0f558fd8a..f9b5faf1c37ba 100644 --- a/docs/generated/packages/js/generators/library.json +++ b/docs/generated/packages/js/generators/library.json @@ -135,7 +135,7 @@ } }, "required": ["name"], - "examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nrwl/js:lib generator.\n---\n\nThe `@nrwl/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nrwl/js:lib mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nrwl/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nrwl/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nrwl/js:lib mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nrwl/js:swc` executor.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nrwl/js:tsc` executor.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nrwl/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](https://nx.dev/packages/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nrwl/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nrwl/vite:build` executor.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nrwl/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nrwl/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nrwl/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"Using directory flag\" %}\n\nGenerate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)\n\n```shell\nnpx nx g lib mylib --directory=myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nrwl/js:lib mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nx/js:lib generator.\n---\n\nThe `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](https://nx.dev/packages/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"Using directory flag\" %}\n\nGenerate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)\n\n```shell\nnpx nx g lib mylib --directory=myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "aliases": ["lib"], diff --git a/docs/generated/packages/linter/documents/overview.md b/docs/generated/packages/linter/documents/overview.md index d3720e15de704..98328abc80e16 100644 --- a/docs/generated/packages/linter/documents/overview.md +++ b/docs/generated/packages/linter/documents/overview.md @@ -4,14 +4,14 @@ The Linter plugin contains executors, generator, plugin and utilities used for l ### Installation -In any Nx workspace, you can install `@nrwl/linter` by running the following commands if `@nrwl/linter` package is not installed: +In any Nx workspace, you can install `@nx/linter` by running the following commands if `@nx/linter` package is not installed: ```shell -npm i --save-dev @nrwl/linter +npm i --save-dev @nx/linter ``` ```shell -yarn add --dev @nrwl/linter +yarn add --dev @nx/linter ``` ## Lint diff --git a/docs/generated/packages/linter/executors/eslint.json b/docs/generated/packages/linter/executors/eslint.json index 17adbe9a35c05..320cb52118bf0 100644 --- a/docs/generated/packages/linter/executors/eslint.json +++ b/docs/generated/packages/linter/executors/eslint.json @@ -131,7 +131,7 @@ } }, "required": ["lintFilePatterns"], - "examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"ESLint config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag:\n\n```json\n\"lint\": {\n \"executor\": \"@nrwl/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \".eslintrc.js\"\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"ESLint config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \".eslintrc.js\"\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "hasher": "./src/executors/eslint/hasher", diff --git a/docs/generated/packages/linter/generators/workspace-rule.json b/docs/generated/packages/linter/generators/workspace-rule.json index 7dd3ac6c985bc..e80e3eff5dd16 100644 --- a/docs/generated/packages/linter/generators/workspace-rule.json +++ b/docs/generated/packages/linter/generators/workspace-rule.json @@ -22,7 +22,7 @@ } }, "required": ["name", "directory"], - "examplesFile": "{% tabs %}\n{% tab label=\"Create rule\" %}\n\nThis command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder:\n\n```shell\nnx g @nrwl/linter:workspace-rule my-custom-rule\n```\n\n{% /tab %}\n{% tab label=\"Custom sub-folder\" %}\n\nWe can change the default sub-folder from `rules` and specify a custom one:\n\n```shell\nnx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path\n```\n\nThe command above will generate the rule in `tools/eslint-rules/my/custom/path` folder.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "{% tabs %}\n{% tab label=\"Create rule\" %}\n\nThis command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder:\n\n```shell\nnx g @nx/linter:workspace-rule my-custom-rule\n```\n\n{% /tab %}\n{% tab label=\"Custom sub-folder\" %}\n\nWe can change the default sub-folder from `rules` and specify a custom one:\n\n```shell\nnx g @nx/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path\n```\n\nThe command above will generate the rule in `tools/eslint-rules/my/custom/path` folder.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Create a new Workspace ESLint rule.", diff --git a/docs/generated/packages/nest/documents/overview.md b/docs/generated/packages/nest/documents/overview.md index 4ce12d7b72583..c9d5662de20da 100644 --- a/docs/generated/packages/nest/documents/overview.md +++ b/docs/generated/packages/nest/documents/overview.md @@ -24,11 +24,11 @@ yarn create nx-workspace my-workspace --preset=nest To add the Nest plugin to an existing workspace, run one the following commands: ```shell -npm install -D @nrwl/nest +npm install -D @nx/nest ``` ```shell -yarn add -D @nrwl/nest +yarn add -D @nx/nest ``` ### Create Applications @@ -36,7 +36,7 @@ yarn add -D @nrwl/nest You can add a new Nest application with the following command: ```shell -nx g @nrwl/nest:app my-nest-app +nx g @nx/nest:app my-nest-app ``` #### Application Proxies @@ -44,7 +44,7 @@ nx g @nrwl/nest:app my-nest-app Generating Nest applications has an option to configure other projects in the workspace to proxy API requests. This can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/nest:app my-nest-app --frontendProject my-angular-app +nx g @nx/nest:app my-nest-app --frontendProject my-angular-app ``` ### Create Libraries @@ -52,19 +52,19 @@ nx g @nrwl/nest:app my-nest-app --frontendProject my-angular-app You can add a new Nest library with the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib +nx g @nx/nest:lib my-nest-lib ``` To make the library `buildable`, use the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib --buildable +nx g @nx/nest:lib my-nest-lib --buildable ``` To make the library `publishable`, use the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib --publishable --importPath=@my-workspace/my-nest-lib +nx g @nx/nest:lib my-nest-lib --publishable --importPath=@my-workspace/my-nest-lib ``` > Read more about [building and publishing libraries here](/more-concepts/buildable-and-publishable-libraries). diff --git a/docs/generated/packages/next/documents/next-config-setup.md b/docs/generated/packages/next/documents/next-config-setup.md index b03835294f1ae..8bed0d81ca94f 100644 --- a/docs/generated/packages/next/documents/next-config-setup.md +++ b/docs/generated/packages/next/documents/next-config-setup.md @@ -22,7 +22,7 @@ module.exports = withNx({ }); ``` -This guide contains information on how to compose the Nx plugin with other plugins, such as `@next/mdx`. Note that Nx prior to version 16 is missing the compose utility from the `@nrwl/next` package, and a workaround will be provided for Nx 15 and prior. +This guide contains information on how to compose the Nx plugin with other plugins, such as `@next/mdx`. Note that Nx prior to version 16 is missing the compose utility from the `@nx/next` package, and a workaround will be provided for Nx 15 and prior. {% callout type="warning" title="Avoid next-compose-plugins" %} There is a popular package called `next-compose-plugins` that has not been maintained for over two years. This package does not correctly combine plugins in all situations. If you do use it, replace the package with Nx 16's `composePlugins` utility (see below). @@ -34,9 +34,9 @@ Since Nx 16, we provide a `composePlugins` utility function that helps users com ```js // next.config.js -const { composePlugins, withNx } = require('@nrwl/next'); +const { composePlugins, withNx } = require('@nx/next'); /** - * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions} + * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { nx: { @@ -87,7 +87,7 @@ If you are not on Nx 16 and later versions, the `composePlugins` utility is not // ... /** - * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions} + * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { // ... diff --git a/docs/generated/packages/next/documents/overview.md b/docs/generated/packages/next/documents/overview.md index 8b1ead35ce61b..bba69db276399 100644 --- a/docs/generated/packages/next/documents/overview.md +++ b/docs/generated/packages/next/documents/overview.md @@ -10,16 +10,16 @@ The Next.js plugin contains executors and generators for managing Next.js applic To create a new Nx workspace with Next.js, run `npx create-nx-workspace@latest --preset=next`. -To add Next.js to an existing Nx workspace, install the `@nrwl/next` package. Make sure to install the version that matches your `@nrwl/workspace` version. +To add Next.js to an existing Nx workspace, install the `@nx/next` package. Make sure to install the version that matches your `@nx/workspace` version. ```shell #yarn -yarn add --dev @nrwl/next +yarn add --dev @nx/next ``` ```shell #npm -npm install --save-dev @nrwl/next +npm install --save-dev @nx/next ``` ### Creating Applications @@ -27,7 +27,7 @@ npm install --save-dev @nrwl/next You can add a new application with the following: ```shell -nx g @nrwl/next:app my-new-app +nx g @nx/next:app my-new-app ``` ### Generating Libraries @@ -44,7 +44,7 @@ and [Library Types](/more-concepts/library-types). To generate a new library run: ```shell -nx g @nrwl/next:lib my-new-lib +nx g @nx/next:lib my-new-lib ``` ### Generating Pages and Components @@ -52,9 +52,9 @@ nx g @nrwl/next:lib my-new-lib Nx also provides commands to quickly generate new pages and components for your application. ```shell -nx g @nrwl/next:page my-new-page --project=my-new-app +nx g @nx/next:page my-new-page --project=my-new-app -nx g @nrwl/next:component my-new-component --project=my-new-app +nx g @nx/next:component my-new-component --project=my-new-app ``` Above commands will add a new page `my-new-page` and a component `my-new-component` to `my-new-app` project respectively. @@ -98,7 +98,7 @@ There is no need to build the library prior to using it. When you update your li For libraries intended to be built and published to a registry (e.g. npm) you can use the `--publishable` and `--importPath` options. ```shell -nx g @nrwl/next:lib my-new-lib --publishable --importPath=@happynrwl/ui-components +nx g @nx/next:lib my-new-lib --publishable --importPath=@happynrwl/ui-components ``` ### Testing Projects diff --git a/docs/generated/packages/node/documents/overview.md b/docs/generated/packages/node/documents/overview.md index 2c397a4b746f4..a3c2ee6741e71 100644 --- a/docs/generated/packages/node/documents/overview.md +++ b/docs/generated/packages/node/documents/overview.md @@ -6,10 +6,10 @@ To add the Node plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/node +npm install -D @nx/node # For yarn users -yarn add -D @nrwl/node +yarn add -D @nx/node ``` ### Creating Applications @@ -17,7 +17,7 @@ yarn add -D @nrwl/node You can add a new application with the following: ```shell -nx g @nrwl/node:application my-new-app +nx g @nx/node:application my-new-app ``` You can run your application with `nx serve my-new-app`, which starts it in watch mode. @@ -27,11 +27,11 @@ You can run your application with `nx serve my-new-app`, which starts it in watc Node libraries are a good way to separate features within your organization. To create a Node library run the following command: ```shell -nx g @nrwl/node:lib my-new-lib +nx g @nx/node:lib my-new-lib # If you want the library to be buildable or publishable to npm -nx g @nrwl/node:lib my-new-lib --buildable -nx g @nrwl/node:lib my-new-lib \ +nx g @nx/node:lib my-new-lib --buildable +nx g @nx/node:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` @@ -70,7 +70,7 @@ The output is in the `dist` folder. You can customize the output folder by setti Generating Node applications has an option to configure other projects in the workspace to proxy API requests. This can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/node:application my-new-app \ +nx g @nx/node:application my-new-app \ --frontendProject my-react-app ``` diff --git a/docs/generated/packages/nx/documents/generate.md b/docs/generated/packages/nx/documents/generate.md index a4a6e4d5c67ea..82c6f114c88f1 100644 --- a/docs/generated/packages/nx/documents/generate.md +++ b/docs/generated/packages/nx/documents/generate.md @@ -24,43 +24,43 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx` Generate a new Angular application: ```shell -nx generate @nrwl/angular:app myapp +nx generate @nx/angular:app myapp ``` Generate a new React application: ```shell -nx generate @nrwl/react:app myapp +nx generate @nx/react:app myapp ``` Generate a new web component application: ```shell -nx generate @nrwl/web:app myapp +nx generate @nx/web:app myapp ``` Generate a new Node application: ```shell -nx generate @nrwl/node:app myapp +nx generate @nx/node:app myapp ``` Generate a new Angular library application: ```shell -nx generate @nrwl/angular:library mylibrary +nx generate @nx/angular:library mylibrary ``` Generate a new React library application: ```shell -nx generate @nrwl/react:library mylibrary +nx generate @nx/react:library mylibrary ``` Generate a new Node library application: ```shell -nx generate @nrwl/node:library mylibrary +nx generate @nx/node:library mylibrary ``` ## Options diff --git a/docs/generated/packages/nx/documents/list.md b/docs/generated/packages/nx/documents/list.md index ae5c2bf3eb085..3811bd9663fad 100644 --- a/docs/generated/packages/nx/documents/list.md +++ b/docs/generated/packages/nx/documents/list.md @@ -23,10 +23,10 @@ List the plugins installed in the current workspace: nx list ``` -List the generators and executors available in the `@nrwl/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace): +List the generators and executors available in the `@nx/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace): ```shell - nx list @nrwl/web + nx list @nx/web ``` ## Options diff --git a/docs/generated/packages/nx/documents/migrate.md b/docs/generated/packages/nx/documents/migrate.md index ad793708015f5..6dd1f77873718 100644 --- a/docs/generated/packages/nx/documents/migrate.md +++ b/docs/generated/packages/nx/documents/migrate.md @@ -2,7 +2,7 @@ title: 'migrate - CLI command' description: 'Creates a migrations file or runs migrations from the migrations file. - - Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest) + - Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest) - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.' --- @@ -10,7 +10,7 @@ description: Creates a migrations file or runs migrations from the migrations file. -- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest) +- Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest) - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists. ## Usage @@ -35,16 +35,16 @@ Update all Nx plugins to "9.0.0". This will generate migrations.json: nx migrate 9.0.0 ``` -Update @nrwl/workspace and generate the list of migrations starting with version 8.0.0 of @nrwl/workspace and @nrwl/node, regardless of what is installed locally: +Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node, regardless of what is installed locally: ```shell - nx migrate @nrwl/workspace@9.0.0 --from="@nrwl/workspace@8.0.0,@nrwl/node@8.0.0" + nx migrate @nx/workspace@9.0.0 --from="@nx/workspace@8.0.0,@nx/node@8.0.0" ``` -Update @nrwl/workspace to "9.0.0". If it tries to update @nrwl/react or @nrwl/angular, use version "9.0.1": +Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1": ```shell - nx migrate @nrwl/workspace@9.0.0 --to="@nrwl/react@9.0.1,@nrwl/angular@9.0.1" + nx migrate @nx/workspace@9.0.0 --to="@nx/react@9.0.1,@nx/angular@9.0.1" ``` Update another-package to "12.0.0". This will update other packages and will generate migrations.json file: @@ -107,7 +107,7 @@ Exclude migrations that should have been applied on previous updates. To be used Type: `string` -Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nrwl/react@12.0.0,@nrwl/js@12.0.0") +Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@12.0.0,@nx/js@12.0.0") ### help @@ -135,7 +135,7 @@ Enable prompts to confirm whether to collect optional package updates and migrat Type: `string` -The target package and version (e.g, @nrwl/workspace@13.0.0) +The target package and version (e.g, @nx/workspace@13.0.0) ### runMigrations @@ -147,7 +147,7 @@ Execute migrations from a file (when the file isn't provided, execute migrations Type: `string` -Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nrwl/react@12.0.0,@nrwl/js@12.0.0") +Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@12.0.0,@nx/js@12.0.0") ### version diff --git a/docs/generated/packages/nx/documents/workspace-generator.md b/docs/generated/packages/nx/documents/workspace-generator.md index edb0b80d3f48a..f4d590973825c 100644 --- a/docs/generated/packages/nx/documents/workspace-generator.md +++ b/docs/generated/packages/nx/documents/workspace-generator.md @@ -31,7 +31,7 @@ Preview the changes without updating files Type: `string` -Name of the generator (e.g., @nrwl/js:library, library) +Name of the generator (e.g., @nx/js:library, library) ### help diff --git a/docs/generated/packages/plugin/documents/overview.md b/docs/generated/packages/plugin/documents/overview.md index c0606a5df9667..c685286f1b64b 100644 --- a/docs/generated/packages/plugin/documents/overview.md +++ b/docs/generated/packages/plugin/documents/overview.md @@ -4,7 +4,7 @@ At its core, a generator is a function that creates or modifies code and an exec > A list of plugins that is maintained by Nrwl is found in the [Nrwl/nx repo](https://github.com/nrwl/nx/tree/master/packages). \ > A list of custom plugins created by the community is found in the [Community](/community) section. -> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nrwl_devkit) for more information.** +> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nx_devkit) for more information.** {% youtube src="https://www.youtube.com/embed/fC1-4fAZDP4" @@ -25,7 +25,7 @@ This command creates a brand-new workspace, and sets up a pre-configured plugin > Note, the command above will create a plugin with the package name set to `@my-org/my-plugin`. You can pass `--importPath` to provide a different package name. -> If you do not want to create a new workspace, install the `@nrwl/nx-plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nrwl/nx-plugin:plugin [pluginName]`. +> If you do not want to create a new workspace, install the `@nx/plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nx/plugin:plugin [pluginName]`. A new plugin is created with a default generator, executor, and e2e app. @@ -51,7 +51,7 @@ The `schema.d.ts` file is used for type checking inside the implementation file. ### Adding more generators To add more generators to the plugin, run the following command: -`nx generate @nrwl/nx-plugin:generator [generatorName] --project=[pluginName]`. +`nx generate @nx/plugin:generator [generatorName] --project=[pluginName]`. This will scaffold out a new generator and update the necessary files to support it. @@ -76,7 +76,7 @@ The default executor is set up to just emit a console log. Some examples of what ### Adding more executors To add more executors to the plugin, run the following command: -`nx generate @nrwl/nx-plugin:executor [executor] --project=[pluginName]`. +`nx generate @nx/plugin:executor [executor] --project=[pluginName]`. This will scaffold out a new generator and update the necessary files to support it. @@ -117,7 +117,7 @@ it('should create my-plugin', async (done) => { - The `ensureNxProject` is the function that will create the temporary directory. It takes two arguments, the plugin package name and the dist directory of when it's built. - The `runNxCommandAsync` will execute a `nx` command in the E2E directory. -There are additional functions that the `@nrwl/nx-plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory. +There are additional functions that the `@nx/plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory. ## Including Assets @@ -127,7 +127,7 @@ To make sure that assets are copied to the dist folder, open the plugin's `proje ```jsonc {% fileName="project.json" %} "build": { - "executor": "@nrwl/node:package", + "executor": "@nx/node:package", "options": { // shortened... "assets": [ diff --git a/docs/generated/packages/react-native/documents/overview.md b/docs/generated/packages/react-native/documents/overview.md index 4c58fdabd4ded..87eba3d362465 100644 --- a/docs/generated/packages/react-native/documents/overview.md +++ b/docs/generated/packages/react-native/documents/overview.md @@ -28,20 +28,20 @@ npx create-nx-workspace your-workspace-name ### Adding React Native to an Existing Workspace -For existing Nx workspaces, install the `@nrwl/react-native` package to add React Native capabilities to it. +For existing Nx workspaces, install the `@nx/react-native` package to add React Native capabilities to it. {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/react-native +npm i --save-dev @nx/react-native ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/react-native +yarn add --dev @nx/react-native ``` {% /tab %} @@ -52,7 +52,7 @@ yarn add --dev @nrwl/react-native To create additional React Native apps run: ```shell -nx g @nrwl/react-native:app +nx g @nx/react-native:app ``` ### Generating Libraries @@ -60,7 +60,7 @@ nx g @nrwl/react-native:app To generate a new library run: ```shell -nx g @nrwl/react-native:lib your-lib-name +nx g @nx/react-native:lib your-lib-name ``` ### Generating Components @@ -68,7 +68,7 @@ nx g @nrwl/react-native:lib your-lib-name To generate a new component inside library run: ```shell -nx g @nrwl/react-native:component your-component-name --project=your-lib-name --export +nx g @nx/react-native:component your-component-name --project=your-lib-name --export ``` Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json` @@ -82,7 +82,7 @@ The Nx CLI provides the [`migrate` command](/core-features/automate-updating-dep To upgrade native iOS and Android code to latest, you can use the [upgrade-native](/packages/react-native/generators/upgrade-native) generator: ```shell -nx generate @nrwl/react-native:upgrade-native +nx generate @nx/react-native:upgrade-native ``` This is a command that will replace the iOS and Android native code folder entirely. diff --git a/docs/generated/packages/react-native/executors/build-android.json b/docs/generated/packages/react-native/executors/build-android.json index a3589d9e8f8f2..cdac5b307debc 100644 --- a/docs/generated/packages/react-native/executors/build-android.json +++ b/docs/generated/packages/react-native/executors/build-android.json @@ -90,7 +90,7 @@ } }, "required": [], - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:build-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build with custom tasks\" %}\nThe `tasks` option accepts any custom gradle task, such as `assembleDebug`, `assembleRelease`, `bundleDebug`, `bundleRelease`, `installDebug`, `installRelease`.\nFor example, pass in `bundleRelease` or `bundleRelease` to tasks, it will create with `.aab` extension under bundle folder.\nPass in `assembleDebug` or `assembleRelease` to tasks, it will create a build with `.apk` extension under apk folder.\nPass in `installDebug` or `installRelease` to tasks, it will create a build with `.apk` extension and immediately install it on a running emulator or connected device.\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"tasks\": [\"bundleRelease\"]\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Build for debug/release\" %}\n\nThe `mode` option allows you determine whether to build for debug/release apk.\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"mode\": \"debug\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Build for current device architecture\" %}\n\nThe `activeArchOnly` option allows you to build native libraries only for the current device architecture for debug builds.\n\n```json\n \"build-android\": {\n \"executor\": \"@nrwl/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"activeArchOnly\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-android\": {\n \"executor\": \"@nx/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:build-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build with custom tasks\" %}\nThe `tasks` option accepts any custom gradle task, such as `assembleDebug`, `assembleRelease`, `bundleDebug`, `bundleRelease`, `installDebug`, `installRelease`.\nFor example, pass in `bundleRelease` or `bundleRelease` to tasks, it will create with `.aab` extension under bundle folder.\nPass in `assembleDebug` or `assembleRelease` to tasks, it will create a build with `.apk` extension under apk folder.\nPass in `installDebug` or `installRelease` to tasks, it will create a build with `.apk` extension and immediately install it on a running emulator or connected device.\n\n```json\n \"build-android\": {\n \"executor\": \"@nx/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"tasks\": [\"bundleRelease\"]\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Build for debug/release\" %}\n\nThe `mode` option allows you determine whether to build for debug/release apk.\n\n```json\n \"build-android\": {\n \"executor\": \"@nx/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"mode\": \"debug\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Build for current device architecture\" %}\n\nThe `activeArchOnly` option allows you to build native libraries only for the current device architecture for debug builds.\n\n```json\n \"build-android\": {\n \"executor\": \"@nx/react-native:build-android\",\n \"outputs\": [\n \"{projectRoot}/build/outputs/bundle\",\n \"{projectRoot}/build/outputs/apk\"\n ],\n \"options\": {\n \"activeArchOnly\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" }, "description": "Release Build for Android.", "aliases": [], diff --git a/docs/generated/packages/react-native/executors/build-ios.json b/docs/generated/packages/react-native/executors/build-ios.json index 278fc6a6669f3..23e140b428acf 100644 --- a/docs/generated/packages/react-native/executors/build-ios.json +++ b/docs/generated/packages/react-native/executors/build-ios.json @@ -96,7 +96,7 @@ } }, "required": [], - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:build-ios\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build in Specific Location\" %}\nThe `buildFolder` option allows to specify the location for ios build artifacts. It corresponds to Xcode's -derivedDataPath.\n\n```json\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {\n \"buildFolder\": \"dist/ios/build\"\n }\n }\n```\n\n```bash\nnx build-ios --buildFolder=dist/ios/build\n```\n\n{% /tab %}\n{% tab label=\"Build the Debug/Release app\" %}\nThe `mode` option allows to specify the xcode configuartion, such as `Debug` or `Release`.\n\n```json\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {\n \"mode\": \"Release\"\n }\n }\n```\n\n```bash\nnx build-ios --mode=Debug\nnx build-ios --mode=Release\n```\n\n{% /tab %}\n{% tab label=\"Build for a simulator\" %}\nThe `simulator` option allows you to launch your iOS app in a specific simulator:\n\nTo see all the available simulators, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {\n \"simulator\": \"iPhone 14 Pro\"\n }\n }\n```\n\n```bash\nnx build-ios --simulator=\"iPhone 14 Pro\"\n```\n\n{% /tab %}\n{% tab label=\"Build for a device\" %}\nThe `device` option allows you to launch your iOS app in a specific device.\n\nTo see all the available device, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {\n \"device\": \"deviceName\"\n }\n }\n```\n\n```bash\nnx build-ios --device=\"deviceName\"\n```\n\n{% /tab %}\n{% tab label=\"Set Device by udid\" %}\nThe `udid` option allows you to explicitly set device to use by udid.\n\nTo see all the available simulators and devices with udid, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nrwl/react-native:build-ios\",\n \"options\": {\n \"udid\": \"device udid\"\n }\n }\n```\n\n```bash\nnx build-ios --udid=\"device udid\"\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:build-ios\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build in Specific Location\" %}\nThe `buildFolder` option allows to specify the location for ios build artifacts. It corresponds to Xcode's -derivedDataPath.\n\n```json\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {\n \"buildFolder\": \"dist/ios/build\"\n }\n }\n```\n\n```bash\nnx build-ios --buildFolder=dist/ios/build\n```\n\n{% /tab %}\n{% tab label=\"Build the Debug/Release app\" %}\nThe `mode` option allows to specify the xcode configuartion, such as `Debug` or `Release`.\n\n```json\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {\n \"mode\": \"Release\"\n }\n }\n```\n\n```bash\nnx build-ios --mode=Debug\nnx build-ios --mode=Release\n```\n\n{% /tab %}\n{% tab label=\"Build for a simulator\" %}\nThe `simulator` option allows you to launch your iOS app in a specific simulator:\n\nTo see all the available simulators, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {\n \"simulator\": \"iPhone 14 Pro\"\n }\n }\n```\n\n```bash\nnx build-ios --simulator=\"iPhone 14 Pro\"\n```\n\n{% /tab %}\n{% tab label=\"Build for a device\" %}\nThe `device` option allows you to launch your iOS app in a specific device.\n\nTo see all the available device, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {\n \"device\": \"deviceName\"\n }\n }\n```\n\n```bash\nnx build-ios --device=\"deviceName\"\n```\n\n{% /tab %}\n{% tab label=\"Set Device by udid\" %}\nThe `udid` option allows you to explicitly set device to use by udid.\n\nTo see all the available simulators and devices with udid, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"build-ios\": {\n \"executor\": \"@nx/react-native:build-ios\",\n \"options\": {\n \"udid\": \"device udid\"\n }\n }\n```\n\n```bash\nnx build-ios --udid=\"device udid\"\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" }, "description": "Build iOS app", "aliases": [], diff --git a/docs/generated/packages/react-native/executors/bundle.json b/docs/generated/packages/react-native/executors/bundle.json index ab66fe2ace182..4e04660f68d58 100644 --- a/docs/generated/packages/react-native/executors/bundle.json +++ b/docs/generated/packages/react-native/executors/bundle.json @@ -79,7 +79,7 @@ } }, "required": ["platform", "entryFile", "bundleOutput"], - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"outputs\": [\"{projectRoot}/build\"],\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\"\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\"\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:bundle-ios\nnx run mobile:bundle-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Bundle with sourcemap\" %}\nThe `sourcemapOutput` option allows you to specify the path of the source map relative to app folder:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/ios/main.map\",\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/android/main.map\",\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a dev/release bundle\" %}\n\nThe `dev` option determines whether to create a dev or release bundle. The default value is `true`, by setting it as `false`, warnings are disabled and the bundle is minified.\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"dev\": false\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"dev\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a minified bundle\" %}\n\nThe `minify` option allows you to create a minified bundle:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"minify\": true\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nrwl/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"minify\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"bundle-ios\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"outputs\": [\"{projectRoot}/build\"],\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\"\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\"\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:bundle-ios\nnx run mobile:bundle-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Bundle with sourcemap\" %}\nThe `sourcemapOutput` option allows you to specify the path of the source map relative to app folder:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/ios/main.map\",\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"sourcemapOutput\": \"../../dist/apps/mobile/android/main.map\",\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a dev/release bundle\" %}\n\nThe `dev` option determines whether to create a dev or release bundle. The default value is `true`, by setting it as `false`, warnings are disabled and the bundle is minified.\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"dev\": false\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"dev\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Create a minified bundle\" %}\n\nThe `minify` option allows you to create a minified bundle:\n\n```json\n \"bundle-ios\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"ios\",\n \"bundleOutput\": \"dist/apps/mobile/ios/main.jsbundle\",\n \"minify\": true\n }\n },\n \"bundle-android\": {\n \"executor\": \"@nx/react-native:bundle\",\n \"options\": {\n \"entryFile\": \"src/main.tsx\",\n \"platform\": \"android\",\n \"bundleOutput\": \"dist/apps/mobile/android/main.jsbundle\",\n \"minify\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" }, "description": "Builds the JavaScript bundle for offline use.", "aliases": [], diff --git a/docs/generated/packages/react-native/executors/run-android.json b/docs/generated/packages/react-native/executors/run-android.json index 1b461d2277e8e..1f64e92ced64d 100644 --- a/docs/generated/packages/react-native/executors/run-android.json +++ b/docs/generated/packages/react-native/executors/run-android.json @@ -113,7 +113,7 @@ "default": false } }, - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the avaiable emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `mode` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nrwl/react-native:run-android\",\n \"options\": {\n \"mode\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the avaiable emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `mode` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"mode\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" }, "description": "Runs Android application.", "aliases": [], diff --git a/docs/generated/packages/react-native/executors/run-ios.json b/docs/generated/packages/react-native/executors/run-ios.json index fb43a832ede14..9d15c0501dffb 100644 --- a/docs/generated/packages/react-native/executors/run-ios.json +++ b/docs/generated/packages/react-native/executors/run-ios.json @@ -109,7 +109,7 @@ "description": "Path relative to project root where pre-built .app binary lives." } }, - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-ios\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build the Debug/Release app\" %}\nThe `mode` option allows to specify the xcode configuartion schema, such as `Debug` or `Release`.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"mode\": \"Release\"\n }\n }\n```\n\n```bash\nnx run-ios --mode=Debug\n```\n\n{% /tab %}\n{% tab label=\"Run on a simulator\" %}\nThe `simulator` option allows you to launch your iOS app in a specific simulator.\n\nTo see all the available simulators, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"simulator\": \"iPhone 14 Pro (16.2)\"\n }\n }\n```\n\n```bash\nnx run-ios --simulator=\"iPhone 14 Pro (16.2)\"\n```\n\n{% /tab %}\n{% tab label=\"Run on a device\" %}\nThe `device` option allows you to launch your iOS app in a specific device.\n\nTo see all the available devices, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"device\": \"deviceName\"\n }\n }\n```\n\n```bash\nnx run-ios --device=\"deviceName\"\n```\n\n{% /tab %}\n{% tab label=\"Set Device by udid\" %}\nThe `udid` option allows you to explicitly set device to use by udid.\n\nTo see all the available simulators and devices with udid, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nrwl/react-native:run-ios\",\n \"options\": {\n \"udid\": \"device udid\"\n }\n }\n```\n\n```bash\nnx run-ios --udid=\"device udid\"\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-ios\": {\n \"executor\": \"@nx/react-native:run-ios\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-ios\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Build the Debug/Release app\" %}\nThe `mode` option allows to specify the xcode configuartion schema, such as `Debug` or `Release`.\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/react-native:run-ios\",\n \"options\": {\n \"mode\": \"Release\"\n }\n }\n```\n\n```bash\nnx run-ios --mode=Debug\n```\n\n{% /tab %}\n{% tab label=\"Run on a simulator\" %}\nThe `simulator` option allows you to launch your iOS app in a specific simulator.\n\nTo see all the available simulators, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/react-native:run-ios\",\n \"options\": {\n \"simulator\": \"iPhone 14 Pro (16.2)\"\n }\n }\n```\n\n```bash\nnx run-ios --simulator=\"iPhone 14 Pro (16.2)\"\n```\n\n{% /tab %}\n{% tab label=\"Run on a device\" %}\nThe `device` option allows you to launch your iOS app in a specific device.\n\nTo see all the available devices, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/react-native:run-ios\",\n \"options\": {\n \"device\": \"deviceName\"\n }\n }\n```\n\n```bash\nnx run-ios --device=\"deviceName\"\n```\n\n{% /tab %}\n{% tab label=\"Set Device by udid\" %}\nThe `udid` option allows you to explicitly set device to use by udid.\n\nTo see all the available simulators and devices with udid, run command:\n\n```bash\nxcrun simctl list devices available\n```\n\n```json\n \"run-ios\": {\n \"executor\": \"@nx/react-native:run-ios\",\n \"options\": {\n \"udid\": \"device udid\"\n }\n }\n```\n\n```bash\nnx run-ios --udid=\"device udid\"\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n" }, "description": "Runs iOS application.", "aliases": [], diff --git a/docs/generated/packages/react-native/executors/start.json b/docs/generated/packages/react-native/executors/start.json index 2824c8238064e..eed219391d3c1 100644 --- a/docs/generated/packages/react-native/executors/start.json +++ b/docs/generated/packages/react-native/executors/start.json @@ -27,7 +27,7 @@ "default": true } }, - "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Starts the server non-interactively\" %}\nThe `interactive` option allows you to specify whether to use interactive mode:\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"interactive\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `resetCache` option allows you to remove cached files.\n\n```json\n \"start\": {\n \"executor\": \"@nrwl/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"resetCache\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"start\": {\n \"executor\": \"@nx/react-native:start\",\n \"options\": {\n \"port\": 8081\n }\n }\n }\n}\n```\n\n```bash\nnx run mobile:start\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Starts the server non-interactively\" %}\nThe `interactive` option allows you to specify whether to use interactive mode:\n\n```json\n \"start\": {\n \"executor\": \"@nx/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"interactive\": false\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Starts the server with cache reset\" %}\n\nThe `resetCache` option allows you to remove cached files.\n\n```json\n \"start\": {\n \"executor\": \"@nx/react-native:start\",\n \"options\": {\n \"port\": 8081,\n \"resetCache\": true\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Starts the Javascript server that communicates with connected devices.", diff --git a/docs/generated/packages/react/documents/overview.md b/docs/generated/packages/react/documents/overview.md index d2a5864d5c265..ef171ef6a4fcc 100644 --- a/docs/generated/packages/react/documents/overview.md +++ b/docs/generated/packages/react/documents/overview.md @@ -14,10 +14,10 @@ To add the React plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/react +npm install -D @nx/react # For yarn users -yarn add -D @nrwl/react +yarn add -D @nx/react ``` ### Creating Applications and Libraries @@ -25,7 +25,7 @@ yarn add -D @nrwl/react You can add a new application with the following: ```shell -nx g @nrwl/react:app my-new-app +nx g @nx/react:app my-new-app ``` To start the application in development mode, run `nx serve my-new-app`. @@ -33,12 +33,12 @@ To start the application in development mode, run `nx serve my-new-app`. And add a new library as follows: ```shell -nx g @nrwl/react:lib my-new-lib +nx g @nx/react:lib my-new-lib # If you want the library to be buildable or publishable to npm -nx g @nrwl/react:lib my-new-lib --bundler=vite -nx g @nrwl/react:lib my-new-lib --bundler=rollup -nx g @nrwl/react:lib my-new-lib \ +nx g @nx/react:lib my-new-lib --bundler=vite +nx g @nx/react:lib my-new-lib --bundler=rollup +nx g @nx/react:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` @@ -50,12 +50,12 @@ Read more about [building and publishing libraries here](/more-concepts/buildabl Adding a component to an existing project can be done with: ```shell -nx g @nrwl/react:component my-new-component \ +nx g @nx/react:component my-new-component \ --project=my-new-app # Note: If you want to export the component # from the library use --export -nx g @nrwl/react:component my-new-component \ +nx g @nx/react:component my-new-component \ --project=my-new-lib \ --export ``` @@ -67,7 +67,7 @@ Replace `my-new-app` and `my-new-lib` with the name of your projects. If you want to add a new hook, run the following ```shell -nx g @nrwl/react:hook my-new-hook --project=my-new-lib +nx g @nx/react:hook my-new-hook --project=my-new-lib ``` Replace `my-new-lib` with the name of your project. diff --git a/docs/generated/packages/react/generators/application.json b/docs/generated/packages/react/generators/application.json index db85a3656237d..1d345099545de 100644 --- a/docs/generated/packages/react/generators/application.json +++ b/docs/generated/packages/react/generators/application.json @@ -186,7 +186,7 @@ } }, "required": [], - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nrwl/react:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nrwl/react:app my-app --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nrwl/react:app my-app --directory=my-dir --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nrwl/react:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:app my-app --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nx/react:app my-app --directory=my-dir --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/react:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "aliases": ["app"], diff --git a/docs/generated/packages/react/generators/component-test.json b/docs/generated/packages/react/generators/component-test.json index 9bf407b5c221c..85054c027f8b0 100644 --- a/docs/generated/packages/react/generators/component-test.json +++ b/docs/generated/packages/react/generators/component-test.json @@ -30,7 +30,7 @@ } }, "required": ["project", "componentPath"], - "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nReact component testing with Nx requires **Cypress version 10** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you're wanting to create Cypress tests for a Storybook story, then check out the [component-cypress-spec generator docs](/packages/react/generators/component-cypress-spec)\n\nIf you're wanting to create Storybook stories for a component, then check out the [stories generator docs](/packages/react/generators/stories) or [component-story generator docs](/packages/react/generators/component-cypress-spec)\n\n{% /callout %}\n\nThis generator is used to create a Cypress component test file for a given React component.\n\n```shell\nnx g @nrwl/react:component-test --project=my-cool-react-project --componentPath=src/my-fancy-button.tsx\n```\n\nTest file are generated with the `.cy.` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project.\n\nIt's currently expected the generated `.cy.` file will live side by side with the component. It is also assumed the project is already setup for component testing. If it isn't, then you can run the [cypress-component-project generator](/packages/react/generators/cypress-component-configuration) to set up the project for component testing.\n", + "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nReact component testing with Nx requires **Cypress version 10** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you're wanting to create Cypress tests for a Storybook story, then check out the [component-cypress-spec generator docs](/packages/react/generators/component-cypress-spec)\n\nIf you're wanting to create Storybook stories for a component, then check out the [stories generator docs](/packages/react/generators/stories) or [component-story generator docs](/packages/react/generators/component-cypress-spec)\n\n{% /callout %}\n\nThis generator is used to create a Cypress component test file for a given React component.\n\n```shell\nnx g @nx/react:component-test --project=my-cool-react-project --componentPath=src/my-fancy-button.tsx\n```\n\nTest file are generated with the `.cy.` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project.\n\nIt's currently expected the generated `.cy.` file will live side by side with the component. It is also assumed the project is already setup for component testing. If it isn't, then you can run the [cypress-component-project generator](/packages/react/generators/cypress-component-configuration) to set up the project for component testing.\n", "presets": [] }, "description": "Generate a Cypress component test for a React component", diff --git a/docs/generated/packages/react/generators/cypress-component-configuration.json b/docs/generated/packages/react/generators/cypress-component-configuration.json index c076ea07f1722..de9af1f65a477 100644 --- a/docs/generated/packages/react/generators/cypress-component-configuration.json +++ b/docs/generated/packages/react/generators/cypress-component-configuration.json @@ -53,7 +53,7 @@ } }, "required": ["project"], - "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nReact component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/react/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your React project up and running with Cypress Component Testing.\n\n```shell\nnx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\nThe following file will be added to projects where the Component Testing build target is using `webpack` for bundling:\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename, {\n bundler: 'webpack',\n }),\n});\n```\n\nThe following file will be added to projects where the Component Testing build target is using `vite` for bundling:\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename, {\n bundler: 'vite',\n }),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename, {\n bundler: 'webpack',\n }),\n // extra options here\n },\n});\n```\n\n## The `bundler` option\n\nComponent testing supports two different bundlers: `webpack` and `vite`. The Nx generator will pick up the bundler used in the specified project's build target. If the build target is using `@nrwl/webpack:webpack`, then the generator will use `webpack` as the bundler. If the build target is using `@nrwl/vite:build`, then the generator will use `vite` as the bundler.\n\nYou can manually set the bundler by passing `--bundler=webpack` or `--bundler=vite` to the generator, but that is not needed since the generator will pick up the correct bundler for you. However, if you want to use a different bundler than the one that is used in the build target, then you can manually set it using that flag.\n\n## Specifying a Build Target\n\nComponent testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-react-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided.\n\nFor React projects, the build target needs to be using the `@nrwl/webpack:webpack` executor.\nThe generator will throw an error if a build target can't be found and suggest passing one in manually.\n\nLetting Nx infer the build target by default\n\n```shell\nnx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project\n```\n\nManually specifying the build target\n\n```shell\nnx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project --build-target:some-react-app:build --generate-tests\n```\n\n{% callout type=\"note\" title=\"Build Target with Configuration\" %}\nIf you're wanting to use a build target with a specific configuration. i.e. `my-app:build:production`,\nthen manually providing `--build-target=my-app:build:production` is the best way to do that.\n{% /callout %}\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-react-project\n```\n\nHere is an example of the project configuration that is generated. The `--build-target` option is added as the `devServerTarget` which can be changed as needed.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"/cypress.config.ts\",\n \"testingType\": \"component\",\n \"devServerTarget\": \"some-react-app:build\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [Angular component testing](/packages/angular/generators/cypress-component-configuration).\n", + "examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nReact component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-10 generator](/packages/cypress/generators/migrate-to-cypress-10).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/react/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your React project up and running with Cypress Component Testing.\n\n```shell\nnx g @nx/react:cypress-component-configuration --project=my-cool-react-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\nThe following file will be added to projects where the Component Testing build target is using `webpack` for bundling:\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/react/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename, {\n bundler: 'webpack',\n }),\n});\n```\n\nThe following file will be added to projects where the Component Testing build target is using `vite` for bundling:\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/react/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename, {\n bundler: 'vite',\n }),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/react/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename, {\n bundler: 'webpack',\n }),\n // extra options here\n },\n});\n```\n\n## The `bundler` option\n\nComponent testing supports two different bundlers: `webpack` and `vite`. The Nx generator will pick up the bundler used in the specified project's build target. If the build target is using `@nx/webpack:webpack`, then the generator will use `webpack` as the bundler. If the build target is using `@nx/vite:build`, then the generator will use `vite` as the bundler.\n\nYou can manually set the bundler by passing `--bundler=webpack` or `--bundler=vite` to the generator, but that is not needed since the generator will pick up the correct bundler for you. However, if you want to use a different bundler than the one that is used in the build target, then you can manually set it using that flag.\n\n## Specifying a Build Target\n\nComponent testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-react-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided.\n\nFor React projects, the build target needs to be using the `@nx/webpack:webpack` executor.\nThe generator will throw an error if a build target can't be found and suggest passing one in manually.\n\nLetting Nx infer the build target by default\n\n```shell\nnx g @nx/react:cypress-component-configuration --project=my-cool-react-project\n```\n\nManually specifying the build target\n\n```shell\nnx g @nx/react:cypress-component-configuration --project=my-cool-react-project --build-target:some-react-app:build --generate-tests\n```\n\n{% callout type=\"note\" title=\"Build Target with Configuration\" %}\nIf you're wanting to use a build target with a specific configuration. i.e. `my-app:build:production`,\nthen manually providing `--build-target=my-app:build:production` is the best way to do that.\n{% /callout %}\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nx/react:cypress-component-configuration --project=my-cool-react-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-react-project\n```\n\nHere is an example of the project configuration that is generated. The `--build-target` option is added as the `devServerTarget` which can be changed as needed.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"/cypress.config.ts\",\n \"testingType\": \"component\",\n \"devServerTarget\": \"some-react-app:build\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [Angular component testing](/packages/angular/generators/cypress-component-configuration).\n", "presets": [] }, "description": "Setup Cypress component testing for a React project", diff --git a/docs/generated/packages/react/generators/stories.json b/docs/generated/packages/react/generators/stories.json index 75d9a9b5d50b0..76138b57a15aa 100644 --- a/docs/generated/packages/react/generators/stories.json +++ b/docs/generated/packages/react/generators/stories.json @@ -52,7 +52,7 @@ } }, "required": ["project"], - "examplesFile": "This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/).\n\n```bash\nnx g @nrwl/react:stories project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#auto-generate-stories).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nrwl/react:stories --name=ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*\n```\n\nThis will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate stories using JavaScript instead of TypeScript\n\n```bash\nnx g @nrwl/react:stories --name=ui --js=true\n```\n\nThis will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components.\n", + "examplesFile": "This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/).\n\n```bash\nnx g @nx/react:stories project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#auto-generate-stories).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nx/react:stories --name=ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*\n```\n\nThis will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate stories using JavaScript instead of TypeScript\n\n```bash\nnx g @nx/react:stories --name=ui --js=true\n```\n\nThis will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components.\n", "presets": [] }, "description": "Create stories/specs for all components declared in an app or library.", diff --git a/docs/generated/packages/react/generators/storybook-configuration.json b/docs/generated/packages/react/generators/storybook-configuration.json index 561d62618d2b7..b80edd51e70b2 100644 --- a/docs/generated/packages/react/generators/storybook-configuration.json +++ b/docs/generated/packages/react/generators/storybook-configuration.json @@ -96,7 +96,7 @@ } }, "required": ["name"], - "examplesFile": "This generator will set up Storybook for your **React** project. You can also use this generator to generate Storybook configuration for your **Next.js** project.\n\n```bash\nnx g @nrwl/react:storybook-configuration project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#generate-storybook-configuration-for-an-react-project).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance. You can read more about this in the [Storybook for React - Cypress section](/packages/storybook/documents/overview-react#cypress-tests-for-stories).\n- Whether you want to `generateStories` for the components in your project. If you choose `yes`, a `.stories.ts` file will be generated next to each of your components in your project.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nrwl/react:storybook-configuration ui --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nrwl/react:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts\n```\n\nThis will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate stories using JavaScript instead of TypeScript\n\n```bash\nnx g @nrwl/react:storybook-configuration ui --generateStories=true --js=true\n```\n\nThis will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components.\n\n### Generate Storybook configuration for Storybook version 7\n\n```bash\nnx g @nrwl/react:storybook-configuration ui --storybook7Configuration=true\n```\n\n{% callout type=\"info\" title=\"For Nx versions <15.9\" %}\nThe flag is called `storybook7betaConfiguration` for Nx versions <15.9.\n{% /callout %}\n\nThis will generate a Storybook configuration for the `ui` project using Storybook version 7. It will install the Storybook version 7 dependencies and configure the Storybook configuration files (the files inside the `.storybook` directory) to use Storybook version 7. You can read more about Storybook 7 Nx support in the [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n", + "examplesFile": "This generator will set up Storybook for your **React** project. You can also use this generator to generate Storybook configuration for your **Next.js** project.\n\n```bash\nnx g @nx/react:storybook-configuration project-name\n```\n\nYou can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#generate-storybook-configuration-for-an-react-project).\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance. You can read more about this in the [Storybook for React - Cypress section](/packages/storybook/documents/overview-react#cypress-tests-for-stories).\n- Whether you want to `generateStories` for the components in your project. If you choose `yes`, a `.stories.ts` file will be generated next to each of your components in your project.\n- Whether you want to `generateCypressSpecs`. If you choose `yes`, a test file is going to be generated in the project's Cypress e2e app for each of your components.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` for the generator to work.\n\nThere are a number of other options available. Let's take a look at some examples.\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nx/react:storybook-configuration ui --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Ignore certain paths when generating stories\n\n```bash\nnx g @nx/react:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts\n```\n\nThis will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`.\n\nThis is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.\n\n### Generate stories using JavaScript instead of TypeScript\n\n```bash\nnx g @nx/react:storybook-configuration ui --generateStories=true --js=true\n```\n\nThis will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components.\n\n### Generate Storybook configuration for Storybook version 7\n\n```bash\nnx g @nx/react:storybook-configuration ui --storybook7Configuration=true\n```\n\n{% callout type=\"info\" title=\"For Nx versions <15.9\" %}\nThe flag is called `storybook7betaConfiguration` for Nx versions <15.9.\n{% /callout %}\n\nThis will generate a Storybook configuration for the `ui` project using Storybook version 7. It will install the Storybook version 7 dependencies and configure the Storybook configuration files (the files inside the `.storybook` directory) to use Storybook version 7. You can read more about Storybook 7 Nx support in the [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n", "presets": [] }, "description": "Set up storybook for a React app or library.", diff --git a/docs/generated/packages/rollup/executors/rollup.json b/docs/generated/packages/rollup/executors/rollup.json index 4ef8bb285a84d..f72a7dc07be63 100644 --- a/docs/generated/packages/rollup/executors/rollup.json +++ b/docs/generated/packages/rollup/executors/rollup.json @@ -185,7 +185,7 @@ ] } }, - "examplesFile": "{% tabs %}\n{% tab label=\"Including Dependencies\" %}\nTo include dependencies in the output `package.json`, the dependencies must be installed as a **dependencies** in the root `package.json`\n\n```json {% fileName=\"package.json\" %}\n{\n \"dependencies\": {\n \"some-dependency\": \"^1.0.0\"\n }\n}\n```\n\nTo have dependencies in the be listed in the final `package.json` of your project, set the `updateBuildableProjectDepsInPackageJson` option to `true`. After than dependencies will be added to the `peerDependencies` field of the output `package.json`. You can use `buildableProjectDepsInPackageJsonType` option to change which field the dependencies are output to.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\": {\n \"build\": {\n \"executor\": \"@nrwl/rollup:rollup\",\n \"options\": {\n \"buildableProjectDepsInPackageJsonType\": \"dependencies\",\n \"updateBuildableProjectDepsInPackageJson\": true\n }\n }\n }\n}\n```\n\n{% /tab}\n{% /tabs %}\n" + "examplesFile": "{% tabs %}\n{% tab label=\"Including Dependencies\" %}\nTo include dependencies in the output `package.json`, the dependencies must be installed as a **dependencies** in the root `package.json`\n\n```json {% fileName=\"package.json\" %}\n{\n \"dependencies\": {\n \"some-dependency\": \"^1.0.0\"\n }\n}\n```\n\nTo have dependencies in the be listed in the final `package.json` of your project, set the `updateBuildableProjectDepsInPackageJson` option to `true`. After than dependencies will be added to the `peerDependencies` field of the output `package.json`. You can use `buildableProjectDepsInPackageJsonType` option to change which field the dependencies are output to.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\": {\n \"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n \"buildableProjectDepsInPackageJsonType\": \"dependencies\",\n \"updateBuildableProjectDepsInPackageJson\": true\n }\n }\n }\n}\n```\n\n{% /tab}\n{% /tabs %}\n" }, "description": "Bundle a package using Rollup.", "aliases": [], diff --git a/docs/generated/packages/storybook/documents/angular-browser-target.md b/docs/generated/packages/storybook/documents/angular-browser-target.md index 62dcfe098d8ec..9c4537da40e21 100644 --- a/docs/generated/packages/storybook/documents/angular-browser-target.md +++ b/docs/generated/packages/storybook/documents/angular-browser-target.md @@ -52,7 +52,7 @@ Your Storybook targets in your `project.json` will look like this: ```jsonc {% fileName="project.json" %} "storybook": { - "executor": "@nrwl/storybook:storybook", + "executor": "@nx/storybook:storybook", "options": { ... "projectBuildConfig": "my-project:build-storybook" @@ -60,7 +60,7 @@ Your Storybook targets in your `project.json` will look like this: ... }, "build-storybook": { - "executor": "@nrwl/storybook:build", + "executor": "@nx/storybook:build", ... "options": { ... diff --git a/docs/generated/packages/storybook/documents/angular-storybook-compodoc.md b/docs/generated/packages/storybook/documents/angular-storybook-compodoc.md index defc5e8fd808f..9ba52a8ff1c4d 100644 --- a/docs/generated/packages/storybook/documents/angular-storybook-compodoc.md +++ b/docs/generated/packages/storybook/documents/angular-storybook-compodoc.md @@ -141,7 +141,7 @@ Make sure you are on Nx version `>=14.1.8` and your `storybook` target is using If you are using an older version of Nx, you can use [`nx migrate`](/packages/nx/documents/migrate) to migrate your codebase to a later version. Using `nx migrate` will also make sure to update your `storybook` and `build-storybook` targets to match the new format. -If you **are** on Nx `>=14.1.8` and you are still using the old executor (`@nrwl/storybook:storybook`), you can read our documentation about the [Angular Storybook targets](/packages/storybook/documents/angular-storybook-targets) to help you change your `storybook` and `build-storybook` targets across your workspace for your Angular projects using Storybook. +If you **are** on Nx `>=14.1.8` and you are still using the old executor (`@nx/storybook:storybook`), you can read our documentation about the [Angular Storybook targets](/packages/storybook/documents/angular-storybook-targets) to help you change your `storybook` and `build-storybook` targets across your workspace for your Angular projects using Storybook. {% /callout %} ### 4. Let Storybook know of the `documentation.json` file diff --git a/docs/generated/packages/storybook/documents/angular-storybook-targets.md b/docs/generated/packages/storybook/documents/angular-storybook-targets.md index 10c195b283ef6..bebfe5e2caa39 100644 --- a/docs/generated/packages/storybook/documents/angular-storybook-targets.md +++ b/docs/generated/packages/storybook/documents/angular-storybook-targets.md @@ -20,9 +20,9 @@ If you are on Nx version `<14.1.8` and you want to move to the latest version (o If you have already moved on a version of Nx `>=14.1.8` without using `nx migrate` and now you are having trouble with your Angular projects using Storybook (eg. `Property 'uiFramework' does not match the schema. '@storybook/angular' should be one of ...`), that means that your targets are still using the old schema and they should change. The way to fix that is to call `nx migrate` again like this: ```bash -nx migrate @nrwl/storybook@14.1.0 --to="@nrwl/storybook@14.2.0" +nx migrate @nx/storybook@14.1.0 --to="@nx/storybook@14.2.0" ``` and follow the instructions that will be printed in the console. -This command will generate a new `migrations.json` file which will contain the "change-storybook-targets" migration script. This script (when called with `yarn nx migrate --run-migrations`) will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`). +This command will generate a new `migrations.json` file which will contain the "change-storybook-targets" migration script. This script (when called with `yarn nx migrate --run-migrations`) will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nx/storybook:build-storybook` and `@nx/storybook:storybook`). diff --git a/docs/generated/packages/storybook/documents/best-practices.md b/docs/generated/packages/storybook/documents/best-practices.md index 7fd0094b9fe86..07e5ffa035d92 100644 --- a/docs/generated/packages/storybook/documents/best-practices.md +++ b/docs/generated/packages/storybook/documents/best-practices.md @@ -31,7 +31,7 @@ First, let’s see what Nx offers, when you are in the process of developing a p #### Configuration generation -You can generate the Storybook configuration files and settings using the Nx [`@nrwl/storybook:configuration` generator](/packages/storybook/generators/configuration). You can read more about configuring Storybook with Nx in our [`@nrwl/storybook` package overview page](/packages/storybook#generating-storybook-configuration). With Nx, you configure Storybook for each individual project. +You can generate the Storybook configuration files and settings using the Nx [`@nx/storybook:configuration` generator](/packages/storybook/generators/configuration). You can read more about configuring Storybook with Nx in our [`@nx/storybook` package overview page](/packages/storybook#generating-storybook-configuration). With Nx, you configure Storybook for each individual project. #### Stories generation diff --git a/docs/generated/packages/storybook/documents/migrate-webpack-final-react.md b/docs/generated/packages/storybook/documents/migrate-webpack-final-react.md index 490f705b92ea0..de4ebf8e763e1 100644 --- a/docs/generated/packages/storybook/documents/migrate-webpack-final-react.md +++ b/docs/generated/packages/storybook/documents/migrate-webpack-final-react.md @@ -19,7 +19,7 @@ width="100%" /%} Here are the main differences to the previous versions of Nx: - there's no `webpack.config.js`; Custom webpack configurations can be added in the `webpackFinal` property of the `main.js` file -- the `main.js` file now contains a predefined Storybook addon exported by `@nrwl/react/plugins/storybook`. +- the `main.js` file now contains a predefined Storybook addon exported by `@nx/react/plugins/storybook`. Here's an example of a newly generated `main.js` file: @@ -41,7 +41,7 @@ module.exports = { '../src/lib/**/*.stories.mdx', '../src/lib/**/*.stories.@(js|jsx|ts|tsx)', ], - addons: [...rootMain.addons, '@nrwl/react/plugins/storybook'], + addons: [...rootMain.addons, '@nx/react/plugins/storybook'], webpackFinal: async (config, { configType }) => { // apply any global webpack configs that might have been specified in .storybook/main.js if (rootMain.webpackFinal) { @@ -193,7 +193,7 @@ module.exports = async ({ config, mode }) => { }; ``` -Such webpack file is no more needed as the `@nrwl/react/plugins/storybook` now takes care of it. +Such webpack file is no more needed as the `@nx/react/plugins/storybook` now takes care of it. In case you made custom modifications to the `webpack.config.js` file, you need to move them over to the `main.js` `webpackFinal` property and then delete the `webpack.config.js`. diff --git a/docs/generated/packages/storybook/documents/overview-angular.md b/docs/generated/packages/storybook/documents/overview-angular.md index 3357fca44e107..6745532ca332a 100644 --- a/docs/generated/packages/storybook/documents/overview-angular.md +++ b/docs/generated/packages/storybook/documents/overview-angular.md @@ -13,15 +13,15 @@ You first need to set up Storybook for your Nx workspace, if you haven't already ## Generate Storybook Configuration for an Angular project -You can generate Storybook configuration for an individual Angular project by using the [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration), like this: +You can generate Storybook configuration for an individual Angular project by using the [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration), like this: ```shell -nx g @nrwl/angular:storybook-configuration project-name +nx g @nx/angular:storybook-configuration project-name ``` ## Auto-generate Stories -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) has the option to automatically generate `*.stories.ts` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) has the option to automatically generate `*.stories.ts` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```text / @@ -29,10 +29,10 @@ The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/genera └── my.component.stories.ts ``` -If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nrwl/angular:stories` generator](/packages/angular/generators/stories): +If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nx/angular:stories` generator](/packages/angular/generators/stories): ```shell -nx g @nrwl/angular:stories --project= +nx g @nx/angular:stories --project= ``` {% callout type="note" title="Example" %} @@ -41,7 +41,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c The command to generate stories for that library would be: ```shell -nx g @nrwl/angular:stories --project=feature-ui +nx g @nx/angular:stories --project=feature-ui ``` and the result would be the following: @@ -75,7 +75,7 @@ and the result would be the following: ## Cypress tests for Stories -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. To launch Storybook and run the Cypress tests against the iframe inside of Storybook: @@ -99,7 +99,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c ### Story file -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) would generate a Story file that looks like this: +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) would generate a Story file that looks like this: ```typescript {% fileName="libs/feature/ui/src/lib/my-button/my-button.component.stories.ts" %} import { Meta } from '@storybook/angular'; diff --git a/docs/generated/packages/storybook/documents/overview-react.md b/docs/generated/packages/storybook/documents/overview-react.md index 2206993acccec..7f1056e356a98 100644 --- a/docs/generated/packages/storybook/documents/overview-react.md +++ b/docs/generated/packages/storybook/documents/overview-react.md @@ -13,27 +13,27 @@ You first need to set up Storybook for your Nx workspace, if you haven't already ## Generate Storybook Configuration for a React project -You can generate Storybook configuration for an individual React project by using the [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration), like this: +You can generate Storybook configuration for an individual React project by using the [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration), like this: ```shell -nx g @nrwl/react:storybook-configuration project-name +nx g @nx/react:storybook-configuration project-name ``` ## Nx React Storybook Preset -The [`@nrwl/react`](/packages/react) package ships with a Storybook addon to make sure it uses the very same configuration as your Nx React application. When you generate a Storybook configuration for a project, it'll automatically add the addon to your configuration. +The [`@nx/react`](/packages/react) package ships with a Storybook addon to make sure it uses the very same configuration as your Nx React application. When you generate a Storybook configuration for a project, it'll automatically add the addon to your configuration. ```typescript module.exports = { ... - addons: ['@storybook/addon-essentials', ..., '@nrwl/react/plugins/storybook'], + addons: ['@storybook/addon-essentials', ..., '@nx/react/plugins/storybook'], ... }; ``` ## Auto-generate Stories -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) has the option to automatically generate `*.stories.ts|tsx` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) has the option to automatically generate `*.stories.ts|tsx` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```text / @@ -41,10 +41,10 @@ The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators └── my-component.stories.tsx ``` -If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nrwl/react:stories` generator](/packages/react/generators/stories): +If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nx/react:stories` generator](/packages/react/generators/stories): ```shell -nx g @nrwl/react:stories --project= +nx g @nx/react:stories --project= ``` {% callout type="note" title="Example" %} @@ -53,7 +53,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c The command to generate stories for that library would be: ```shell -nx g @nrwl/react:stories --project=feature-ui +nx g @nx/react:stories --project=feature-ui ``` and the result would be the following: @@ -87,7 +87,7 @@ and the result would be the following: ## Cypress tests for Stories -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. To launch Storybook and run the Cypress tests against the iframe inside of Storybook: @@ -111,7 +111,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c ### Story file -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) would generate a Story file that looks like this: +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) would generate a Story file that looks like this: ```typescript {% fileName="libs/feature/ui/src/lib/my-button/my-button.stories.tsx" %} import type { Meta } from '@storybook/react'; diff --git a/docs/generated/packages/storybook/documents/overview.md b/docs/generated/packages/storybook/documents/overview.md index bcd7fdd3ca497..cbfce9d597ef9 100644 --- a/docs/generated/packages/storybook/documents/overview.md +++ b/docs/generated/packages/storybook/documents/overview.md @@ -19,14 +19,14 @@ Starting with Nx 16, Storybook 7 is going to be used by default to configure you {% tab label="yarn" %} ```shell -yarn add -D @nrwl/storybook +yarn add -D @nx/storybook ``` {% /tab %} {% tab label="npm" %} ```shell -npm install -D @nrwl/storybook +npm install -D @nx/storybook ``` {% /tab %} @@ -39,7 +39,7 @@ npm install -D @nrwl/storybook You can generate Storybook configuration for an individual project with this command: ```shell -nx g @nrwl/storybook:configuration project-name +nx g @nx/storybook:configuration project-name ``` If you are NOT using a framework-specific generator, in the field `storybook7UiFramework` you must choose one of the following Storybook frameworks: @@ -84,7 +84,7 @@ These framework-specific generators will also **generate stories** for you. You can choose to configure your project using TypeScript instead of JavaScript. To do that, just add the `--tsConfiguration=true` flag to the above command, like this: ```shell -nx g @nrwl/storybook:configuration project-name --tsConfiguration=true +nx g @nx/storybook:configuration project-name --tsConfiguration=true ``` [Here is the Storybook documentation](https://storybook.js.org/docs/react/configure/overview#configure-your-project-with-typescript) if you want to learn more. diff --git a/docs/generated/packages/storybook/documents/storybook-7-setup.md b/docs/generated/packages/storybook/documents/storybook-7-setup.md index 6196fa6470641..a2aa0a5521694 100644 --- a/docs/generated/packages/storybook/documents/storybook-7-setup.md +++ b/docs/generated/packages/storybook/documents/storybook-7-setup.md @@ -33,14 +33,14 @@ For migrating your existing Nx workspace with existing Storybook configuration t {% tab label="yarn" %} ```shell -yarn add -D @nrwl/storybook +yarn add -D @nx/storybook ``` {% /tab %} {% tab label="npm" %} ```shell -npm install -D @nrwl/storybook +npm install -D @nx/storybook ``` {% /tab %} @@ -53,13 +53,13 @@ npm install -D @nrwl/storybook You can generate Storybook configuration for an individual project with this command: ```shell -nx g @nrwl/storybook:configuration project-name --storybook7Configuration --storybook7UiFramework=@storybook/react-webpack5 +nx g @nx/storybook:configuration project-name --storybook7Configuration --storybook7UiFramework=@storybook/react-webpack5 ``` -Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nrwl/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nrwl/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nrwl/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration), for example: +Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nx/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nx/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nx/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration), for example: ```shell -nx g @nrwl/angular:storybook-configuration my-angular-project --storybook7Configuration +nx g @nx/angular:storybook-configuration my-angular-project --storybook7Configuration ``` {% callout type="info" title="For Nx versions <15.9" %} @@ -114,7 +114,7 @@ The Storybook configuration generated by Nx for Storybook 7 is very similar to t #### Changes in the `storybook` and `build-storybook` targets - The `uiFramework` field is not needed any more, thus it is not set. Nx was using the `uiFramework` field to load any framework specific options for the Storybook builder. This is no longer needed, since the `framework` set in `.storybook/main.js|ts` takes care of that. -- More options from the Storybook CLI are now exposed in the executors. You can see these in the [`@nrwl/storybook:storybook`](/packages/storybook/executors/storybook) and [`@nrwl/storybook:build`](/packages/storybook/executors/build) executor schemas. You can read more about these options in the [Storybook 7 CLI docs](https://storybook.js.org/docs/7.0/react/api/cli-options). If there's an option you need to pass but it's not in the executor schema, you can always pass it, since the executors are just passing the options to the Storybook CLI. +- More options from the Storybook CLI are now exposed in the executors. You can see these in the [`@nx/storybook:storybook`](/packages/storybook/executors/storybook) and [`@nx/storybook:build`](/packages/storybook/executors/build) executor schemas. You can read more about these options in the [Storybook 7 CLI docs](https://storybook.js.org/docs/7.0/react/api/cli-options). If there's an option you need to pass but it's not in the executor schema, you can always pass it, since the executors are just passing the options to the Storybook CLI. ## Use Storybook 7 diff --git a/docs/generated/packages/storybook/documents/upgrade-storybook-v6-angular.md b/docs/generated/packages/storybook/documents/upgrade-storybook-v6-angular.md index 7cf6449f1e01a..d2a5fd4a36b11 100644 --- a/docs/generated/packages/storybook/documents/upgrade-storybook-v6-angular.md +++ b/docs/generated/packages/storybook/documents/upgrade-storybook-v6-angular.md @@ -33,7 +33,7 @@ In that case, when you run the Nx migration scripts, the scripts will ignore the ### Some info about the generator -The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: +The `@nx/angular:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: - It will generate new Storybook configuration files using the new (`>6.x`) Storybook way. The way it will do that is, it will look in all the `project.json` files and it will find all the projects that have a `Storybook` configuration. Using the `configFolder` path provided there, it will go and generate new Storybook instances in all these paths. Finally, it will generate a new Storybook instance at the root directory. @@ -46,7 +46,7 @@ The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator will not exactly That way, you can have working Storybook instances for all your projects just by running ```shell -nx g @nrwl/angular:storybook-migrate-defaults-5-to-6 +nx g @nx/angular:storybook-migrate-defaults-5-to-6 ``` ### What if I had made changes to the defaults? @@ -59,7 +59,7 @@ Please check out this official [Storybook 6 Migration Guide](https://medium.com/ The generator gives you the option to migrate one project at a time. You can provide the `--name=PROJECT_NAME` flag, and then the generator will **only** generate new files for the specified project. -Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nrwl/angular:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. +Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nx/angular:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. ### General tip: @@ -67,7 +67,7 @@ Please note that this option will NOT update all the Storybook-related (`@storyb ## Upgrading to Storybook 6 manually -There is really no great reason for doing the migration completely manually. The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). +There is really no great reason for doing the migration completely manually. The `@nx/angular:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). However, if you still want to do everything manually, these are the steps you should follow: diff --git a/docs/generated/packages/storybook/documents/upgrade-storybook-v6-react.md b/docs/generated/packages/storybook/documents/upgrade-storybook-v6-react.md index 053fa0caa623f..ff90ea654afff 100644 --- a/docs/generated/packages/storybook/documents/upgrade-storybook-v6-react.md +++ b/docs/generated/packages/storybook/documents/upgrade-storybook-v6-react.md @@ -33,7 +33,7 @@ In that case, when you run the Nx migration scripts, the scripts will ignore the ### Some info about the generator -The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: +The `@nx/react:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: - It will generate new Storybook configuration files using the new (`>6.x`) Storybook way. The way it will do that is, it will look in all the `project.json` files and it will find all the projects that have a `Storybook` configuration. Using the `configFolder` path provided there, it will go and generate new Storybook instances in all these paths. Finally, it will generate a new Storybook instance at the root directory. @@ -46,7 +46,7 @@ The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator will not exactly d That way, you can have working Storybook instances for all your projects just by running ```shell -nx g @nrwl/react:storybook-migrate-defaults-5-to-6 +nx g @nx/react:storybook-migrate-defaults-5-to-6 ``` ### What if I had made changes to the defaults? @@ -59,7 +59,7 @@ Please check out this official [Storybook 6 Migration Guide](https://medium.com/ The generator gives you the option to migrate one project at a time. You can provide the `--name=PROJECT_NAME` flag, and then the generator will **only** generate new files for the specified project. -Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nrwl/react:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. +Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nx/react:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. ### General tip: @@ -67,7 +67,7 @@ Please note that this option will NOT update all the Storybook-related (`@storyb ## Upgrading to Storybook 6 manually -There is really no great reason for doing the migration completely manually. The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). +There is really no great reason for doing the migration completely manually. The `@nx/react:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). However, if you still want to do everything manually, these are the steps you should follow: diff --git a/docs/generated/packages/storybook/executors/build.json b/docs/generated/packages/storybook/executors/build.json index a5ca7103bf123..770a27dbbb926 100644 --- a/docs/generated/packages/storybook/executors/build.json +++ b/docs/generated/packages/storybook/executors/build.json @@ -138,7 +138,7 @@ }, "additionalProperties": true, "required": ["uiFramework", "configDir"], - "examplesFile": "---\ntitle: Storybook builder executor examples\ndescription: This page contains examples for the @nrwl/storybook:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"ui\": {\n \"targets\": {\n //...\n \"build-storybook\": {\n \"executor\": \"@nrwl/storybook:build\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ui\",\n \"configDir\": \"libs/ui/.storybook\"\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n }\n}\n```\n\n```bash\nnx run ui:build-storybook\n```\n\n## Examples\n\n### For non-Angular projects\n\n{% tabs %}\n{% tab label=\"Working in docsMode\" %}\n\nYou can work in docs mode, building a documentation-only site, by setting the `docsMode` option to `true` and using the `@storybook/addon-docs` addon.\n\nRead more on the [Storybook documentation page for `addon-docs`](https://storybook.js.org/addons/@storybook/addon-docs).\n\n```json\n\"storybook\": {\n \"executor\": \"@nrwl/storybook:build\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"docsMode\": true\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n\n### For Angular projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Angular projects using Storybook. You can see that it uses the native `@storybook/angular:build-storybook` executor. You can read more about the configuration options at the relevant [Storybook documentation page](https://storybook.js.org/docs/angular/get-started/install).\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Changing the browserTarget\" %}\n\nYou can set the [`browserTarget`](/packages/storybook/documents/angular-browser-target) to use `build-storybook` as the builder. This is most useful in the cases where your project does not have a `build` target.\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Adding styles\" %}\n\nYou can add paths to stylesheets to be included in the Storybook build by using the `styles` array. You can also add `stylePreprocessorOptions`, much like you would do in the Angular builder. You can read more in our guide about [styles and preprocessor options for Storybook](/packages/storybook/documents/angular-configuring-styles).\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false,\n \"styles\": [\"some-styles.css\"],\n \"stylePreprocessorOptions\": {\n \"includePaths\": [\"some-style-paths\"]\n }\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "---\ntitle: Storybook builder executor examples\ndescription: This page contains examples for the @nx/storybook:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"ui\": {\n \"targets\": {\n //...\n \"build-storybook\": {\n \"executor\": \"@nx/storybook:build\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ui\",\n \"configDir\": \"libs/ui/.storybook\"\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n }\n}\n```\n\n```bash\nnx run ui:build-storybook\n```\n\n## Examples\n\n### For non-Angular projects\n\n{% tabs %}\n{% tab label=\"Working in docsMode\" %}\n\nYou can work in docs mode, building a documentation-only site, by setting the `docsMode` option to `true` and using the `@storybook/addon-docs` addon.\n\nRead more on the [Storybook documentation page for `addon-docs`](https://storybook.js.org/addons/@storybook/addon-docs).\n\n```json\n\"storybook\": {\n \"executor\": \"@nx/storybook:build\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"docsMode\": true\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n\n### For Angular projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Angular projects using Storybook. You can see that it uses the native `@storybook/angular:build-storybook` executor. You can read more about the configuration options at the relevant [Storybook documentation page](https://storybook.js.org/docs/angular/get-started/install).\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Changing the browserTarget\" %}\n\nYou can set the [`browserTarget`](/packages/storybook/documents/angular-browser-target) to use `build-storybook` as the builder. This is most useful in the cases where your project does not have a `build` target.\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Adding styles\" %}\n\nYou can add paths to stylesheets to be included in the Storybook build by using the `styles` array. You can also add `stylePreprocessorOptions`, much like you would do in the Angular builder. You can read more in our guide about [styles and preprocessor options for Storybook](/packages/storybook/documents/angular-configuring-styles).\n\n```json\n\"build-storybook\": {\n \"executor\": \"@storybook/angular:build-storybook\",\n \"outputs\": [\"{options.outputDir}\"],\n \"options\": {\n \"outputDir\": \"dist/storybook/ngapp\",\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false,\n \"styles\": [\"some-styles.css\"],\n \"stylePreprocessorOptions\": {\n \"includePaths\": [\"some-style-paths\"]\n }\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "Build Storybook.", "aliases": [], diff --git a/docs/generated/packages/storybook/executors/storybook.json b/docs/generated/packages/storybook/executors/storybook.json index b581f25d09398..e4c69c92f202b 100644 --- a/docs/generated/packages/storybook/executors/storybook.json +++ b/docs/generated/packages/storybook/executors/storybook.json @@ -88,7 +88,7 @@ "additionalProperties": true, "definitions": {}, "required": ["uiFramework", "configDir"], - "examplesFile": "---\ntitle: Storybook dev server executor examples\ndescription: This page contains examples for the @nrwl/storybook:storybook executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"ui\": {\n \"targets\": {\n //...\n \"storybook\": {\n \"executor\": \"@nrwl/storybook:storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\"\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n },\n }\n}\n```\n\n```bash\nnx run ui:storybook\n```\n\n## Examples\n\n### For non-Angular projects\n\n{% tabs %}\n{% tab label=\"Working in docsMode\" %}\n\nYou can work in docs mode, building a documentation-only site, by setting the `docsMode` option to `true` and using the `@storybook/addon-docs` addon.\n\nRead more on the [Storybook documentation page for `addon-docs`](https://storybook.js.org/addons/@storybook/addon-docs).\n\n```json\n\"storybook\": {\n \"executor\": \"@nrwl/storybook:storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"docsMode\": true\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n\n### For Angular projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Angular projects using Storybook. You can see that it uses the native `@storybook/angular:start-storybook` executor. You can read more about the configuration options at the relevant [Storybook documentation page](https://storybook.js.org/docs/angular/get-started/install).\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n{% tab label=\"Changing the browserTarget\" %}\n\nYou can set the [`browserTarget`](/packages/storybook/documents/angular-browser-target) to use `build-storybook` as the builder. This is most useful in the cases where your project does not have a `build` target.\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n\n{% tab label=\"Adding styles\" %}\n\nYou can add paths to stylesheets to be included in the Storybook build by using the `styles` array. You can also add `stylePreprocessorOptions`, much like you would do in the Angular builder. You can read more in our guide about [styles and preprocessor options for Storybook](/packages/storybook/documents/angular-configuring-styles).\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false,\n \"styles\": [\"some-styles.css\"],\n \"stylePreprocessorOptions\": {\n \"includePaths\": [\"some-style-paths\"]\n }\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "---\ntitle: Storybook dev server executor examples\ndescription: This page contains examples for the @nx/storybook:storybook executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"ui\": {\n \"targets\": {\n //...\n \"storybook\": {\n \"executor\": \"@nx/storybook:storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\"\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n },\n }\n}\n```\n\n```bash\nnx run ui:storybook\n```\n\n## Examples\n\n### For non-Angular projects\n\n{% tabs %}\n{% tab label=\"Working in docsMode\" %}\n\nYou can work in docs mode, building a documentation-only site, by setting the `docsMode` option to `true` and using the `@storybook/addon-docs` addon.\n\nRead more on the [Storybook documentation page for `addon-docs`](https://storybook.js.org/addons/@storybook/addon-docs).\n\n```json\n\"storybook\": {\n \"executor\": \"@nx/storybook:storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"docsMode\": true\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n\n### For Angular projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Angular projects using Storybook. You can see that it uses the native `@storybook/angular:start-storybook` executor. You can read more about the configuration options at the relevant [Storybook documentation page](https://storybook.js.org/docs/angular/get-started/install).\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n{% tab label=\"Changing the browserTarget\" %}\n\nYou can set the [`browserTarget`](/packages/storybook/documents/angular-browser-target) to use `build-storybook` as the builder. This is most useful in the cases where your project does not have a `build` target.\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build-storybook\",\n \"compodoc\": false\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n\n{% tab label=\"Adding styles\" %}\n\nYou can add paths to stylesheets to be included in the Storybook build by using the `styles` array. You can also add `stylePreprocessorOptions`, much like you would do in the Angular builder. You can read more in our guide about [styles and preprocessor options for Storybook](/packages/storybook/documents/angular-configuring-styles).\n\n```json\n\"storybook\": {\n \"executor\": \"@storybook/angular:start-storybook\",\n \"options\": {\n \"port\": 4400,\n \"configDir\": \"libs/ui/.storybook\",\n \"browserTarget\": \"ui:build\",\n \"compodoc\": false,\n \"styles\": [\"some-styles.css\"],\n \"stylePreprocessorOptions\": {\n \"includePaths\": [\"some-style-paths\"]\n }\n },\n \"configurations\": {\n \"ci\": {\n \"quiet\": true\n }\n }\n},\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "Serve Storybook.", "aliases": [], diff --git a/docs/generated/packages/storybook/generators/configuration.json b/docs/generated/packages/storybook/generators/configuration.json index 326410291a96f..30bafe42fa658 100644 --- a/docs/generated/packages/storybook/generators/configuration.json +++ b/docs/generated/packages/storybook/generators/configuration.json @@ -120,7 +120,7 @@ } }, "required": ["name"], - "examplesFile": "---\ntitle: Storybook configuration generator examples\ndescription: This page contains examples for the @nrwl/storybook:configuration generator.\n---\n\nThis is a framework-agnostic generator for setting up Storybook configuration for a project.\n\n```bash\nnx g @nrwl/storybook:configuration\n```\n\nNx will understand if you're using Storybook v7 or Storybook v6 and configure your project accordingly. By default, it will try to use Storybook v7.\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- The `storybook7UiFramework` you want to use. Supported values are:\n - `@storybook/angular`\n - `@storybook/html-webpack5`\n - `@storybook/nextjs`\n - `@storybook/preact-webpack5`\n - `@storybook/react-webpack5`\n - `@storybook/react-vite`\n - `@storybook/server-webpack5`\n - `@storybook/svelte-webpack5`\n - `@storybook/svelte-vite`\n - `@storybook/sveltekit`\n - `@storybook/vue-webpack5`\n - `@storybook/vue-vite`\n - `@storybook/vue3-webpack5`\n - `@storybook/vue3-vite`\n - `@storybook/web-components-webpack5`\n - `@storybook/web-components-vite`\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` and a `storybook7UiFramework` for the generator to work.\n\nYou can read more about how this generator works, in the [Storybook package overview page](/packages/storybook#generating-storybook-configuration).\n\nIf you are using Angular, React, React Native or Next.js in your project, it's best to use the framework specific generator:\n\n- [React Storybook Configuration Generator](/packages/react/generators/storybook-configuration) (React and Next.js projects)\n\n- [Angular Storybook Configuration Generator](/packages/angular/generators/storybook-configuration)\n\n- [React Native Storybook Configuration Generator](/packages/react-native/generators/storybook-configuration)\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nrwl/storybook:configuration ui --storybook7UiFramework=@storybook/web-components-vite --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Generate Storybook configuration for Storybook version 6\n\nIf, for somem reason, you want to force Nx to generate Storybook version 6 configuration, you can do so by passing false to the `storybook7Configuration` flag:\n\n```bash\nnx g @nrwl/storybook:configuration ui --uiFramework=@storybook/react --storybook7Configuration=false\n```\n\nHowever, this is **NOT recommended**.\n", + "examplesFile": "---\ntitle: Storybook configuration generator examples\ndescription: This page contains examples for the @nx/storybook:configuration generator.\n---\n\nThis is a framework-agnostic generator for setting up Storybook configuration for a project.\n\n```bash\nnx g @nx/storybook:configuration\n```\n\nNx will understand if you're using Storybook v7 or Storybook v6 and configure your project accordingly. By default, it will try to use Storybook v7.\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `name` of the project you want to generate the configuration for.\n- The `storybook7UiFramework` you want to use. Supported values are:\n - `@storybook/angular`\n - `@storybook/html-webpack5`\n - `@storybook/nextjs`\n - `@storybook/preact-webpack5`\n - `@storybook/react-webpack5`\n - `@storybook/react-vite`\n - `@storybook/server-webpack5`\n - `@storybook/svelte-webpack5`\n - `@storybook/svelte-vite`\n - `@storybook/sveltekit`\n - `@storybook/vue-webpack5`\n - `@storybook/vue-vite`\n - `@storybook/vue3-webpack5`\n - `@storybook/vue3-vite`\n - `@storybook/web-components-webpack5`\n - `@storybook/web-components-vite`\n- Whether you want to `configureCypress`. If you choose `yes`, a Cypress e2e app will be created (or configured) to run against the project's Storybook instance.\n- Whether you want to `configureTestRunner`. If you choose `yes`, a `test-storybook` target will be generated in your project's `project.json`, with a command to invoke the [Storybook `test-runner`](https://storybook.js.org/docs/react/writing-tests/test-runner).\n\nYou must provide a `name` and a `storybook7UiFramework` for the generator to work.\n\nYou can read more about how this generator works, in the [Storybook package overview page](/packages/storybook#generating-storybook-configuration).\n\nIf you are using Angular, React, React Native or Next.js in your project, it's best to use the framework specific generator:\n\n- [React Storybook Configuration Generator](/packages/react/generators/storybook-configuration) (React and Next.js projects)\n\n- [Angular Storybook Configuration Generator](/packages/angular/generators/storybook-configuration)\n\n- [React Native Storybook Configuration Generator](/packages/react-native/generators/storybook-configuration)\n\n## Examples\n\n### Generate Storybook configuration using TypeScript\n\n```bash\nnx g @nx/storybook:configuration ui --storybook7UiFramework=@storybook/web-components-vite --tsConfiguration=true\n```\n\nThis will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory).\n\n### Generate Storybook configuration for Storybook version 6\n\nIf, for somem reason, you want to force Nx to generate Storybook version 6 configuration, you can do so by passing false to the `storybook7Configuration` flag:\n\n```bash\nnx g @nx/storybook:configuration ui --uiFramework=@storybook/react --storybook7Configuration=false\n```\n\nHowever, this is **NOT recommended**.\n", "presets": [] }, "description": "Add Storybook configuration to a UI library or an application.", diff --git a/docs/generated/packages/storybook/generators/migrate-7.json b/docs/generated/packages/storybook/generators/migrate-7.json index 56d468234a2ea..8dc6de3e66707 100644 --- a/docs/generated/packages/storybook/generators/migrate-7.json +++ b/docs/generated/packages/storybook/generators/migrate-7.json @@ -34,7 +34,7 @@ "default": false } }, - "examplesFile": "---\ntitle: Storybook 7 Migration Generator Examples\ndescription: This page contains examples for the @nrwl/storybook:migrate-7 generator.\n---\n\n{% callout type=\"info\" title=\"Available on Nx v15.9\" %}\nThis is a new feature available on Nx v15.9.0. If you are using an older version of Nx, please [upgrade](/packages/nx/documents/migrate).\n{% /callout %}\n\n{% callout type=\"info\" title=\"Setting up Storybook 7 in a new workspace\" %}\nFor setting up Storybook version 7 in a new Nx workspace, or a workspace that does NOT already have Storybook configured already, please refer to our [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n{% /callout %}\n\nStorybook 7 is a major release that brings a lot of new features and improvements. You can read more about it in the [Storybook 7.0.0 release article](https://storybook.js.org/blog/storybook-7-0/). Apart from the new features and improvements it introduces, it also brings some breaking changes. You can read more about them in the [Storybook 7 migration docs](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700) and the [Storybook 7.0.0 migration guide](https://storybook.js.org/docs/react/migration-guide).\n\nYou can now migrate your existing Nx workspace with Storybook configuration to use Storybook version 7. To help you, Nx offers the `@nrwl/storybook:migrate-7` generator. This generator will help you migrate your existing Storybook setup to version 7.\n\n## How to use it\n\nJust call:\n\n```bash\nnpx nx g @nrwl/storybook:migrate-7\n```\n\n{% callout type=\"warning\" title=\"Commit your changes\" %}\nIt is advised that you start with a clean git history before running this generator, since it is going to be making lots of changes to your workspace.\n{% /callout %}\n\nYou can run this generator using the above command, without passing any options. This will start the migration process for all your projects that have Storybook configured. The logs will explain what is happening in every step, and the logs are mixed Nx and Storybook CLI logs. During the process you will be prompted by the Storybook CLI to accept the automigration scripts. You can read more about that in the next section.\n\nWhen the generator finishes, you will see a summary of the changes that were made to your workspace, and it will also create a new file, called `storybook-migration-summary.md` at the root of your project, which will contain a list of all the changes that were made to your workspace.\n\n### Accept the automigration prompts\n\nThe Storybook CLI (running through our generator) will prompt you to run some code generators and modifiers.\n\nYou can say `yes` to these prompts, which are usually the following (there may be more or less, depending on your setup,\nand depending on the latest versions of the Storybook CLI - this code is NOT managed by Nx, but by Storybook):\n\n- `mainjsFramework`: It will try to add the `framework` field in your project's `.storybook/main.js|ts` file.\n- `eslintPlugin`: installs the `eslint-plugin-storybook`\n- `newFrameworks`: removes unused dependencies (eg. `@storybook/builder-webpack5`, `@storybook/manager-webpack5`, `@storybook/builder-vite`)\n- `autodocsTrue`: adds `autodocs: true` to your project's `.storybook/main.js|ts` file\n\n### Check the result\n\nOnce the generator finishes, and the Storybook CLI automigration scripts have run, you should check the result. Examples of migrated `.storybook/main.js|ts` files would look like this:\n\n#### Full example for Angular projects\n\nHere is an example of a project-level `.storybook/main.js|ts` file for an Angular project that has been migrated to Storybook version 7:\n\n```ts {% fileName=\"apps/my-angular-app/.storybook/main.js\" %}\nconst config = {\n stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],\n addons: ['@storybook/addon-essentials'],\n framework: {\n name: '@storybook/angular',\n options: {},\n },\n};\n\nexport default config;\n```\n\n#### Full example for React projects with Vite\n\nHere is an example of a project-level `.storybook/main.js|ts` file for a React project using Vite that has been migrated to Storybook version 7:\n\n```ts {% fileName=\"apps/my-react-app/.storybook/main.js\" %}\nconst config = {\n stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],\n addons: ['@storybook/addon-essentials'],\n framework: {\n name: '@storybook/react-vite',\n options: {\n builder: {\n viteConfigPath: 'apps/rv1/vite.config.ts',\n },\n },\n },\n};\n\nexport default config;\n```\n\n### Make sure that all works by running Storybook\n\nYou can now use Storybook 7! 🎉\n\n```bash\nnpx nx build-storybook PROJECT_NAME\n```\n\nand\n\n```bash\nnpx nx storybook PROJECT_NAME\n```\n\n## Run the generator by automatically accepting the Storybook CLI prompts\n\nYou can run the generator with the `--autoAcceptAllPrompts` flag, which will automatically accept all the Storybook CLI prompts. This is useful if you want to run the generator in a CI environment, or if you want to run the generator in a script. Or if you are sure that you want to accept all the prompts!\n\n```bash\nnpx nx g @nrwl/storybook:migrate-7 --autoAcceptAllPrompts\n```\n\nThe Storybook CLI may still ask you about some things, but mostly it should just run the whole migration suite uninterrupted.\n\n## Run the migration manually\n\nNx gives you the ability to run all the migration steps one by one, manually, but still with the help of our migrator. To help you out with the commands that you need to run, Nx will print out the instructions if you run the generator with the `--onlyShowListOfCommands` flag, like this:\n\n```bash\nnpx nx g @nrwl/storybook:migrate-7 --onlyShowListOfCommands\n```\n\nEssentially, the way to run the migration manually is the following:\n\n1. Call the Nx generator to show you the list of commands:\n `npx nx g @nrwl/storybook:migrate-7 --onlyShowListOfCommands`\n2. Call the Storybook upgrade script:\n `npx storybook@latest upgrade`\n3. Call the Nx generator to prepare your files for migration. The steps are explained in [Step 02](#step-02) above.\n `nx g @nrwl/storybook:migrate-7 --onlyPrepare`\n4. Call the Storybook automigrate scripts for each one of the projects using Storybook (the `@nrwl/storybook:migrate-7` will give you the list of all the commands)\n5. Call the Nx generator to finish the migration. The steps are explained in [Step 04](#step-04) above.\n `nx g @nrwl/storybook:migrate-7 --afterMigration`\n\n## How the generator works under the hood\n\nNow let's see how the `@nrwl/storybook:migrate-7` generator works under the hood. It essentially does the following things:\n\n### Step 01\n\nIt calls the Storybook CLI upgrade script:\n\n```bash\nnpx storybook@latest upgrade\n```\n\nThis script will upgrade your Storybook dependencies to the latest version, as explained in the [Storybook documentation](https://storybook.js.org/docs/7.0/react/configure/upgrading).\n\n### Step 02\n\nIt prepares all your project-level `.storybook/main.js|ts` files, so that\nthe Storybook automigration scripts can run successfully. This means that it makes the following adjustments to your files:\n\n- Remove the \"`as StorybookConfig`\" typecast from the `.storybook/main.ts` files, if you have any `.storybook/main.ts` files with typecast, since it is not needed any more\n- Remove the \"`path.resolve`\" calls from the Next.js Storybook configuration in project-level `.storybook/main.js|ts` files, if it exists, since it breaks the Storybook automigration scripts\n\n### Step 03\n\nIt calls the Storybook CLI automigrate script, for each one of your projects that have Storybook configured. It does that by passing the `--config-dir` flag and the `--renderer` flag, for each one of your projects that has Storybook configured. An example command would look like this:\n\n```bash\nnpx storybook@latest automigrate --config-dir apps/my-react-app/.storybook --renderer @storybook/react\n```\n\nThis script will make changes to your Storybook configuration files, and other changes to your repository, to make it work for Storybook 7, as explained in the [Storybook documentation](https://storybook.js.org/docs/7.0/react/configure/upgrading).\n\n### Step 04\n\nAfter the Storybook CLI automigrate scripts have run, some additional adjustments are made to your workspace, to make sure that everything is working as expected. These adjustments are as follows:\n\n- Remove the \"`vite-tsconfig-paths`\" plugin from the Storybook configuration files for Vite projects, since it's no longer needed in v7\n- Add the \"`viteConfigPath`\" option to the Storybook builder options for Vite projects, since now Storybook needs the path to the Vite config file\n- Change the import package for the `StorybookConfig` type to be framework specific (e.g. from `@storybook/common` to `@storybook/react-vite` for React projects using Vite)\n- Add the \"`lit`\" package to your workspace, if you are using Web Components\n- Remove the \"`uiFramework`\" option from your project's Storybook targets\n\nOur generator is based on the guide to migration using the Storybook CLI, sp please refer to the [Storybook 7 migration guide](https://chromatic-ui.notion.site/Storybook-7-migration-guide-dbf41fa347304eb2a5e9c69b34503937) for more information.\n\n## I am not on Nx 15.9.0 yet but I still want to migrate to Storybook 7\n\nYou can migrate to Storybook 7 by just using the [Storybook `upgrade` and `automigrate` scripts](https://storybook.js.org/docs/7.0/react/configure/upgrading), but you will have to manually point the `automigrate` script to each one of your projects using Storybook, explained in [Step 03](#step-03) above.\n\nFirst, you would have to run the `npx storybook@latest upgrade` to get the latest versions of all the `@storybook/*` packages. Then, for each one of your projects that use Storybook, you would have to run `npx storybook@latest automigrate --config-dir /.storybook --renderer @storybook/`.\n\nThe `@nrwl/storybook:migrate-7` generator helps you by figuring out all the project paths and the renderers that need to be passed in the `automigrate` script, and also by performing a number of adjustments to your code to make sure the migration scripts run smoothly, so it is recommended to use the generator instead of running the scripts manually.\n\n## Report any issues and bugs\n\nPlease report any issues and bugs you find [on the Nx GitHub page](https://github.com/nrwl/nx/issues/new/choose) or on the [Storybook GitHub page](https://github.com/storybookjs/storybook/issues/new/choose).\n", + "examplesFile": "---\ntitle: Storybook 7 Migration Generator Examples\ndescription: This page contains examples for the @nx/storybook:migrate-7 generator.\n---\n\n{% callout type=\"info\" title=\"Available on Nx v15.9\" %}\nThis is a new feature available on Nx v15.9.0. If you are using an older version of Nx, please [upgrade](/packages/nx/documents/migrate).\n{% /callout %}\n\n{% callout type=\"info\" title=\"Setting up Storybook 7 in a new workspace\" %}\nFor setting up Storybook version 7 in a new Nx workspace, or a workspace that does NOT already have Storybook configured already, please refer to our [Storybook 7 setup guide](/packages/storybook/documents/storybook-7-setup).\n{% /callout %}\n\nStorybook 7 is a major release that brings a lot of new features and improvements. You can read more about it in the [Storybook 7.0.0 release article](https://storybook.js.org/blog/storybook-7-0/). Apart from the new features and improvements it introduces, it also brings some breaking changes. You can read more about them in the [Storybook 7 migration docs](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700) and the [Storybook 7.0.0 migration guide](https://storybook.js.org/docs/react/migration-guide).\n\nYou can now migrate your existing Nx workspace with Storybook configuration to use Storybook version 7. To help you, Nx offers the `@nx/storybook:migrate-7` generator. This generator will help you migrate your existing Storybook setup to version 7.\n\n## How to use it\n\nJust call:\n\n```bash\nnpx nx g @nx/storybook:migrate-7\n```\n\n{% callout type=\"warning\" title=\"Commit your changes\" %}\nIt is advised that you start with a clean git history before running this generator, since it is going to be making lots of changes to your workspace.\n{% /callout %}\n\nYou can run this generator using the above command, without passing any options. This will start the migration process for all your projects that have Storybook configured. The logs will explain what is happening in every step, and the logs are mixed Nx and Storybook CLI logs. During the process you will be prompted by the Storybook CLI to accept the automigration scripts. You can read more about that in the next section.\n\nWhen the generator finishes, you will see a summary of the changes that were made to your workspace, and it will also create a new file, called `storybook-migration-summary.md` at the root of your project, which will contain a list of all the changes that were made to your workspace.\n\n### Accept the automigration prompts\n\nThe Storybook CLI (running through our generator) will prompt you to run some code generators and modifiers.\n\nYou can say `yes` to these prompts, which are usually the following (there may be more or less, depending on your setup,\nand depending on the latest versions of the Storybook CLI - this code is NOT managed by Nx, but by Storybook):\n\n- `mainjsFramework`: It will try to add the `framework` field in your project's `.storybook/main.js|ts` file.\n- `eslintPlugin`: installs the `eslint-plugin-storybook`\n- `newFrameworks`: removes unused dependencies (eg. `@storybook/builder-webpack5`, `@storybook/manager-webpack5`, `@storybook/builder-vite`)\n- `autodocsTrue`: adds `autodocs: true` to your project's `.storybook/main.js|ts` file\n\n### Check the result\n\nOnce the generator finishes, and the Storybook CLI automigration scripts have run, you should check the result. Examples of migrated `.storybook/main.js|ts` files would look like this:\n\n#### Full example for Angular projects\n\nHere is an example of a project-level `.storybook/main.js|ts` file for an Angular project that has been migrated to Storybook version 7:\n\n```ts {% fileName=\"apps/my-angular-app/.storybook/main.js\" %}\nconst config = {\n stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],\n addons: ['@storybook/addon-essentials'],\n framework: {\n name: '@storybook/angular',\n options: {},\n },\n};\n\nexport default config;\n```\n\n#### Full example for React projects with Vite\n\nHere is an example of a project-level `.storybook/main.js|ts` file for a React project using Vite that has been migrated to Storybook version 7:\n\n```ts {% fileName=\"apps/my-react-app/.storybook/main.js\" %}\nconst config = {\n stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],\n addons: ['@storybook/addon-essentials'],\n framework: {\n name: '@storybook/react-vite',\n options: {\n builder: {\n viteConfigPath: 'apps/rv1/vite.config.ts',\n },\n },\n },\n};\n\nexport default config;\n```\n\n### Make sure that all works by running Storybook\n\nYou can now use Storybook 7! 🎉\n\n```bash\nnpx nx build-storybook PROJECT_NAME\n```\n\nand\n\n```bash\nnpx nx storybook PROJECT_NAME\n```\n\n## Run the generator by automatically accepting the Storybook CLI prompts\n\nYou can run the generator with the `--autoAcceptAllPrompts` flag, which will automatically accept all the Storybook CLI prompts. This is useful if you want to run the generator in a CI environment, or if you want to run the generator in a script. Or if you are sure that you want to accept all the prompts!\n\n```bash\nnpx nx g @nx/storybook:migrate-7 --autoAcceptAllPrompts\n```\n\nThe Storybook CLI may still ask you about some things, but mostly it should just run the whole migration suite uninterrupted.\n\n## Run the migration manually\n\nNx gives you the ability to run all the migration steps one by one, manually, but still with the help of our migrator. To help you out with the commands that you need to run, Nx will print out the instructions if you run the generator with the `--onlyShowListOfCommands` flag, like this:\n\n```bash\nnpx nx g @nx/storybook:migrate-7 --onlyShowListOfCommands\n```\n\nEssentially, the way to run the migration manually is the following:\n\n1. Call the Nx generator to show you the list of commands:\n `npx nx g @nx/storybook:migrate-7 --onlyShowListOfCommands`\n2. Call the Storybook upgrade script:\n `npx storybook@latest upgrade`\n3. Call the Nx generator to prepare your files for migration. The steps are explained in [Step 02](#step-02) above.\n `nx g @nx/storybook:migrate-7 --onlyPrepare`\n4. Call the Storybook automigrate scripts for each one of the projects using Storybook (the `@nx/storybook:migrate-7` will give you the list of all the commands)\n5. Call the Nx generator to finish the migration. The steps are explained in [Step 04](#step-04) above.\n `nx g @nx/storybook:migrate-7 --afterMigration`\n\n## How the generator works under the hood\n\nNow let's see how the `@nx/storybook:migrate-7` generator works under the hood. It essentially does the following things:\n\n### Step 01\n\nIt calls the Storybook CLI upgrade script:\n\n```bash\nnpx storybook@latest upgrade\n```\n\nThis script will upgrade your Storybook dependencies to the latest version, as explained in the [Storybook documentation](https://storybook.js.org/docs/7.0/react/configure/upgrading).\n\n### Step 02\n\nIt prepares all your project-level `.storybook/main.js|ts` files, so that\nthe Storybook automigration scripts can run successfully. This means that it makes the following adjustments to your files:\n\n- Remove the \"`as StorybookConfig`\" typecast from the `.storybook/main.ts` files, if you have any `.storybook/main.ts` files with typecast, since it is not needed any more\n- Remove the \"`path.resolve`\" calls from the Next.js Storybook configuration in project-level `.storybook/main.js|ts` files, if it exists, since it breaks the Storybook automigration scripts\n\n### Step 03\n\nIt calls the Storybook CLI automigrate script, for each one of your projects that have Storybook configured. It does that by passing the `--config-dir` flag and the `--renderer` flag, for each one of your projects that has Storybook configured. An example command would look like this:\n\n```bash\nnpx storybook@latest automigrate --config-dir apps/my-react-app/.storybook --renderer @storybook/react\n```\n\nThis script will make changes to your Storybook configuration files, and other changes to your repository, to make it work for Storybook 7, as explained in the [Storybook documentation](https://storybook.js.org/docs/7.0/react/configure/upgrading).\n\n### Step 04\n\nAfter the Storybook CLI automigrate scripts have run, some additional adjustments are made to your workspace, to make sure that everything is working as expected. These adjustments are as follows:\n\n- Remove the \"`vite-tsconfig-paths`\" plugin from the Storybook configuration files for Vite projects, since it's no longer needed in v7\n- Add the \"`viteConfigPath`\" option to the Storybook builder options for Vite projects, since now Storybook needs the path to the Vite config file\n- Change the import package for the `StorybookConfig` type to be framework specific (e.g. from `@storybook/common` to `@storybook/react-vite` for React projects using Vite)\n- Add the \"`lit`\" package to your workspace, if you are using Web Components\n- Remove the \"`uiFramework`\" option from your project's Storybook targets\n\nOur generator is based on the guide to migration using the Storybook CLI, sp please refer to the [Storybook 7 migration guide](https://chromatic-ui.notion.site/Storybook-7-migration-guide-dbf41fa347304eb2a5e9c69b34503937) for more information.\n\n## I am not on Nx 15.9.0 yet but I still want to migrate to Storybook 7\n\nYou can migrate to Storybook 7 by just using the [Storybook `upgrade` and `automigrate` scripts](https://storybook.js.org/docs/7.0/react/configure/upgrading), but you will have to manually point the `automigrate` script to each one of your projects using Storybook, explained in [Step 03](#step-03) above.\n\nFirst, you would have to run the `npx storybook@latest upgrade` to get the latest versions of all the `@storybook/*` packages. Then, for each one of your projects that use Storybook, you would have to run `npx storybook@latest automigrate --config-dir /.storybook --renderer @storybook/`.\n\nThe `@nx/storybook:migrate-7` generator helps you by figuring out all the project paths and the renderers that need to be passed in the `automigrate` script, and also by performing a number of adjustments to your code to make sure the migration scripts run smoothly, so it is recommended to use the generator instead of running the scripts manually.\n\n## Report any issues and bugs\n\nPlease report any issues and bugs you find [on the Nx GitHub page](https://github.com/nrwl/nx/issues/new/choose) or on the [Storybook GitHub page](https://github.com/storybookjs/storybook/issues/new/choose).\n", "presets": [] }, "description": "Migrate to Storybook version 7.", diff --git a/docs/generated/packages/vite/documents/overview.md b/docs/generated/packages/vite/documents/overview.md index 6adcf0119f1eb..fd2e513cf04f0 100644 --- a/docs/generated/packages/vite/documents/overview.md +++ b/docs/generated/packages/vite/documents/overview.md @@ -38,57 +38,57 @@ There is a number of ways to use Vite in your existing workspace. ### Generate a new project using Vite -You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Vite.js. The [`@nrwl/react:app`](/packages/react/generators/application), [`@nrwl/react:lib`](/packages/react/generators/library) and [`@nrwl/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `vite`. This will generate a new application configured to use Vite.js, and it will also install all the necessary dependencies, including the `@nrwl/vite` plugin. +You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Vite.js. The [`@nx/react:app`](/packages/react/generators/application), [`@nx/react:lib`](/packages/react/generators/library) and [`@nx/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `vite`. This will generate a new application configured to use Vite.js, and it will also install all the necessary dependencies, including the `@nx/vite` plugin. To generate a React application using Vite.js, run the following: ```bash -nx g @nrwl/react:app my-app --bundler=vite +nx g @nx/react:app my-app --bundler=vite ``` To generate a React library using Vite.js, run the following: ```bash -nx g @nrwl/react:lib my-lib --bundler=vite +nx g @nx/react:lib my-lib --bundler=vite ``` To generate a Web application using Vite.js, run the following: ```bash -nx g @nrwl/web:app my-app --bundler=vite +nx g @nx/web:app my-app --bundler=vite ``` ### Modify an existing React or Web project to use Vite.js -You can use the `@nrwl/vite:configuration` generator to change your React or Web project to use Vite.js. This generator will modify your project's configuration to use Vite.js, and it will also install all the necessary dependencies, including the `@nrwl/vite` plugin.. +You can use the `@nx/vite:configuration` generator to change your React or Web project to use Vite.js. This generator will modify your project's configuration to use Vite.js, and it will also install all the necessary dependencies, including the `@nx/vite` plugin.. -You can read more about this generator on the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator page. +You can read more about this generator on the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator page. ### Initialize Vite.js If you do not want to create any new projects or convert any existing projects yet, you can still use Nx to install all the necessary dependencies for Vite.js. This, for example, could be useful if you want to set up Vite.js manually for a project. -#### Install the `@nrwl/vite` plugin +#### Install the `@nx/vite` plugin {% tabs %} {% tab label="npm" %} ```shell -npm install -D @nrwl/vite +npm install -D @nx/vite ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/vite +yarn add -D @nx/vite ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm install -D @nrwl/vite +pnpm install -D @nx/vite ``` {% /tab %} @@ -99,7 +99,7 @@ pnpm install -D @nrwl/vite After you install the plugin, you can initialize Vite.js. You can do this by running the `init` executor. This executor will make sure to install all the necessary dependencies. ```bash -nx g @nrwl/vite:init +nx g @nx/vite:init ``` {% callout type="note" title="Choosing a framework" %} diff --git a/docs/generated/packages/vite/documents/set-up-vite-manually.md b/docs/generated/packages/vite/documents/set-up-vite-manually.md index eb6fa564e3fc0..c29bd86f22b19 100644 --- a/docs/generated/packages/vite/documents/set-up-vite-manually.md +++ b/docs/generated/packages/vite/documents/set-up-vite-manually.md @@ -6,14 +6,14 @@ description: This guide explains how you can manually set up your project to use # Manually set up your project to use Vite.js {% callout type="note" title="Use our generator!" %} -It is recommended that you use the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator to do convert an existing project to use [Vite](https://vitejs.dev/). +It is recommended that you use the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator to do convert an existing project to use [Vite](https://vitejs.dev/). {% /callout %} -You can use the `@nrwl/vite:dev-server`,`@nrwl/vite:build` and `@nrwl/vite:test` executors to serve, build and test your project using [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/). To do this, you need to make a few adjustments to your project. It is recommended that you use the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator to do this, but you can also do it manually. +You can use the `@nx/vite:dev-server`,`@nx/vite:build` and `@nx/vite:test` executors to serve, build and test your project using [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/). To do this, you need to make a few adjustments to your project. It is recommended that you use the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator to do this, but you can also do it manually. A reason you may need to do this manually, is if our generator does not support conversion for your project, or if you want to experiment with custom options. -The list of steps below assumes that your project can be converted to use the `@nrwl/vite` executors. However, if it's not supported by the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator, it's likely that your project will not work as expected when converted. So, proceed with caution and always commit your code before making any changes. +The list of steps below assumes that your project can be converted to use the `@nx/vite` executors. However, if it's not supported by the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator, it's likely that your project will not work as expected when converted. So, proceed with caution and always commit your code before making any changes. ## 1. Change the executors in your `project.json` @@ -21,7 +21,7 @@ The list of steps below assumes that your project can be converted to use the `@ This applies to applications, not libraries. -In your app's `project.json` file, change the executor of your `serve` target to use `@nrwl/vite:dev-server` and set it up with the following options: +In your app's `project.json` file, change the executor of your `serve` target to use `@nx/vite:dev-server` and set it up with the following options: ```json //... @@ -29,7 +29,7 @@ In your app's `project.json` file, change the executor of your `serve` target to "targets": { //... "serve": { - "executor": "@nrwl/vite:dev-server", + "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -43,12 +43,12 @@ In your app's `project.json` file, change the executor of your `serve` target to ``` {% callout type="note" title="Other options" %} -Any extra options that you may need to add to your server's configuration can be added in your project's `vite.config.ts` file. You can find all the options that are supported in the [Vite.js documentation](https://vitejs.dev/config/). You can see which of these options you can add in your `project.json` in the [`@nrwl/vite:dev-server`](/packages/vite/executors/dev-server#options) documentation. +Any extra options that you may need to add to your server's configuration can be added in your project's `vite.config.ts` file. You can find all the options that are supported in the [Vite.js documentation](https://vitejs.dev/config/). You can see which of these options you can add in your `project.json` in the [`@nx/vite:dev-server`](/packages/vite/executors/dev-server#options) documentation. {% /callout %} ### The `build` target -In your project's `project.json` file, change the executor of your `build` target to use `@nrwl/vite:build` and set it up with the following options: +In your project's `project.json` file, change the executor of your `build` target to use `@nx/vite:build` and set it up with the following options: ```json //... @@ -56,7 +56,7 @@ In your project's `project.json` file, change the executor of your `build` targe "targets": { //... "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", ... "options": { "outputPath": "dist/apps/my-app" diff --git a/docs/generated/packages/vite/executors/build.json b/docs/generated/packages/vite/executors/build.json index 54b7f02f52d1b..0941b4f2549f8 100644 --- a/docs/generated/packages/vite/executors/build.json +++ b/docs/generated/packages/vite/executors/build.json @@ -96,7 +96,7 @@ }, "definitions": {}, "required": [], - "examplesFile": "---\ntitle: Examples for the Vite builder executor\ndescription: This page contains examples for the Vite @nrwl/vite:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/vite:build\",\n //...\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\"\n },\n //...\n }\n },\n }\n}\n```\n\n```bash\nnx serve my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set a custom path for vite.config.ts\" %}\n\nNx will automatically look in the root of your application for a `vite.config.ts` (or a `vite.config.js`) file. If you want to use a different path, you can set it in your `project.json` file, in the `build` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/vite:build\",\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\",\n \"configFile\": \"apps/my-app/vite.config.other-path.ts\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nor even\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/vite:build\",\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\",\n \"configFile\": \"vite.config.base.ts\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "---\ntitle: Examples for the Vite builder executor\ndescription: This page contains examples for the Vite @nx/vite:build executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/vite:build\",\n //...\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\"\n },\n //...\n }\n },\n }\n}\n```\n\n```bash\nnx serve my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set a custom path for vite.config.ts\" %}\n\nNx will automatically look in the root of your application for a `vite.config.ts` (or a `vite.config.js`) file. If you want to use a different path, you can set it in your `project.json` file, in the `build` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/vite:build\",\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\",\n \"configFile\": \"apps/my-app/vite.config.other-path.ts\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nor even\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/vite:build\",\n //...\n \"options\": {\n \"outputPath\": \"dist/apps/my-app\",\n \"configFile\": \"vite.config.base.ts\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "Build with Vite.", "aliases": [], diff --git a/docs/generated/packages/vite/executors/dev-server.json b/docs/generated/packages/vite/executors/dev-server.json index e253795453fd5..1d85a0c78863d 100644 --- a/docs/generated/packages/vite/executors/dev-server.json +++ b/docs/generated/packages/vite/executors/dev-server.json @@ -62,7 +62,7 @@ }, "definitions": {}, "required": ["buildTarget"], - "examplesFile": "---\ntitle: Examples for the Vite dev server executor\ndescription: This page contains examples for the Vite @nrwl/vite:dev-server executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nrwl/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n```bash\nnx serve my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set up a custom port\" %}\n\nYou can always set the port in your `vite.config.ts` file. However, you can also set it directly in your `project.json` file, in the `serve` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nrwl/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"port\": 4200,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Specify a proxyConfig\" %}\n\nYou can specify a proxy config by pointing to the path of your proxy configuration file:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nrwl/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"proxyConfig\": \"apps/my-app/proxy.conf.json\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "---\ntitle: Examples for the Vite dev server executor\ndescription: This page contains examples for the Vite @nx/vite:dev-server executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n```bash\nnx serve my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set up a custom port\" %}\n\nYou can always set the port in your `vite.config.ts` file. However, you can also set it directly in your `project.json` file, in the `serve` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"port\": 4200,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Specify a proxyConfig\" %}\n\nYou can specify a proxy config by pointing to the path of your proxy configuration file:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/vite:dev-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"proxyConfig\": \"apps/my-app/proxy.conf.json\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "Vite dev server.", "aliases": [], diff --git a/docs/generated/packages/vite/executors/preview-server.json b/docs/generated/packages/vite/executors/preview-server.json index d615766ebfe9f..e52f409a5af9f 100644 --- a/docs/generated/packages/vite/executors/preview-server.json +++ b/docs/generated/packages/vite/executors/preview-server.json @@ -50,7 +50,7 @@ }, "definitions": {}, "required": ["buildTarget"], - "examplesFile": "---\ntitle: Examples for the Vite preview server executor\ndescription: This page contains examples for the Vite @nrwl/vite:preview-server executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nrwl/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n```bash\nnx preview my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set up a custom port\" %}\n\nYou can always set the port in your `vite.config.ts` file. However, you can also set it directly in your `project.json` file, in the `preview` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nrwl/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"port\": 4200,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Specify a proxyConfig\" %}\n\nYou can specify a proxy config by pointing to the path of your proxy configuration file:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nrwl/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"proxyConfig\": \"apps/my-app/proxy.conf.json\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" + "examplesFile": "---\ntitle: Examples for the Vite preview server executor\ndescription: This page contains examples for the Vite @nx/vite:preview-server executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nx/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n```bash\nnx preview my-app\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Set up a custom port\" %}\n\nYou can always set the port in your `vite.config.ts` file. However, you can also set it directly in your `project.json` file, in the `preview` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nx/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"port\": 4200,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Specify a proxyConfig\" %}\n\nYou can specify a proxy config by pointing to the path of your proxy configuration file:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"preview\": {\n \"executor\": \"@nx/vite:preview-server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"my-app:build\",\n \"proxyConfig\": \"apps/my-app/proxy.conf.json\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n" }, "description": "Vite preview server", "aliases": [], diff --git a/docs/generated/packages/vite/executors/test.json b/docs/generated/packages/vite/executors/test.json index 185e99fd94b79..c99380b9c996b 100644 --- a/docs/generated/packages/vite/executors/test.json +++ b/docs/generated/packages/vite/executors/test.json @@ -64,7 +64,7 @@ } }, "required": [], - "examplesFile": "---\ntitle: Examples for the Vitest executor\ndescription: This page contains examples for the Vitest @nrwl/vite:test executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"test\": {\n \"executor\": \"@nrwl/vite:test\",\n //...\n //...\n \"options\": {\n \"config\": \"apps/my-app/vite.config.ts\"\n }\n //...\n }\n }\n}\n```\n\n```bash\nnx test my-app\n```\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Running in watch mode\" %}\nTo run testing in watch mode, you can create a new configuration within your test target, and have watch set to true. For example:\n\n```json\n\"my-app\": {\n \"targets\": {\n //...\n \"test\": {\n \"executor\": \"@nrwl/vite:test\",\n //...\n //...\n \"options\": {\n \"config\": \"apps/my-app/vite.config.ts\"\n },\n \"configurations\": {\n \"watch\": {\n \"watch\": true\n }\n }\n }\n }\n}\n```\n\nAnd then run `nx run my-app:test:watch`.\n\nAlternatively, you can just run the default test target with the `--watch` flag preset, like so:\n\n```bash\nnx run my-app:test --watch\n```\n\n{% /tab %}\n{% tab label=\"Updating snapshots\" %}\nWhenever a test fails because of an outdated snapshot, you can tell vitest to update them with the following:\n\n```bash\nnx run my-app:test -u\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "---\ntitle: Examples for the Vitest executor\ndescription: This page contains examples for the Vitest @nx/vite:test executor.\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"test\": {\n \"executor\": \"@nx/vite:test\",\n //...\n //...\n \"options\": {\n \"config\": \"apps/my-app/vite.config.ts\"\n }\n //...\n }\n }\n}\n```\n\n```bash\nnx test my-app\n```\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Running in watch mode\" %}\nTo run testing in watch mode, you can create a new configuration within your test target, and have watch set to true. For example:\n\n```json\n\"my-app\": {\n \"targets\": {\n //...\n \"test\": {\n \"executor\": \"@nx/vite:test\",\n //...\n //...\n \"options\": {\n \"config\": \"apps/my-app/vite.config.ts\"\n },\n \"configurations\": {\n \"watch\": {\n \"watch\": true\n }\n }\n }\n }\n}\n```\n\nAnd then run `nx run my-app:test:watch`.\n\nAlternatively, you can just run the default test target with the `--watch` flag preset, like so:\n\n```bash\nnx run my-app:test --watch\n```\n\n{% /tab %}\n{% tab label=\"Updating snapshots\" %}\nWhenever a test fails because of an outdated snapshot, you can tell vitest to update them with the following:\n\n```bash\nnx run my-app:test -u\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Test with Vitest", diff --git a/docs/generated/packages/vite/generators/configuration.json b/docs/generated/packages/vite/generators/configuration.json index 4f1eca889366b..e1534416b8617 100644 --- a/docs/generated/packages/vite/generators/configuration.json +++ b/docs/generated/packages/vite/generators/configuration.json @@ -57,7 +57,7 @@ "x-priority": "internal" } }, - "examplesFile": "---\ntitle: Examples for the Vite configuration generator\ndescription: This page contains examples for the Vite @nrwl/vite:configuration generator, which helps you set up Vite on your Nx workspace, or convert an existing project to use Vite.\n---\n\nThis generator is used for converting an existing React or Web project to use [Vite.js](https://vitejs.dev/) and the [@nrwl/vite executors](/packages/vite#executors).\n\nIt will change the `build` and `serve` targets to use the `@nrwl/vite` executors for serving and building the application. If you choose so, it will also change your `test` target to use the `@nrwl/vite:test` executor. It will create a `vite.config.ts` file at the root of your project with the correct settings, or if there's already a `vite.config.ts` file, it will modify it to include the correct settings.\n\n{% callout type=\"caution\" title=\"Your code will be modified!\" %}\nThis generator will modify your code, so make sure to commit your changes before running it.\n{% /callout %}\n\n```bash\nnx g @nrwl/vite:configuration\n```\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `project`, as the name of the project you want to generate the configuration for.\n- The `uiFramework` you want to use. Supported values are: `react` and `none`.\n\nYou must provide a `project` and a `uiFramework` for the generator to work.\n\nYou may also pass the `includeVitest` flag. This will also change your `test` target to use the `@nrwl/vite:test` executor, and configure your project for testing with [Vitest](https://vitest.dev/), by adding the `test` configuration in your `vite.config.ts` file.\n\n## Converting custom (specific) targets\n\nBy default, the `@nrwl/vite:configuration` generator will search your project's configuration to find the targets for serving, building, and testing your project, and it will attempt to convert these targets to use the `@nrwl/vite` executors.\n\nYour targets for building, serving and testing may not be named `build`, `serve` and `test`. Nx will try to infer the correct targets to convert, and it will attempt to convert the first one it finds for each of these actions if you have more than one. If you have more than one target for serving, building, or testing your project, you can pass the `--serveTarget`, `--buildTarget`, and `--testTarget` flags to the generator, to tell Nx specifically which targets to convert.\n\nNx will determine if the targets you provided (or the ones it inferred) are valid and can be converted to use the `@nrwl/vite` executors. If the targets are not valid, the generator will fail. If no targets are found - or recognized to be either supported or unsupported - Nx will ask you whether you want to convert your project anyway. If you choose to do so, Nx will configure your project to use Vite.js, creating new targets for you, and creating or modifying your `vite.config.ts` file. You can then test on your own if the result works or not, and modify the configuration as needed. It's suggested that if Nx does not recognize your targets automatically, you commit your changes before running the generator, so you can revert the changes if needed.\n\n## Projects that can be converted to use the `@nrwl/vite` executors\n\nUsually, React and Web projects generated with the `@nrwl/react` and the `@nrwl/web` generators can be converted to use the `@nrwl/vite` executors without any issues.\n\nThe list of executors for building, testing and serving that can be converted to use the `@nrwl/vite` executors is:\n\n### Supported `build` executors\n\n- `@nxext/vite:build`\n- `@nrwl/js:babel`\n- `@nrwl/js:swc`\n- `@nrwl/webpack:webpack`\n- `@nrwl/rollup:rollup`\n- `@nrwl/web:rollup`\n\n### Supported `serve` executors\n\n- `@nxext/vite:dev`\n- `@nrwl/webpack:dev-server`\n\n### Supported `test` executors\n\n- `@nrwl/jest:jest`\n- `@nxext/vitest:vitest`\n\n### Unsupported executors\n\n- `@nrwl/angular:ng-packagr-lite`\n- `@nrwl/angular:package`\n- `@nrwl/angular:webpack-browser`\n- `@angular-devkit/build-angular:browser`\n- `@angular-devkit/build-angular:dev-server`\n- `@nrwl/esbuild:esbuild`\n- `@nrwl/react-native:start`\n- `@nrwl/next:build`\n- `@nrwl/next:server`\n- `@nrwl/js:tsc`\n- any executor _not_ listed in the lists of \"supported executors\"\n- any project that does _not_ have a target for building, serving or testing\n\nWe **cannot** guarantee that projects using unsupported executors - _or any executor that is NOT listed in the list of \"supported executors\"_ - for either building, testing or serving will work correctly when converted to use the `@nrwl/vite` executors.\n\nIf you have a project that does _not_ use one of the supported executors you can try to [configure it to use the `@nrwl/vite` executors manually](/packages/vite/documents/set-up-vite-manually), but it may not work properly.\n\nYou can read more in the [Vite package overview page](/packages/vite).\n\n## Examples\n\n### Change a React app to use Vite\n\n```bash\nnx g @nrwl/vite:configuration --project=my-react-app --uiFramework=react --includeVitest\n```\n\nThis will change the `my-react-app` project to use the `@nrwl/vite` executors for building, serving and testing the application.\n\n### Change a Web app to use Vite\n\n```bash\nnx g @nrwl/vite:configuration --project=my-web-app --uiFramework=none --includeVitest\n```\n\nThis will change the `my-web-app` project to use the `@nrwl/vite` executors for building, serving and testing the application.\n\n### Change only my custom provided targets to use Vite\n\n```bash\nnx g @nrwl/vite:configuration --project=my-react-app --uiFramework=react --includeVitest --buildTarget=my-build --serveTarget=my-serve --testTarget=my-test\n```\n\nThis will change the `my-build`, `my-serve` and `my-test` targets to use the `@nrwl/vite` executors for building, serving and testing the application, even if you have other targets for these actions as well.\n", + "examplesFile": "---\ntitle: Examples for the Vite configuration generator\ndescription: This page contains examples for the Vite @nx/vite:configuration generator, which helps you set up Vite on your Nx workspace, or convert an existing project to use Vite.\n---\n\nThis generator is used for converting an existing React or Web project to use [Vite.js](https://vitejs.dev/) and the [@nx/vite executors](/packages/vite#executors).\n\nIt will change the `build` and `serve` targets to use the `@nx/vite` executors for serving and building the application. If you choose so, it will also change your `test` target to use the `@nx/vite:test` executor. It will create a `vite.config.ts` file at the root of your project with the correct settings, or if there's already a `vite.config.ts` file, it will modify it to include the correct settings.\n\n{% callout type=\"caution\" title=\"Your code will be modified!\" %}\nThis generator will modify your code, so make sure to commit your changes before running it.\n{% /callout %}\n\n```bash\nnx g @nx/vite:configuration\n```\n\nWhen running this generator, you will be prompted to provide the following:\n\n- The `project`, as the name of the project you want to generate the configuration for.\n- The `uiFramework` you want to use. Supported values are: `react` and `none`.\n\nYou must provide a `project` and a `uiFramework` for the generator to work.\n\nYou may also pass the `includeVitest` flag. This will also change your `test` target to use the `@nx/vite:test` executor, and configure your project for testing with [Vitest](https://vitest.dev/), by adding the `test` configuration in your `vite.config.ts` file.\n\n## Converting custom (specific) targets\n\nBy default, the `@nx/vite:configuration` generator will search your project's configuration to find the targets for serving, building, and testing your project, and it will attempt to convert these targets to use the `@nx/vite` executors.\n\nYour targets for building, serving and testing may not be named `build`, `serve` and `test`. Nx will try to infer the correct targets to convert, and it will attempt to convert the first one it finds for each of these actions if you have more than one. If you have more than one target for serving, building, or testing your project, you can pass the `--serveTarget`, `--buildTarget`, and `--testTarget` flags to the generator, to tell Nx specifically which targets to convert.\n\nNx will determine if the targets you provided (or the ones it inferred) are valid and can be converted to use the `@nx/vite` executors. If the targets are not valid, the generator will fail. If no targets are found - or recognized to be either supported or unsupported - Nx will ask you whether you want to convert your project anyway. If you choose to do so, Nx will configure your project to use Vite.js, creating new targets for you, and creating or modifying your `vite.config.ts` file. You can then test on your own if the result works or not, and modify the configuration as needed. It's suggested that if Nx does not recognize your targets automatically, you commit your changes before running the generator, so you can revert the changes if needed.\n\n## Projects that can be converted to use the `@nx/vite` executors\n\nUsually, React and Web projects generated with the `@nx/react` and the `@nx/web` generators can be converted to use the `@nx/vite` executors without any issues.\n\nThe list of executors for building, testing and serving that can be converted to use the `@nx/vite` executors is:\n\n### Supported `build` executors\n\n- `@nxext/vite:build`\n- `@nx/js:babel`\n- `@nx/js:swc`\n- `@nx/webpack:webpack`\n- `@nx/rollup:rollup`\n- `@nx/web:rollup`\n\n### Supported `serve` executors\n\n- `@nxext/vite:dev`\n- `@nx/webpack:dev-server`\n\n### Supported `test` executors\n\n- `@nx/jest:jest`\n- `@nxext/vitest:vitest`\n\n### Unsupported executors\n\n- `@nx/angular:ng-packagr-lite`\n- `@nx/angular:package`\n- `@nx/angular:webpack-browser`\n- `@angular-devkit/build-angular:browser`\n- `@angular-devkit/build-angular:dev-server`\n- `@nx/esbuild:esbuild`\n- `@nx/react-native:start`\n- `@nx/next:build`\n- `@nx/next:server`\n- `@nx/js:tsc`\n- any executor _not_ listed in the lists of \"supported executors\"\n- any project that does _not_ have a target for building, serving or testing\n\nWe **cannot** guarantee that projects using unsupported executors - _or any executor that is NOT listed in the list of \"supported executors\"_ - for either building, testing or serving will work correctly when converted to use the `@nx/vite` executors.\n\nIf you have a project that does _not_ use one of the supported executors you can try to [configure it to use the `@nx/vite` executors manually](/packages/vite/documents/set-up-vite-manually), but it may not work properly.\n\nYou can read more in the [Vite package overview page](/packages/vite).\n\n## Examples\n\n### Change a React app to use Vite\n\n```bash\nnx g @nx/vite:configuration --project=my-react-app --uiFramework=react --includeVitest\n```\n\nThis will change the `my-react-app` project to use the `@nx/vite` executors for building, serving and testing the application.\n\n### Change a Web app to use Vite\n\n```bash\nnx g @nx/vite:configuration --project=my-web-app --uiFramework=none --includeVitest\n```\n\nThis will change the `my-web-app` project to use the `@nx/vite` executors for building, serving and testing the application.\n\n### Change only my custom provided targets to use Vite\n\n```bash\nnx g @nx/vite:configuration --project=my-react-app --uiFramework=react --includeVitest --buildTarget=my-build --serveTarget=my-serve --testTarget=my-test\n```\n\nThis will change the `my-build`, `my-serve` and `my-test` targets to use the `@nx/vite` executors for building, serving and testing the application, even if you have other targets for these actions as well.\n", "presets": [] }, "description": "Add Vite configuration to an application.", diff --git a/docs/generated/packages/vite/generators/init.json b/docs/generated/packages/vite/generators/init.json index 91691ff9d014c..e46660ce2d921 100644 --- a/docs/generated/packages/vite/generators/init.json +++ b/docs/generated/packages/vite/generators/init.json @@ -21,7 +21,7 @@ "default": false } }, - "examplesFile": "---\ntitle: Examples for the Vite init generator\ndescription: This page contains examples for the Vite @nrwl/vite:init generator, which helps you initialize vite in your Nx workspace, by installing the necessary dependencies.\n---\n\nThis is a generator will initialize Vite.js in your workspace. It will install all the necessary dependencies. You can read more about how this generator works, in the [Vite package overview page](/packages/vite).\n\n{% callout type=\"note\" title=\"string\" %}\nYou don't need to use this generator on its own.\n{% /callout %}\n\nThis generator will be called automatically when you are either converting an existing React or Web app to use Vite, using the [`@nrwl/vite:configuration` generator](/packages/vite/generators/configuration), or when you are creating a new React or Web app using the [`@nrwl/react:app`](/packages/react/generators/application) or [`@nrwl/web:app`](/packages/web/generators/application) generators, if you choose `vite` as the `bundler`.\n\nIf you need to for some reason, you can use it on its own like this:\n\n```bash\nnx g @nrwl/vite:init\n```\n\n## Examples\n\n### Install all the necessary dependencies for Vite and the React plugin\n\n```bash\nnx g @nrwl/vite:init --uiFramework=react\n```\n\n### Install all the necessary dependencies for Vite\n\n```bash\nnx g @nrwl/vite:init --uiFramework=none\n```\n", + "examplesFile": "---\ntitle: Examples for the Vite init generator\ndescription: This page contains examples for the Vite @nx/vite:init generator, which helps you initialize vite in your Nx workspace, by installing the necessary dependencies.\n---\n\nThis is a generator will initialize Vite.js in your workspace. It will install all the necessary dependencies. You can read more about how this generator works, in the [Vite package overview page](/packages/vite).\n\n{% callout type=\"note\" title=\"string\" %}\nYou don't need to use this generator on its own.\n{% /callout %}\n\nThis generator will be called automatically when you are either converting an existing React or Web app to use Vite, using the [`@nx/vite:configuration` generator](/packages/vite/generators/configuration), or when you are creating a new React or Web app using the [`@nx/react:app`](/packages/react/generators/application) or [`@nx/web:app`](/packages/web/generators/application) generators, if you choose `vite` as the `bundler`.\n\nIf you need to for some reason, you can use it on its own like this:\n\n```bash\nnx g @nx/vite:init\n```\n\n## Examples\n\n### Install all the necessary dependencies for Vite and the React plugin\n\n```bash\nnx g @nx/vite:init --uiFramework=react\n```\n\n### Install all the necessary dependencies for Vite\n\n```bash\nnx g @nx/vite:init --uiFramework=none\n```\n", "presets": [] }, "description": "Initialize Vite in the workspace.", diff --git a/docs/generated/packages/web/documents/overview.md b/docs/generated/packages/web/documents/overview.md index dcd117ec4ee12..ff46772929595 100644 --- a/docs/generated/packages/web/documents/overview.md +++ b/docs/generated/packages/web/documents/overview.md @@ -12,10 +12,10 @@ To add the web plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/web +npm install -D @nx/web # For yarn users -yarn add -D @nrwl/web +yarn add -D @nx/web ``` ### Creating Applications @@ -23,7 +23,7 @@ yarn add -D @nrwl/web You can add a new application with the following: ```shell -nx g @nrwl/web:app my-new-app +nx g @nx/web:app my-new-app ``` The application uses no framework and generates with web components. You can add any framework you want on top of the default setup. @@ -36,13 +36,13 @@ If you are looking to add a React application, check out the [React plugin](/pac ### Creating Libraries -To create a generic TypeScript library (i.e. non-framework specific), use the [`@nrwl/js`](/packages/js) plugin. +To create a generic TypeScript library (i.e. non-framework specific), use the [`@nx/js`](/packages/js) plugin. ```shell -nx g @nrwl/js:lib my-new-lib +nx g @nx/js:lib my-new-lib # If you want the library to be publishable to npm -nx g @nrwl/js:lib my-new-lib \ +nx g @nx/js:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` diff --git a/docs/generated/packages/web/generators/application.json b/docs/generated/packages/web/generators/application.json index 3aa22d9d6aa38..d44bd521eaee4 100644 --- a/docs/generated/packages/web/generators/application.json +++ b/docs/generated/packages/web/generators/application.json @@ -100,7 +100,7 @@ } }, "required": ["name"], - "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nrwl/web:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nrwl/web:app my-app --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n```bash\nnx g @nrwl/web:app my-app --directory=my-dir\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nrwl/web:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", + "examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:app my-app --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n```bash\nnx g @nx/web:app my-app --directory=my-dir\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/web:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "aliases": ["app"], diff --git a/docs/generated/packages/webpack/documents/overview.md b/docs/generated/packages/webpack/documents/overview.md index b724870e27b38..1d9d6f637fe9b 100644 --- a/docs/generated/packages/webpack/documents/overview.md +++ b/docs/generated/packages/webpack/documents/overview.md @@ -5,7 +5,7 @@ description: The Nx Plugin for Webpack contains executors and generators that su The Nx plugin for [webpack](https://webpack.js.org/). -[Webpack](https://webpack.js.org/) is a static module bundler for modern JavaScript applications. The `@nrwl/webpack` plugin provides executors that allow you to build and serve your projects using webpack, plus an executor for SSR. +[Webpack](https://webpack.js.org/) is a static module bundler for modern JavaScript applications. The `@nx/webpack` plugin provides executors that allow you to build and serve your projects using webpack, plus an executor for SSR. Nx now allows you to [customize your webpack configuration](/packages/webpack/documents/webpack-config-setup) for your projects. And we also offer [a number of webpack plugins](/packages/webpack/documents/webpack-plugins) for supporting Nx and other frameworks. @@ -27,22 +27,22 @@ npx create-nx-workspace@latest --preset=react-monorepo --bundler=webpack ## Generate a new project using Webpack -You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Webpack in an existing Nx workspace. The [`@nrwl/react:app`](/packages/react/generators/application), [`@nrwl/node:app`](/packages/node/generators/application) and [`@nrwl/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `webpack`. This will generate a new application configured to use Webpack, and it will also install all the necessary dependencies, including the `@nrwl/webpack` plugin. +You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Webpack in an existing Nx workspace. The [`@nx/react:app`](/packages/react/generators/application), [`@nx/node:app`](/packages/node/generators/application) and [`@nx/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `webpack`. This will generate a new application configured to use Webpack, and it will also install all the necessary dependencies, including the `@nx/webpack` plugin. To generate a React application using Webpack, run the following: ```bash -nx g @nrwl/react:app my-app --bundler=webpack +nx g @nx/react:app my-app --bundler=webpack ``` To generate a Node application using Webpack, run the following: ```bash -nx g @nrwl/node:app my-app --bundler=webpack +nx g @nx/node:app my-app --bundler=webpack ``` To generate a Web application using Webpack, run the following: ```bash -nx g @nrwl/web:app my-app --bundler=webpack +nx g @nx/web:app my-app --bundler=webpack ``` diff --git a/docs/generated/packages/webpack/documents/webpack-config-setup.md b/docs/generated/packages/webpack/documents/webpack-config-setup.md index 0c196dd13dc18..322cd684703d1 100644 --- a/docs/generated/packages/webpack/documents/webpack-config-setup.md +++ b/docs/generated/packages/webpack/documents/webpack-config-setup.md @@ -13,7 +13,7 @@ You can configure Webpack using a `webpack.config.js` file in your project. You "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -43,7 +43,7 @@ Set `isolatedConfig` to `true` in your `project.json` file in the `build` target "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -65,7 +65,7 @@ Now, you need to manually add the Nx webpack plugins in your `webpack.config.js` You should start with a basic webpack configuration for Nx in your project, that looks like this: ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); module.exports = composePlugins(withNx(), (config, { options, context }) => { // customize webpack config here @@ -81,14 +81,14 @@ The `composePlugins` function takes a list of plugins and a function, and return 1. `config`: The webpack configuration object. 2. An object with the following properties: - - `options`: The options passed to the `@nrwl/webpack:webpack` executor. - - `context`: The context passed of the `@nrwl/webpack:webpack` executor. + - `options`: The options passed to the `@nx/webpack:webpack` executor. + - `context`: The context passed of the `@nx/webpack:webpack` executor. This gives you the ability to customize the webpack configuration as needed, and make use of the options and context passed to the executor, as well. ### Add configurations for other functionalities -In addition to the basic configuration, you can add configurations for other frameworks or features. The `@nrwl/webpack` package provides plugins such as `withWeb` and `withReact`. This plugins provide features such as TS support, CSS support, JSX support, etc. You can read more about how these plugins work and how to use them in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins). +In addition to the basic configuration, you can add configurations for other frameworks or features. The `@nx/webpack` package provides plugins such as `withWeb` and `withReact`. This plugins provide features such as TS support, CSS support, JSX support, etc. You can read more about how these plugins work and how to use them in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins). You may still reconfigure everything manually, without using the Nx plugins. However, these plugins ensure that you have the necessary configuration for Nx to work with your project. @@ -98,11 +98,11 @@ For most apps, the default configuration of webpack is sufficient, but sometimes ### Configure webpack for React projects -React projects use the `@nrwl/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config. +React projects use the `@nx/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config. ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact } = require('@nx/react'); // Nx plugins for webpack. module.exports = composePlugins( @@ -138,7 +138,7 @@ npm install -D css-loader {% /tabs %} ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); const { merge } = require('webpack-merge'); module.exports = composePlugins(withNx(), (config, { options, context }) => { @@ -157,14 +157,14 @@ module.exports = composePlugins(withNx(), (config, { options, context }) => { ### Configure webpack for Module Federation -If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nrwl/angular` or `@nrwl/react` then +If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nx/angular` or `@nx/react` then you can customize your webpack configuration as follows. ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); const { merge } = require('webpack-merge'); -const withModuleFederation = require('@nrwl/react/module-federation'); -// or `const withModuleFederation = require('@nrwl/angular/module-federation');` +const withModuleFederation = require('@nx/react/module-federation'); +// or `const withModuleFederation = require('@nx/angular/module-federation');` module.exports = composePlugins( withNx(), @@ -188,7 +188,7 @@ config object. Next.js supports webpack customization in the `next.config.js` file. ```js {% fileName="next.config.js" %} -const { withNx } = require('@nrwl/next/plugins/with-nx'); +const { withNx } = require('@nx/next/plugins/with-nx'); const nextConfig = { webpack: ( diff --git a/docs/generated/packages/webpack/documents/webpack-plugins.md b/docs/generated/packages/webpack/documents/webpack-plugins.md index d8929d6752ef2..90897910400a3 100644 --- a/docs/generated/packages/webpack/documents/webpack-plugins.md +++ b/docs/generated/packages/webpack/documents/webpack-plugins.md @@ -27,7 +27,7 @@ Disable type checks (useful to speed up builds). ### Example ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); module.exports = composePlugins(withNx(), (config) => { // Further customize webpack config @@ -110,7 +110,7 @@ Enables the use of subresource integrity validation. ### Example ```js -const { composePlugins, withNx, withWeb } = require('@nrwl/webpack'); +const { composePlugins, withNx, withWeb } = require('@nx/webpack'); module.exports = composePlugins( // always pass withNx() first @@ -143,8 +143,8 @@ SVGR allows SVG files to be imported as React components. Set this to `false` to ### Example ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact } = require('@nx/react'); module.exports = composePlugins( withNx(), // always pass withNx() first @@ -223,8 +223,8 @@ Shared libraries in addition to the ones that Nx detects automatically. Items ma {% tab label="React Module Federation" %} ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact, withModuleFederation } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact, withModuleFederation } = require('@nx/react'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -248,7 +248,7 @@ module.exports = composePlugins( const { composePlugins, withModuleFederation, -} = require('@nrwl/angular/module-federation'); +} = require('@nx/angular/module-federation'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -267,8 +267,8 @@ module.exports = composePlugins( {% tab label="React Module Federation for SSR " %} ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact, withModuleFederatioForSSRn } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact, withModuleFederatioForSSRn } = require('@nx/react'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -292,7 +292,7 @@ module.exports = composePlugins( const { composePlugins, withModuleFederationForSSR, -} = require('@nrwl/angular/module-federation'); +} = require('@nx/angular/module-federation'); // Host config // e.g. { remotes: ['about', 'dashboard'] } diff --git a/docs/generated/packages/webpack/executors/webpack.json b/docs/generated/packages/webpack/executors/webpack.json index aedff628be854..91106a199457a 100644 --- a/docs/generated/packages/webpack/executors/webpack.json +++ b/docs/generated/packages/webpack/executors/webpack.json @@ -478,7 +478,7 @@ ] } }, - "examplesFile": "---\ntitle: Examples for the @nrwl/webpack:webpack build executor\ndescription: Examples and a short guide on how to use the @nrwl/webpack:webpack build executor\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/webpack:webpack\",\n //...\n //...\n \"options\": {\n ...\n },\n //...\n }\n },\n }\n}\n```\n\n```bash\nnx build my-app\n```\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Using `babelUpwardRootMode`\" %}\n\nCopying from the [Babel documentation](https://babeljs.io/docs/config-files#root-babelconfigjson-file):\n\n> [...] if you are running your Babel compilation process from within a subpackage, you need to tell Babel where to look for the config. There are a few ways to do that, but the recommended way is the \"rootMode\" option with \"upward\", which will make Babel search from the working directory upward looking for your babel.config.json file, and will use its location as the \"root\" value.\n\nSetting `babelUpwardRootMode` to `true` in your `project.json` file means that Nx will set the `rootMode` option to `upward` in the Babel configuration. This may be useful in some cases, however we recommend that you don't set it at all, so it will use the default to `false`.\n\nSetting `babelUpwardRootMode` to `true` will cause issues in the case where you are importing a library (which does NOT have a `.babelrc` file) in an application which uses webpack to build. When Nx is trying to build the application, it will also build the library, and it will try to find a `.babelrc` file for that library, which it will not. This will cause the build to fail. So, in that case, it is better to either specify the path to the `.babelrc` file in your `webpack` application, using the `babelConfig` option or to not set `babelUpwardRootMode` at all, in which case Nx will infer the path to the `.babelrc` file for your application.\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"babelUpwardRootMode\": true,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Setting the path to the babel configuration file using `babelConfig`\" %}\n\nIf you have not set `babelUpwardRootMode` to `true` in your `project.json` file, you can set the path to your `.babelrc` file in your `project.json` file, in the `build` target options like this:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"babelConfig\": \"apps/my-app/.babelrc\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nIf you do not set the path to the `.babelrc` file, Nx will try to infer it. It will look for a `.babelrc` file in the root of your application.\n\n{% /tab %}\n\n{% tab label=\"Add a path to your webpack.config.js file\" %}\n\nYou can configure Webpack using a `webpack.config.js` file. If you do so, you can set the path to this file in your `project.json` file, in the `build` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"webpackConfig\": \"apps/my-app/webpack.config.js\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nRead more on how to configure Webpack in the [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup).\n\n{% /tab %}\n\n{% tab label=\"Run webpack with `isolatedConfig`\" %}\n\nSetting `isolatedConfig` to `true` in your `project.json` file means that Nx will not apply the Nx webpack plugins automatically. In that case, the Nx plugins need to be applied in the project's `webpack.config.js` file (e.g. `withNx`, `withReact`, etc.). So don't forget to also specify the path to your webpack config file (using the `webpackConfig` option).\n\nRead more on how to configure Webpack in our [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup) an in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins).\n\nNote that this is the new default setup for webpack in the latest version of Nx.\n\nSet `isolatedConfig` to `true` in your `project.json` file in the `build` target options like this:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nrwl/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"webpackConfig\": \"apps/my-app/webpack.config.js\",\n \"isolatedConfig\": true\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n", + "examplesFile": "---\ntitle: Examples for the @nx/webpack:webpack build executor\ndescription: Examples and a short guide on how to use the @nx/webpack:webpack build executor\n---\n\n`project.json`:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/webpack:webpack\",\n //...\n //...\n \"options\": {\n ...\n },\n //...\n }\n },\n }\n}\n```\n\n```bash\nnx build my-app\n```\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Using `babelUpwardRootMode`\" %}\n\nCopying from the [Babel documentation](https://babeljs.io/docs/config-files#root-babelconfigjson-file):\n\n> [...] if you are running your Babel compilation process from within a subpackage, you need to tell Babel where to look for the config. There are a few ways to do that, but the recommended way is the \"rootMode\" option with \"upward\", which will make Babel search from the working directory upward looking for your babel.config.json file, and will use its location as the \"root\" value.\n\nSetting `babelUpwardRootMode` to `true` in your `project.json` file means that Nx will set the `rootMode` option to `upward` in the Babel configuration. This may be useful in some cases, however we recommend that you don't set it at all, so it will use the default to `false`.\n\nSetting `babelUpwardRootMode` to `true` will cause issues in the case where you are importing a library (which does NOT have a `.babelrc` file) in an application which uses webpack to build. When Nx is trying to build the application, it will also build the library, and it will try to find a `.babelrc` file for that library, which it will not. This will cause the build to fail. So, in that case, it is better to either specify the path to the `.babelrc` file in your `webpack` application, using the `babelConfig` option or to not set `babelUpwardRootMode` at all, in which case Nx will infer the path to the `.babelrc` file for your application.\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"babelUpwardRootMode\": true,\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Setting the path to the babel configuration file using `babelConfig`\" %}\n\nIf you have not set `babelUpwardRootMode` to `true` in your `project.json` file, you can set the path to your `.babelrc` file in your `project.json` file, in the `build` target options like this:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"babelConfig\": \"apps/my-app/.babelrc\",\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nIf you do not set the path to the `.babelrc` file, Nx will try to infer it. It will look for a `.babelrc` file in the root of your application.\n\n{% /tab %}\n\n{% tab label=\"Add a path to your webpack.config.js file\" %}\n\nYou can configure Webpack using a `webpack.config.js` file. If you do so, you can set the path to this file in your `project.json` file, in the `build` target options:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"webpackConfig\": \"apps/my-app/webpack.config.js\"\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\nRead more on how to configure Webpack in the [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup).\n\n{% /tab %}\n\n{% tab label=\"Run webpack with `isolatedConfig`\" %}\n\nSetting `isolatedConfig` to `true` in your `project.json` file means that Nx will not apply the Nx webpack plugins automatically. In that case, the Nx plugins need to be applied in the project's `webpack.config.js` file (e.g. `withNx`, `withReact`, etc.). So don't forget to also specify the path to your webpack config file (using the `webpackConfig` option).\n\nRead more on how to configure Webpack in our [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup) an in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins).\n\nNote that this is the new default setup for webpack in the latest version of Nx.\n\nSet `isolatedConfig` to `true` in your `project.json` file in the `build` target options like this:\n\n```json\n//...\n\"my-app\": {\n \"targets\": {\n //...\n \"build\": {\n \"executor\": \"@nx/webpack:webpack\",\n //...\n \"options\": {\n //...\n \"webpackConfig\": \"apps/my-app/webpack.config.js\",\n \"isolatedConfig\": true\n },\n \"configurations\": {\n ...\n }\n },\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n", "presets": [] }, "description": "Run webpack build.", diff --git a/docs/generated/packages/workspace/documents/overview.md b/docs/generated/packages/workspace/documents/overview.md index 316e3e85055ed..935c733904536 100644 --- a/docs/generated/packages/workspace/documents/overview.md +++ b/docs/generated/packages/workspace/documents/overview.md @@ -2,18 +2,18 @@ The workspace plugin contains executors and generators that are useful for any N ## Creating Local Generators -Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nrwl/nx-plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins. +Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nx/plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins. > See more about [local generators](/recipes/generators/local-generators) ## Reorganizing Projects After some time of working within a workspace, projects might need to be moved or sometimes even removed. -The workspace plugin provides the [`@nrwl/workspace:move`](/packages/workspace/generators/move) and [`@nrwl/workspace:remove`](/packages/workspace/generators/remove) generators to help aid with this. +The workspace plugin provides the [`@nx/workspace:move`](/packages/workspace/generators/move) and [`@nx/workspace:remove`](/packages/workspace/generators/remove) generators to help aid with this. ### Moving Projects -Running `nx g @nrwl/workspace:move --projectName my-lib --destination new/location/my-lib` will move the `my-lib` library to `libs/new/location/my-lib`. +Running `nx g @nx/workspace:move --projectName my-lib --destination new/location/my-lib` will move the `my-lib` library to `libs/new/location/my-lib`. Moving the files manually can be done easily but a lot of steps are often missed when projects are moved. This generator will also handle the following: @@ -24,11 +24,11 @@ Moving the files manually can be done easily but a lot of steps are often missed 5. Paths in target options such as output path will be changed 6. Other configuration will be updated too, such as `extends` in `tsconfig.json`, the name of the project in `jest.config.js`, and the extends in `.eslintrc.json` -> See more about [`@nrwl/workspace:move`](/packages/workspace/generators/move) +> See more about [`@nx/workspace:move`](/packages/workspace/generators/move) ### Removing Projects -Running `nx g @nrwl/workspace:remove my-lib` will remove the `my-lib` from the workspace. It is important to note that sometimes, projects cannot be removed if they are still depended on by other projects. +Running `nx g @nx/workspace:remove my-lib` will remove the `my-lib` from the workspace. It is important to note that sometimes, projects cannot be removed if they are still depended on by other projects. Like when moving projects, some steps are often missed when removing projects. This generator will also handle the following: @@ -37,12 +37,12 @@ Like when moving projects, some steps are often missed when removing projects. T 3. The project's configuration will be removed. 4. The path mapping in `tsconfig.base.json` will be removed. -> See more about [`@nrwl/workspace:remove`](/packages/workspace/generators/remove) +> See more about [`@nx/workspace:remove`](/packages/workspace/generators/remove) ## Running custom commands Executors provide an optimized way of running targets but unfortunately, not every target has an executor written for it. The [`nx:run-commands`](/packages/nx/executors/run-commands) executor is an executor that runs any command or multiple commands in the shell. This can be useful when integrating with other tools which do not have an executor provided. There is also a generator to help configure this executor. -Running `nx g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'` will create a `my-feature-lib:printhello` target that executes `echo hello` in the shell. +Running `nx g @nx/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'` will create a `my-feature-lib:printhello` target that executes `echo hello` in the shell. > See more about [`nx:run-commands`](/packages/nx/executors/run-commands) diff --git a/docs/map.json b/docs/map.json index c407f0e8910b9..4a56c9a182c04 100644 --- a/docs/map.json +++ b/docs/map.json @@ -581,7 +581,7 @@ "id": "packages-devkit", "tags": ["create-your-own-plugin"], "file": "", - "path": "/packages/devkit/documents/nrwl_devkit", + "path": "/packages/devkit/documents/nx_devkit", "isExternal": true }, { @@ -1299,6 +1299,12 @@ "tags": [], "file": "shared/recipes/identify-dependencies-between-folders" }, + { + "name": "Rescope Packages from @nrwl to @nx", + "id": "rescope", + "tags": [], + "file": "shared/recipes/rescope" + }, { "name": "Standalone NgRx APIs", "id": "standalone-ngrx-apis", @@ -1644,9 +1650,9 @@ "description": "Devkit package.", "itemList": [ { - "id": "nrwl_devkit", + "id": "nx_devkit", "name": "Overview", - "file": "generated/devkit/nrwl_devkit" + "file": "generated/devkit/nx_devkit" }, { "id": "ngcli_adapter", diff --git a/docs/nx-cloud/reference/release-notes.md b/docs/nx-cloud/reference/release-notes.md index b623f9a2dff7e..84ff135de366a 100644 --- a/docs/nx-cloud/reference/release-notes.md +++ b/docs/nx-cloud/reference/release-notes.md @@ -1,4 +1,10 @@ -# `@nrwl/nx-cloud` - Release notes +# `nx-cloud` - Release notes + +{% callout type="check" title="@nrwl/nx-cloud was changed to nx-cloud" %} + +[Read more about the rescope ≫](/recipes/other/rescope) + +{% /callout %} ## 14.3.0 @@ -12,7 +18,7 @@ ## 14.1.2 -- Fix: Provider nicer failure message when version of Nx is incompatible with `@nrwl/nx-cloud` +- Fix: Provider nicer failure message when version of Nx is incompatible with `@nx/nx-cloud` - Fix: Use Nx task graph if provided ## 14.1.1 @@ -28,7 +34,7 @@ ## 14.0.5 - Fix: Workspace name for new Nx Cloud workspaces is pulled from `package.json` instead of `nx.json` -- Fix: `@nrwl/nx-cloud` can be run from directories other than workspace root +- Fix: `@nx/nx-cloud` can be run from directories other than workspace root - Fix: Correctly infer `NX_BRANCH` and `NX_RUN_GROUP` from Jenkins - Fix: Ignore errors related to excess whitespace in tarballs @@ -38,7 +44,7 @@ ## 14.0.2 -- Fix: Remove dependency on `@nrwl/devkit` for init generator +- Fix: Remove dependency on `@nx/devkit` for init generator ## 14.0.1 diff --git a/docs/shared/angular-standalone-tutorial/1-code-generation.md b/docs/shared/angular-standalone-tutorial/1-code-generation.md index 98ebec496f118..b62d112d03401 100644 --- a/docs/shared/angular-standalone-tutorial/1-code-generation.md +++ b/docs/shared/angular-standalone-tutorial/1-code-generation.md @@ -12,7 +12,7 @@ src="https://www.youtube.com/embed/LYPVrWQNnEc" title="Tutorial: Standalone Angular Application" width="100%" /%} -{% github-repository url="https://github.com/nrwl/nx-recipes/tree/main/standalone-angular-app" /%} +{% github-repository url="https://github.nx/nx-recipes/tree/main/standalone-angular-app" /%} # Angular Standalone Tutorial - Part 1: Code Generation @@ -64,13 +64,13 @@ There are two projects that have been created for you: As far as Nx is concerned, the root-level `store` app owns every file that doesn't belong to a different project. So files in the `e2e` folder belong to the `e2e` project, everything else belongs to `store`. -{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nrwl/cypress package page." url="/packages/cypress" /%} +{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nx/cypress package page." url="/packages/cypress" /%} ## Generating a component for the store -```{% command="npx nx g @nrwl/angular:component shop --project=store" path="~/store" %} +```{% command="npx nx g @nx/angular:component shop --project=store" path="~/store" %} -> NX Generating @nrwl/angular:component +> NX Generating @nx/angular:component CREATE src/app/shop/shop.component.css CREATE src/app/shop/shop.component.html @@ -83,11 +83,11 @@ UPDATE src/app/app.module.ts ## Generating Libraries -To create the `cart` and `shared/ui` libraries, use the `@nrwl/angular:lib` generator: +To create the `cart` and `shared/ui` libraries, use the nx/angular:lib` generator: -```{% command="npx nx g @nrwl/angular:library cart" path="~/store" %} +```{% command="npx nx g @nx/angular:library cart" path="~/store" %} -> NX Generating @nrwl/angular:library +> NX Generating @nx/angular:library CREATE cart/README.md CREATE cart/tsconfig.lib.json @@ -102,9 +102,9 @@ CREATE cart/src/test-setup.ts CREATE cart/.eslintrc.json ``` -```{% command="npx nx g @nrwl/angular:lib shared/ui --buildable" path="~/store" %} +```{% command="npx nx g @nx/angular:lib shared/ui --buildable" path="~/store" %} -> NX Generating @nrwl/angular:library +> NX Generating @nx/angular:library UPDATE jest.config.ts CREATE jest.config.app.ts diff --git a/docs/shared/angular-standalone-tutorial/2-project-graph.md b/docs/shared/angular-standalone-tutorial/2-project-graph.md index 67da3e59836af..bb8c63d3f0854 100644 --- a/docs/shared/angular-standalone-tutorial/2-project-graph.md +++ b/docs/shared/angular-standalone-tutorial/2-project-graph.md @@ -101,11 +101,11 @@ When a library is created, Nx adds a new Typescript path to the `tsconfig.base.j ### `shared-ui` -Run the `@nrwl/angular:component` generator with the command: +Run the `@nx/angular:component` generator with the command: -```{% command="npx nx g @nrwl/angular:component banner --project=shared-ui --export" path="~/store" %} +```{% command="npx nx g @nx/angular:component banner --project=shared-ui --export" path="~/store" %} -> NX Generating @nrwl/angular:component +> NX Generating @nx/angular:component CREATE shared/ui/src/lib/banner/banner.component.css CREATE shared/ui/src/lib/banner/banner.component.html @@ -138,9 +138,9 @@ export class BannerComponent { Create a cart-route component: -```{% command="npx nx g @nrwl/angular:component cart-route --project=cart" path="~/store" %} +```{% command="npx nx g @nx/angular:component cart-route --project=cart" path="~/store" %} -> NX Generating @nrwl/angular:component +> NX Generating @nx/angular:component CREATE cart/src/lib/cart-route/cart-route.component.css CREATE cart/src/lib/cart-route/cart-route.component.html diff --git a/docs/shared/angular-standalone-tutorial/3-task-running.md b/docs/shared/angular-standalone-tutorial/3-task-running.md index 5b83b98fc5077..fbc7fdd648a77 100644 --- a/docs/shared/angular-standalone-tutorial/3-task-running.md +++ b/docs/shared/angular-standalone-tutorial/3-task-running.md @@ -23,7 +23,7 @@ Here's the `project.json` file for your `shared-ui` project: "prefix": "store", "targets": { "build": { - "executor": "@nrwl/angular:ng-packagr-lite", + "executor": "@nx/angular:ng-packagr-lite", "outputs": ["{workspaceRoot}/dist/{projectRoot}"], "options": { "project": "shared/ui/ng-package.json" @@ -39,7 +39,7 @@ Here's the `project.json` file for your `shared-ui` project: "defaultConfiguration": "production" }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "shared/ui/jest.config.ts", @@ -47,7 +47,7 @@ Here's the `project.json` file for your `shared-ui` project: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "options": { "lintFilePatterns": ["shared/ui/**/*.ts", "shared/ui/**/*.html"] } diff --git a/docs/shared/angular-standalone-tutorial/4-task-pipelines.md b/docs/shared/angular-standalone-tutorial/4-task-pipelines.md index e1b19bad190a7..7b6f5af70bbd0 100644 --- a/docs/shared/angular-standalone-tutorial/4-task-pipelines.md +++ b/docs/shared/angular-standalone-tutorial/4-task-pipelines.md @@ -138,7 +138,7 @@ Here are the outputs defined for the `shared-ui` project: "prefix": "store", "targets": { "build": { - "executor": "@nrwl/angular:ng-packagr-lite", + "executor": "@nx/angular:ng-packagr-lite", "outputs": ["{workspaceRoot}/dist/{projectRoot}"], "options": { "project": "shared/ui/ng-package.json" @@ -154,7 +154,7 @@ Here are the outputs defined for the `shared-ui` project: "defaultConfiguration": "production" }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "shared/ui/jest.config.ts", @@ -162,7 +162,7 @@ Here are the outputs defined for the `shared-ui` project: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "options": { "lintFilePatterns": ["shared/ui/**/*.ts", "shared/ui/**/*.html"] } diff --git a/docs/shared/angular-tutorial/1-code-generation.md b/docs/shared/angular-tutorial/1-code-generation.md index 2cb09fff7aa60..c07dd4b58d31f 100644 --- a/docs/shared/angular-tutorial/1-code-generation.md +++ b/docs/shared/angular-tutorial/1-code-generation.md @@ -46,16 +46,16 @@ Once the command completes, notice two projects were added to the workspace: - An Angular application located in `apps/store`. - A Project for Cypress e2e tests for our `store` application in `apps/store-e2e`. -{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nrwl/cypress package page." url="/packages/cypress" /%} +{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nx/cypress package page." url="/packages/cypress" /%} ## Adding Another Application to Your Workspace Run this command to create your `admin` app: -```{% command="npx nx g @nrwl/angular:app admin" path="~/myorg" %} -npx nx g @nrwl/angular:app admin +```{% command="npx nx g @nx/angular:app admin" path="~/myorg" %} +npx nx g @nx/angular:app admin -> NX Generating @nrwl/angular:application +> NX Generating @nx/angular:application ✔ Would you like to configure routing for this application? (y/N) · false [NX] Angular devkit called `writeWorkspace`, this may have created 'workspace.json' or 'angular.json @@ -95,11 +95,11 @@ CREATE apps/admin-e2e/.eslintrc.json ## Generating Libraries -To create the `common-ui` and `products` libraries, use the `@nrwl/angular:lib` and `@nrwl/js:lib` generators respectively: +To create the `common-ui` and `products` libraries, use the `@nx/angular:lib` and `@nx/js:lib` generators respectively: -```{% command="npx nx g @nrwl/angular:lib common-ui" path="~/myorg" %} +```{% command="npx nx g @nx/angular:lib common-ui" path="~/myorg" %} -> NX Generating @nrwl/angular:library +> NX Generating @nx/angular:library [NX] Angular devkit called `writeWorkspace`, this may have created 'workspace.json' or 'angular.json [NX] Double check workspace configuration before proceeding @@ -117,9 +117,9 @@ CREATE libs/common-ui/src/test-setup.ts CREATE libs/common-ui/.eslintrc.json ``` -```{% command="npx nx g @nrwl/js:lib products" path="~/myorg" %} +```{% command="npx nx g @nx/js:lib products" path="~/myorg" %} -> NX Generating @nrwl/js:library +> NX Generating @nx/js:library CREATE libs/products/README.md CREATE libs/products/package.json diff --git a/docs/shared/angular-tutorial/2-project-graph.md b/docs/shared/angular-tutorial/2-project-graph.md index 06d7a1fa79c53..cf4d2efcbde56 100644 --- a/docs/shared/angular-tutorial/2-project-graph.md +++ b/docs/shared/angular-tutorial/2-project-graph.md @@ -12,11 +12,11 @@ The Project Graph is derived from the source code of your workspace. Make the fo ### `common-ui` -Run the `@nrwl/angular:component` generator with the command: +Run the `@nx/angular:component` generator with the command: -```{% command="npx nx g @nrwl/angular:component banner --project=common-ui --export" path="~/myorg" %} +```{% command="npx nx g @nx/angular:component banner --project=common-ui --export" path="~/myorg" %} -> NX Generating @nrwl/angular:component +> NX Generating @nx/angular:component CREATE libs/common-ui/src/lib/banner/banner.component.css CREATE libs/common-ui/src/lib/banner/banner.component.html diff --git a/docs/shared/angular-tutorial/3-task-running.md b/docs/shared/angular-tutorial/3-task-running.md index dc21b1a68e35b..a3f5227e42d0d 100644 --- a/docs/shared/angular-tutorial/3-task-running.md +++ b/docs/shared/angular-tutorial/3-task-running.md @@ -23,7 +23,7 @@ Here's the `project.json` file for your `common-ui` project: "prefix": "myorg", "targets": { "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "libs/common-ui/jest.config.ts", @@ -31,7 +31,7 @@ Here's the `project.json` file for your `common-ui` project: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "options": { "lintFilePatterns": [ "libs/common-ui/**/*.ts", diff --git a/docs/shared/angular-tutorial/4-workspace-optimization.md b/docs/shared/angular-tutorial/4-workspace-optimization.md index 7483bd5f3a38e..cef86d2f3d22e 100644 --- a/docs/shared/angular-tutorial/4-workspace-optimization.md +++ b/docs/shared/angular-tutorial/4-workspace-optimization.md @@ -69,7 +69,7 @@ Outputs are defined for every target in your workspace: "projectType": "library", "targets": { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/products", @@ -79,14 +79,14 @@ Outputs are defined for every target in your workspace: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/products/**/*.ts"] } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "libs/products/jest.config.ts", diff --git a/docs/shared/cli/generate.md b/docs/shared/cli/generate.md index a4a6e4d5c67ea..82c6f114c88f1 100644 --- a/docs/shared/cli/generate.md +++ b/docs/shared/cli/generate.md @@ -24,43 +24,43 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx` Generate a new Angular application: ```shell -nx generate @nrwl/angular:app myapp +nx generate @nx/angular:app myapp ``` Generate a new React application: ```shell -nx generate @nrwl/react:app myapp +nx generate @nx/react:app myapp ``` Generate a new web component application: ```shell -nx generate @nrwl/web:app myapp +nx generate @nx/web:app myapp ``` Generate a new Node application: ```shell -nx generate @nrwl/node:app myapp +nx generate @nx/node:app myapp ``` Generate a new Angular library application: ```shell -nx generate @nrwl/angular:library mylibrary +nx generate @nx/angular:library mylibrary ``` Generate a new React library application: ```shell -nx generate @nrwl/react:library mylibrary +nx generate @nx/react:library mylibrary ``` Generate a new Node library application: ```shell -nx generate @nrwl/node:library mylibrary +nx generate @nx/node:library mylibrary ``` ## Options diff --git a/docs/shared/core-features/automate-updating-dependencies.md b/docs/shared/core-features/automate-updating-dependencies.md index 32f1e2e43f7cf..1158778d91fb9 100644 --- a/docs/shared/core-features/automate-updating-dependencies.md +++ b/docs/shared/core-features/automate-updating-dependencies.md @@ -17,16 +17,16 @@ Updating happens in three steps: First, run the `migrate` command: ```shell -nx migrate latest # same as nx migrate @nrwl/workspace@latest +nx migrate latest # same as nx migrate @nx/workspace@latest ``` You can also specify the name of the package and the version: ```shell -nx migrate @nrwl/workspace@version # you can also specify version +nx migrate @nx/workspace@version # you can also specify version ``` -This fetches the specified version of the `@nrwl/workspace` package, analyzes the dependencies and fetches all the dependent packages. The process keeps going until all the dependencies are resolved. This results in: +This fetches the specified version of the `@nx/workspace` package, analyzes the dependencies and fetches all the dependent packages. The process keeps going until all the dependencies are resolved. This results in: - The `package.json` being updated - A `migrations.json` being generated if there are pending migrations. diff --git a/docs/shared/core-features/distribute-task-execution.md b/docs/shared/core-features/distribute-task-execution.md index 76942675065d6..d176c048230ae 100644 --- a/docs/shared/core-features/distribute-task-execution.md +++ b/docs/shared/core-features/distribute-task-execution.md @@ -43,7 +43,7 @@ This command installs the latest version of `nx-cloud`. The latest version works If you have a new workspace, you can generate the CI configuration as follows: ```shell title="2. Enable DTE in CI" -nx generate @nrwl/workspace:ci-workflow --ci=github +nx generate @nx/workspace:ci-workflow --ci=github ``` The `--ci` flag can be `github`, `circleci` or `azure`. diff --git a/docs/shared/core-features/enforce-project-boundaries.md b/docs/shared/core-features/enforce-project-boundaries.md index abe5cb6c8134b..2db3bc8541c51 100644 --- a/docs/shared/core-features/enforce-project-boundaries.md +++ b/docs/shared/core-features/enforce-project-boundaries.md @@ -11,17 +11,17 @@ Nx provides an `enforce-module-boundaries` eslint rule that enforces the public To set up the lint rule, install these dependencies: ```shell -npm i @nrwl/eslint-plugin-nx @nrwl/devkit +npm i @nx/eslint-plugin @nx/devkit ``` And configure the rule in your root `.eslintrc.json` file: ```jsonc {% fileName=".eslintrc.json" %} { - "plugins": ["@nrwl/nx"], + "plugins": ["@nx/nx"], // ... "rules": { - "@nrwl/nx/enforce-module-boundaries": [ + "@nx/enforce-module-boundaries": [ "error", { /* options */ @@ -96,14 +96,14 @@ First, use your project configuration (in `project.json` or `package.json`) to a Next you should update your root lint configuration: -- If you are using **ESLint** you should look for an existing rule entry in your root `.eslintrc.json` called `"@nrwl/nx/enforce-module-boundaries"` and you should update the `"depConstraints"`: +- If you are using **ESLint** you should look for an existing rule entry in your root `.eslintrc.json` called `"@nx/enforce-module-boundaries"` and you should update the `"depConstraints"`: ```jsonc {% fileName=".eslintrc.json" %} { // ... more ESLint config here - // @nrwl/nx/enforce-module-boundaries should already exist within an "overrides" block using `"files": ["*.ts", "*.tsx", "*.js", "*.jsx",]` - "@nrwl/nx/enforce-module-boundaries": [ + // @nx/enforce-module-boundaries should already exist within an "overrides" block using `"files": ["*.ts", "*.tsx", "*.js", "*.jsx",]` + "@nx/enforce-module-boundaries": [ "error", { "allow": [], diff --git a/docs/shared/core-features/run-tasks.md b/docs/shared/core-features/run-tasks.md index e47f56b8b6111..940ec5aaa73c1 100644 --- a/docs/shared/core-features/run-tasks.md +++ b/docs/shared/core-features/run-tasks.md @@ -40,7 +40,7 @@ Each project has the `test` and `build` targets defined. Tasks can be defined as } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { "codeCoverage": true } diff --git a/docs/shared/core-tutorial/05-auto-detect-dependencies.md b/docs/shared/core-tutorial/05-auto-detect-dependencies.md index d975ea21155fe..fb520e683ae63 100644 --- a/docs/shared/core-tutorial/05-auto-detect-dependencies.md +++ b/docs/shared/core-tutorial/05-auto-detect-dependencies.md @@ -20,7 +20,7 @@ This preset is set to only load dependencies from `package.json` or `project.jso ```json { "pluginsConfig": { - "@nrwl/js": { + "@nx/js": { "analyzeSourceFiles": true } } @@ -124,7 +124,7 @@ If at some point in the future the code is refactored so that cow no longer refe ## More Tooling -If you want Nx to do more for you, you can install the `@nrwl/js` plugin to help with typescript or javascript tooling. This plugin provides out of the box: +If you want Nx to do more for you, you can install the `@nx/js` plugin to help with typescript or javascript tooling. This plugin provides out of the box: - Typescript alias paths - Build with `tsc` or `swc` diff --git a/docs/shared/deprecated/default-collection.md b/docs/shared/deprecated/default-collection.md index 8cdd285fddd83..98642f41b9a66 100644 --- a/docs/shared/deprecated/default-collection.md +++ b/docs/shared/deprecated/default-collection.md @@ -5,7 +5,7 @@ In the `nx.json` you can set a `defaultCollection` property like this: ```jsonc { "cli": { - "defaultCollection": "@nrwl/next" + "defaultCollection": "@nx/next" } } ``` @@ -16,24 +16,24 @@ This would cause the following command nx g library my-lib ``` -To create a `@nrwl/next:library` library instead of some other generator with the name `library`. +To create a `@nx/next:library` library instead of some other generator with the name `library`. This property is no longer needed because the Nx cli automatically will prompt you to choose between the available options if there is any ambiguity. The output looks like this: ```shell > nx g lib my-lib ? Which generator would you like to use? … -@nrwl/react-native:library -@nrwl/angular:library -@nrwl/expo:library -@nrwl/nest:library -@nrwl/node:library +@nx/react-native:library +@nx/angular:library +@nx/expo:library +@nx/nest:library +@nx/node:library @nestjs/schematics:library @schematics/angular:library -@nrwl/js:library -@nrwl/next:library -@nrwl/react:library +@nx/js:library +@nx/next:library +@nx/react:library None of the above ``` diff --git a/docs/shared/deprecated/workspace-executors.md b/docs/shared/deprecated/workspace-executors.md index a29da6cb9bfd0..0f2488dce9f6b 100644 --- a/docs/shared/deprecated/workspace-executors.md +++ b/docs/shared/deprecated/workspace-executors.md @@ -8,14 +8,14 @@ In Nx 13.10+, local nx plugins can contain executors that are used in the worksp ```shell # replace `latest` with the version that matches your Nx version -npm install @nrwl/nx-plugin@latest -nx g @nrwl/nx-plugin:plugin my-plugin +npm install @nx/plugin@latest +nx g @nx/plugin:plugin my-plugin ``` - Use the Nx CLI to generate the initial files needed for your executor. Replace `my-executor` with the name of your workspace executor. ```shell -nx generate @nrwl/nx-plugin:executor my-executor --project=my-plugin +nx generate @nx/plugin:executor my-executor --project=my-plugin ``` - Copy the code for your workspace executor into the newly created executor's folder. e.g. `libs/my-plugin/src/executors/my-executor/` diff --git a/docs/shared/deprecated/workspace-generators.md b/docs/shared/deprecated/workspace-generators.md index 6f01e6d06295c..e9f5eda7ddde0 100644 --- a/docs/shared/deprecated/workspace-generators.md +++ b/docs/shared/deprecated/workspace-generators.md @@ -16,14 +16,14 @@ When migrating to Nx 16, a new workspace plugin is automatically generated in th ```shell # replace `latest` with the version that matches your Nx version -npm install @nrwl/nx-plugin@latest -nx g @nrwl/nx-plugin:plugin my-plugin +npm install @nx/plugin@latest +nx g @nx/plugin:plugin my-plugin ``` - Use the Nx CLI to generate the initial files needed for your generator. Replace `my-generator` with the name of your workspace generator. ```shell -nx generate @nrwl/nx-plugin:generator my-generator --project=my-plugin +nx generate @nx/plugin:generator my-generator --project=my-plugin ``` - Copy the code for your workspace generator into the newly created generator's folder. e.g. `libs/my-plugin/src/generators/my-generator/` diff --git a/docs/shared/deprecated/workspace-json.md b/docs/shared/deprecated/workspace-json.md index 65dbd57abc4e1..c6b8c3a47c3a1 100644 --- a/docs/shared/deprecated/workspace-json.md +++ b/docs/shared/deprecated/workspace-json.md @@ -14,7 +14,7 @@ The target configuration for each project is now stored in individual `project.j To remove `workspace.json` in favor of `project.json` files, run: ```shell -nx g @nrwl/workspace:fix-configuration +nx g @nx/workspace:fix-configuration ``` See [fix-configuration](/packages/workspace/generators/fix-configuration) for more options. diff --git a/docs/shared/eslint.md b/docs/shared/eslint.md index eb9bff5004a19..63efaaf56b90e 100644 --- a/docs/shared/eslint.md +++ b/docs/shared/eslint.md @@ -10,7 +10,7 @@ Let's take an example of an ESLint config that Nx might generate for you out of ```jsonc {% fileName="apps/tuskdesk/.eslintrc.json" %} { - "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "extends": ["plugin:@nx/react", "../../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { @@ -35,7 +35,7 @@ If we now come in and add a rule which does require type information, for exampl ```jsonc {% fileName="apps/tuskdesk/.eslintrc.json" %} { - "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "extends": ["plugin:@nx/react", "../../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { @@ -76,7 +76,7 @@ The solution is to update our config once more, this time to set `parserOptions. ```jsonc {% fileName="apps/tuskdesk/.eslintrc.json" %} { - "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "extends": ["plugin:@nx/react", "../../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { diff --git a/docs/shared/getting-started/why-nx.md b/docs/shared/getting-started/why-nx.md index a09b8eebe3d7d..ee36e53f5d470 100644 --- a/docs/shared/getting-started/why-nx.md +++ b/docs/shared/getting-started/why-nx.md @@ -23,7 +23,7 @@ Nx is built in a modular fashion to let you only use the features you need. ![High-level Nx architecture](../images/nx-architecture.svg) - The **Nx** package provides fundamental technology-agnostic capabilities such as: [workspace analysis](/core-features/explore-graph), [task running](/core-features/run-tasks), [caching](/core-features/cache-task-results), [distribution](/core-features/distribute-task-execution), [code generation](/plugin-features/use-code-generators) and [automated code migrations](/core-features/automate-updating-dependencies). -- **Plugins** are NPM packages that built on top of the fundamental capabilities provided by the Nx package. Nx plugins contain [code generators](/plugin-features/use-code-generators), [executors](/plugin-features/use-task-executors) (to abstract lower-level build tooling) and automated code migrations for keeping your tools up to date. Contrary to the Nx package, which works the same way with any JS or non-JS project, plugins are usually technology specific. For instance, `@nrwl/react` adds support for building React apps and libs, `@nrwl/cypress` adds e2e testing capabilities with Cypress. Plugins make developers more productive by removing any friction of integrating different tools with each other and by providing utilities to keep them up to date. The Nx team maintains plugins for React, Next, Remix, Angular, Jest, Cypress, Storybook and more. You can use the `@nrwl/nx-plugin` package to easily [scaffold a new plugin](/plugin-features/create-your-own-plugin) or even just [automate your local workspace](/recipes/generators/local-generators). There are also more than 80 [community plugins](/community). +- **Plugins** are NPM packages that built on top of the fundamental capabilities provided by the Nx package. Nx plugins contain [code generators](/plugin-features/use-code-generators), [executors](/plugin-features/use-task-executors) (to abstract lower-level build tooling) and automated code migrations for keeping your tools up to date. Contrary to the Nx package, which works the same way with any JS or non-JS project, plugins are usually technology specific. For instance, `@nx/react` adds support for building React apps and libs, `@nx/cypress` adds e2e testing capabilities with Cypress. Plugins make developers more productive by removing any friction of integrating different tools with each other and by providing utilities to keep them up to date. The Nx team maintains plugins for React, Next, Remix, Angular, Jest, Cypress, Storybook and more. You can use the `@nx/plugin` package to easily [scaffold a new plugin](/plugin-features/create-your-own-plugin) or even just [automate your local workspace](/recipes/generators/local-generators). There are also more than 80 [community plugins](/community). - **Devkit** is a set of utilities for [building Nx plugins](/plugin-features/create-your-own-plugin). - **Nx Cloud** helps scale your project on CI by [adding remote caching](/concepts/how-caching-works) and [distributed task execution](/more-concepts/illustrated-dte). It also improves developer ergonomics by integrating with GitHub, GitLab and BitBucket and providing searchable structured logs. Learn more at [nx.app](https://nx.app). - **Nx Console** is an extension for **VSCode, IntelliJ and VIM**. It provides code autocompletion, interactive generators, workspace visualizations, powerful refactorings and more. You can [install it here](/core-features/integrate-with-editors). diff --git a/docs/shared/guides/js-and-ts.md b/docs/shared/guides/js-and-ts.md index a935b93d4b633..7e83856d611fc 100644 --- a/docs/shared/guides/js-and-ts.md +++ b/docs/shared/guides/js-and-ts.md @@ -5,8 +5,8 @@ Nx is a general-purpose build system and a general-purpose CLI. It works with Ja TypeScript is a great choice for many teams, but not for everyone. If you want to use Nx with JavaScript, simply pass `--js` to all generate commands, as follows: ```shell -nx g @nrwl/react:app myapp --js -nx g @nrwl/react:component mycmp --project=myapp --js +nx g @nx/react:app myapp --js +nx g @nx/react:component mycmp --project=myapp --js ``` You can build/test/lint/serve your applications and libraries the same way whether you use JavaScript and TypeScript. You can also mix and match them. @@ -15,4 +15,4 @@ Regardless whether you use JavaScript or TypeScript, you will have a `tsconfig.b ## Interested in building and distributing TypeScript packages? -You might want to check out the `@nrwl/js` package which comes with advanced TypeScript support, including [SWC](https://swc.rs/) and more. Find out more in the [plugin documentation](/packages/js). +You might want to check out the `@nx/js` package which comes with advanced TypeScript support, including [SWC](https://swc.rs/) and more. Find out more in the [plugin documentation](/packages/js). diff --git a/docs/shared/guides/misc-data-persistence.md b/docs/shared/guides/misc-data-persistence.md index 513933927926d..a995bfdfb50ed 100644 --- a/docs/shared/guides/misc-data-persistence.md +++ b/docs/shared/guides/misc-data-persistence.md @@ -10,7 +10,7 @@ For a better user experience, the `optimisticUpdate` operator updates the state ```typescript import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { optimisticUpdate } from '@nrwl/angular'; +import { optimisticUpdate } from '@nx/angular'; @Injectable() class TodoEffects { @@ -47,7 +47,7 @@ To achieve a more reliable data synchronization, the `pessimisticUpdate` operato ```typescript import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { pessimisticUpdate } from '@nrwl/angular'; +import { pessimisticUpdate } from '@nx/angular'; @Injectable() class TodoEffects { @@ -85,7 +85,7 @@ The `fetch` operator provides consistency when fetching data. If there are multi ```typescript import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { fetch } from '@nrwl/angular'; +import { fetch } from '@nx/angular'; @Injectable() class TodoEffects { @@ -119,7 +119,7 @@ This is correct, but we can improve the performance by supplying an id of the da ```typescript import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { fetch } from '@nrwl/angular'; +import { fetch } from '@nx/angular'; @Injectable() class TodoEffects { @@ -163,7 +163,7 @@ When our state depends on navigation, we can not assume the route change happene ```typescript import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { navigation } from '@nrwl/angular'; +import { navigation } from '@nx/angular'; @Injectable() class TodoEffects { diff --git a/docs/shared/guides/misc-ngrx.md b/docs/shared/guides/misc-ngrx.md index 9b49add8bc302..0cbf303d9fab8 100644 --- a/docs/shared/guides/misc-ngrx.md +++ b/docs/shared/guides/misc-ngrx.md @@ -7,7 +7,7 @@ build out application flows that track unique events and manage the state of sha Nx provides a schematic to build out a new NgRx feature area that manages shared state. -The **@nrwl/angular** package has an `ngrx` schematic to generate files that implement best practices when using NgRx for state management. This schematic generates source files that include enhancements to NgRx for data persistence strategies, and simplified testing. +The **@nx/angular** package has an `ngrx` schematic to generate files that implement best practices when using NgRx for state management. This schematic generates source files that include enhancements to NgRx for data persistence strategies, and simplified testing. The `ngrx` schematic generates an NgRx feature set containing the following files: @@ -26,7 +26,7 @@ The `ngrx` schematic only provides a sub-set of schematics for the NgRx librarie The following command is used to run the `ngrx` schematic: ```shell -nx g @nrwl/angular:ngrx --module= --no-interactive [options] +nx g @nx/angular:ngrx --module= --no-interactive [options] ``` {% callout type="note" title="Command" %} @@ -49,7 +49,7 @@ To get started with NgRx in an Angular application, you set up the root level st The example below shows you how to setup NgRx in the root of your application. ```shell -nx g @nrwl/angular:ngrx app --module=apps//src/app/app.module.ts --root +nx g @nx/angular:ngrx app --module=apps//src/app/app.module.ts --root ``` The above command applies the following changes to the provided module: @@ -69,7 +69,7 @@ state to be easily shared across other libraries and applications. The steps bel The example below generates a library to begin a new feature. For this example, `products` is used as the library name. ```shell -nx g @nrwl/angular:lib products +nx g @nx/angular:lib products ``` To manage the feature state: @@ -78,7 +78,7 @@ To manage the feature state: - Provide a path to the `products` library module. ```shell -nx g @nrwl/angular:ngrx products --module=libs/products/src/lib/products.module.ts --directory +state/products --no-interactive +nx g @nx/angular:ngrx products --module=libs/products/src/lib/products.module.ts --directory +state/products --no-interactive ``` {% callout type="note" title="Enabling Facades" %} diff --git a/docs/shared/guides/module-federation/dynamic-mfe-angular.md b/docs/shared/guides/module-federation/dynamic-mfe-angular.md index cb35f1d6cfde5..87e8f3986fb75 100644 --- a/docs/shared/guides/module-federation/dynamic-mfe-angular.md +++ b/docs/shared/guides/module-federation/dynamic-mfe-angular.md @@ -52,12 +52,12 @@ We'll start with the Admin Dashboard application which will act as a host applic ```shell # Npm -npx nx g @nrwl/angular:host dashboard +npx nx g @nx/angular:host dashboard ``` ```shell # Yarn -yarn nx g @nrwl/angular:host dashboard +yarn nx g @nx/angular:host dashboard ``` The application generator will create and modify the files needed to set up the Angular application. @@ -66,12 +66,12 @@ Now, let's generate the Login application as a remote application. ```shell # Npm -npx nx g @nrwl/angular:remote login --host=dashboard +npx nx g @nx/angular:remote login --host=dashboard ``` ```shell # Yarn -yarn nx g @nrwl/angular:remote login --host=dashboard +yarn nx g @nx/angular:remote login --host=dashboard ``` {% callout type="note" title="--host" %} @@ -94,8 +94,8 @@ For both applications, the generator did the following: - Added a `bootstrap.ts` file - Moved the code that is normally in `main.ts` to `bootstrap.ts` - Changed `main.ts` to dynamically import `bootstrap.ts` _(this is required for the Module Federation to correct load versions of shared libraries)_ -- Updated the `build` target in the `project.json` to use the `@nrwl/angular:webpack-browser` executor _(this is required as it supports passing a custom Webpack configuration to the Angular compiler)_ -- Updated the `serve` target to use `@nrwl/angular:webpack-dev-server` _(this is required as we first need Webpack to build the application with our custom Webpack configuration)_ +- Updated the `build` target in the `project.json` to use the `@nx/angular:webpack-browser` executor _(this is required as it supports passing a custom Webpack configuration to the Angular compiler)_ +- Updated the `serve` target to use `@nx/angular:webpack-dev-server` _(this is required as we first need Webpack to build the application with our custom Webpack configuration)_ The key differences reside within the configuration of the Module Federation Plugin within each application's `module-federation.config.js`. @@ -118,7 +118,7 @@ Taking a look at each property of the configuration in turn: This config is then used in the `webpack.config.js` file: ```js -const { withModuleFederation } = require('@nrwl/angular/module-federation'); +const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); ``` @@ -147,7 +147,7 @@ We'll start by building the Login application, which will consist of a login for Let's create a user data-access library that will be shared between the host application and the remote application. This will be used to determine if there is an authenticated user as well as providing logic for authenticating the user. ```shell -nx g @nrwl/angular:lib shared/data-access-user +nx g @nx/angular:lib shared/data-access-user ``` This will scaffold a new library for us to use. @@ -155,7 +155,7 @@ This will scaffold a new library for us to use. We need an Angular Service that we will use to hold state: ```shell -nx g @nrwl/angular:service user --project=shared-data-access-user +nx g @nx/angular:service user --project=shared-data-access-user ``` This will create a file `user.service.ts` under the `shared/data-access-user` library. Change its contents to match: @@ -385,7 +385,7 @@ We’ll start by creating this file. Add a `module-federation.manifest.json` fil Next, open `main.ts` under the `src/`folder and replace it with the following: ```typescript {% fileName="src/main.ts" %} -import { setRemoteDefinitions } from '@nrwl/angular/mf'; +import { setRemoteDefinitions } from '@nx/angular/mf'; fetch('/assets/module-federation.manifest.json') .then((res) => res.json()) @@ -439,7 +439,7 @@ Replace it with the following: You will also need to add the following import to the top of the file: ```typescript -import { loadRemoteModule } from '@nrwl/angular/mf'; +import { loadRemoteModule } from '@nx/angular/mf'; ``` The `loadRemoteModule` helper method simply hides some logic that will check if the Remote application has been loaded, and if not, load it, and then requests the correct exposed module from it. @@ -473,7 +473,7 @@ To showcase this, let’s create a new Host application that will use our previo Run the following command to generate a new Host application that is preconfigured for Dynamic Federation and add specify the Login Remote application we want to add: ```shell -nx g @nrwl/angular:host employee --remotes=login --dynamic +nx g @nx/angular:host employee --remotes=login --dynamic ``` This will generate: @@ -491,7 +491,7 @@ You should take a look at the files generated and see how the Login Remote appli We’re going to demonstrate how when specifying a dynamic Host when adding a new Remote application, the Remote application will be added to the Host’s Micro Frontend Manifest file correctly. ```shell -nx g @nrwl/angular:remote todo --host=employee +nx g @nx/angular:remote todo --host=employee ``` You’ll note that this will generate the same output as the Login Remote application in the previous guide. There’s one difference. diff --git a/docs/shared/guides/module-federation/faster-builds.md b/docs/shared/guides/module-federation/faster-builds.md index 5b3589916d9d8..2f75ee73e8220 100644 --- a/docs/shared/guides/module-federation/faster-builds.md +++ b/docs/shared/guides/module-federation/faster-builds.md @@ -79,33 +79,32 @@ You will be prompted to enable Nx Cloud in the workspace. For the best experienc take advantage of distributed caching and other features it provides. {% /callout %} -Then, for React users, install the `@nrwl/react` plugin; and for Angular users, install the `@nrwl/angular` plugin. +Then, for React users, install the `@nx/react` plugin; and for Angular users, install the `@nx/angular` plugin. ```shell # If you use React -npm install --save-dev @nrwl/react +npm install --save-dev @nx/react # If you use Angular -npm install --save-dev @nrwl/angular +npm install --save-dev @nx/angular # Or with yarn -yarn add --dev @nrwl/react -yarn add --dev @nrwl/angular +yarn add --dev @nx/react +yarn add --dev @nx/angular ``` Next, generate the host and remote applications. ```shell # React -nx g @nrwl/react:host host --remotes=shop,cart,about +nx g @nx/react:host host --remotes=shop,cart,about # Angular -nx g @nrwl/angular:host host --remotes=shop,cart,about +nx g @nx/angular:host host --remotes=shop,cart,about ``` {% callout type="note" title="More details" %} -You can leave off the `--remotes` option and add them later with `nx g @nrwl/react:remote shop --host=host` -or `nx g @nrwl/angular:remote shop --host=host`. +You can leave off the `--remotes` option and add them later with `nx g @nx/react:remote shop --host=host` or `nx g @nx/angular:remote shop --host=host`. {% /callout %} Now, serve `host` to view it in your browser. @@ -137,9 +136,7 @@ To understand how Module Federation works with Nx, let's take a look at three fi ### `apps/host/project.json` -The `build` target uses `@nrwl/webpack:webpack` for React, and `@nrwl/angular:webpack-browser` for Angular. This is the -same as a normal SPA that uses custom webpack configuration (`webpackConfig`), but difference is in the webpack -configuration file. +The `build` target uses `@nx/webpack:webpack` for React, and `@nx/angular:webpack-browser` for Angular. This is the same as a normal SPA that uses custom webpack configuration (`webpackConfig`), but difference is in the webpack configuration file. If you use Module Federation to speed up your CI and improve your local development, and not to deploy different remotes independently, you need to create implicit dependencies from the host to all the remotes. Semantically, the host and the @@ -162,8 +159,8 @@ In the future, Nx may automatically handle this for you. The webpack configuration uses an utility function that Nx provides: `withModuleFederation`. ```javascript -// For Angular, you'll see `@nrwl/angular/module-federation` -const withModuleFederation = require('@nrwl/react/module-federation'); +// For Angular, you'll see `@nx/angular/module-federation` +const withModuleFederation = require('@nx/react/module-federation'); const moduleFederationConfig = require('./module-federation.config'); module.exports = withModuleFederation({ @@ -356,7 +353,7 @@ Next, open up the production webpack configuration file and update the remote UR under `http://localhost:3000`. ```javascript {% fileName="apps/host/webpack.config.prod.js" %} -const withModuleFederation = require('@nrwl/react/module-federation'); +const withModuleFederation = require('@nx/react/module-federation'); const moduleFederationConfig = require('./module-federation.config'); module.exports = withModuleFederation({ @@ -391,7 +388,7 @@ dist/apps Now, we can add a simple deploy command to simulate deploying this folder to production. ```shell -nx g @nrwl/workspace:run-commands \ +nx g @nx/workspace:run-commands \ deploy \ --project=host \ --command="rm -rf production && mkdir production && cp -r dist/apps/host/* production && cp -r dist/apps/{shop,cart,about} production && http-server -p 3000 -a localhost production" diff --git a/docs/shared/guides/module-federation/micro-frontend-architecture.md b/docs/shared/guides/module-federation/micro-frontend-architecture.md index da787e26e78fd..b7c48c3749595 100644 --- a/docs/shared/guides/module-federation/micro-frontend-architecture.md +++ b/docs/shared/guides/module-federation/micro-frontend-architecture.md @@ -47,12 +47,12 @@ application, and `nx g remote` for remote applications. ```shell # React -nx g @nrwl/react:host shell --remotes=shop,cart -nx g @nrwl/react:remote about --host=shell +nx g @nx/react:host shell --remotes=shop,cart +nx g @nx/react:remote about --host=shell #a Angular -nx g @nrwl/angular:host shell --remotes=shop,cart -nx g @nrwl/angular:remote about --host=shell +nx g @nx/angular:host shell --remotes=shop,cart +nx g @nx/angular:remote about --host=shell ``` That is! You can now run `nx serve shell` to develop on the `shell` application, while keeping all remotes static. To diff --git a/docs/shared/guides/nx-and-angular-cli.md b/docs/shared/guides/nx-and-angular-cli.md index 2fe74ff86bbac..1c0116eac55ef 100644 --- a/docs/shared/guides/nx-and-angular-cli.md +++ b/docs/shared/guides/nx-and-angular-cli.md @@ -23,7 +23,7 @@ What we recommend instead is to split `angular.json` into multiple `project.json - Change the version number in `angular.json` to `2` - Run `nx format` -- Run `nx generate @nrwl/workspace:convert-to-nx-project --all=true` +- Run `nx generate @nx/workspace:convert-to-nx-project --all=true` {% callout type="check" title="Nx and AngularCLI are compatible" %} But regardless of whether you use `angular.json` or `project.json`, the configuration remains the same. So anything written about `project.json` applies to `angular.json` in the same way. For instance, everything in [project.json](/reference/project-configuration) and [nx.json](/reference/nx-json) applies to `angular.json` in the same way. diff --git a/docs/shared/guides/nx-devkit-angular-devkit.md b/docs/shared/guides/nx-devkit-angular-devkit.md index a184609ea3793..5edc005858595 100644 --- a/docs/shared/guides/nx-devkit-angular-devkit.md +++ b/docs/shared/guides/nx-devkit-angular-devkit.md @@ -1,7 +1,7 @@ # Nx Devkit and Angular Devkit {% callout type="note" title="Nx & Angular" %} -This document covers the difference between Nx Devkit and Angular Devkit. See the [Nx Devkit](/packages/devkit/documents/nrwl_devkit) guide for more in-depth details about Nx Devkit. +This document covers the difference between Nx Devkit and Angular Devkit. See the [Nx Devkit](/packages/devkit/documents/nx_devkit) guide for more in-depth details about Nx Devkit. {% /callout %} Nx comes with a devkit to write generators and executors, but you can also use Angular devkit (schematics and builders). In other words, you can use an Angular schematic to implement a generator, and you can use an Angular builder to implement an executor. @@ -13,7 +13,7 @@ Nx comes with a devkit to write generators and executors, but you can also use A The following is a generator written using Nx Devkit: ```typescript -import { Tree, formatFiles, generateFiles } from '@nrwl/devkit'; +import { Tree, formatFiles, generateFiles } from '@nx/devkit'; import * as path from 'path'; interface Schema { @@ -47,8 +47,8 @@ import { url, move, } from '@angular-devkit/schematics'; -import { formatFiles } from '@nrwl/workspace'; -import { toFileName } from '@nrwl/workspace'; +import { formatFiles } from '@nx/workspace'; +import { toFileName } from '@nx/workspace'; interface Schema { name: string; @@ -110,7 +110,7 @@ Then, you might need to register it in the `collections.json`: { "name": "Nx React", "version": "0.1", - "extends": ["@nrwl/workspace"], + "extends": ["@nx/workspace"], "schematics": { "mygenerator": { "factory": "./src/generators/mygenerator/mygenerator#mygeneratorSchematic", diff --git a/docs/shared/guides/react-18.md b/docs/shared/guides/react-18.md index 1ed97855f2611..db3c2aefe6c72 100644 --- a/docs/shared/guides/react-18.md +++ b/docs/shared/guides/react-18.md @@ -2,7 +2,7 @@ [React 18](https://reactjs.org/blog/2022/03/29/react-v18.html) released with many new features, such as Concurrent React, Suspense, batched updates, and more. -Workspaces that upgrade to `@nrwl/react` 14 will be automatically migrated to React 18. This migration will also include an upgrade to React Router v6, if it is used in the workspace, as well as the removal of the deprecated `@testing-library/react-hook` package. Keep reading for more details. +Workspaces that upgrade to `@nx/react` 14 will be automatically migrated to React 18. This migration will also include an upgrade to React Router v6, if it is used in the workspace, as well as the removal of the deprecated `@testing-library/react-hook` package. Keep reading for more details. {% callout type="note" title="Using NPM v7/v8?" %} If you use npm v7/v8, you will need to use `npm install --force` after running `nx migrate 14.0.0` since `@testing-library/react-hook` does not support React 18. Don't worry, this package will be removed in the migration. @@ -158,11 +158,11 @@ If you continue to have issues after the migration, please open an issue on the Nx will also update your workspace to React Native v0.68. There are breaking changes, please refer to the official [React Native 0.68 guide](https://reactnative.dev/blog/2022/03/30/version-068) for details. -Because typical React Native projects are essentially made up of a JavaScript project and native code projects (an Android project, an iOS project). For native code, you can either upgrade manually using [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/ or using the `@nrwl/react-native:upgrade-native` generator. +Because typical React Native projects are essentially made up of a JavaScript project and native code projects (an Android project, an iOS project). For native code, you can either upgrade manually using [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/ or using the `@nx/react-native:upgrade-native` generator. For manual update, go to [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) and copy the diff to your native code one by one. -Nevertheless, you can use Nx's command `nx g @nrwl/react-native:upgrade-native ` to replace your iOS and Android folder with the latest code. +Nevertheless, you can use Nx's command `nx g @nx/react-native:upgrade-native ` to replace your iOS and Android folder with the latest code. {% callout type="caution" title="Be careful" %} -Nx's command `nx g @nrwl/react-native:upgrade-native ` is destructive, do **NOT** use it if you got customized native code.) +Nx's command `nx g @nx/react-native:upgrade-native ` is destructive, do **NOT** use it if you got customized native code.) {% /callout %} diff --git a/docs/shared/guides/react-native.md b/docs/shared/guides/react-native.md index 2d59cac0ed1a4..45f1f1478c5a8 100644 --- a/docs/shared/guides/react-native.md +++ b/docs/shared/guides/react-native.md @@ -129,13 +129,13 @@ When using React Native in Nx, you get the out-of-the-box support for TypeScript ### Adding React Native to an Existing Workspace -For existing Nx workspaces, install the `@nrwl/react-native` package to add React Native capabilities to it. +For existing Nx workspaces, install the `@nx/react-native` package to add React Native capabilities to it. ```shell -npm install @nrwl/react-native --save-dev +npm install @nx/react-native --save-dev # Or with yarn -yarn add @nrwl/react-native --dev +yarn add @nx/react-native --dev ``` ## Generating an Application @@ -143,7 +143,7 @@ yarn add @nrwl/react-native --dev To create additional React Native apps run: ```shell -npx nx g @nrwl/react-native:app +npx nx g @nx/react-native:app ``` ## Generating a Library @@ -160,7 +160,7 @@ and [Library Types](/more-concepts/library-types). To generate a new library run: ```shell -npx nx g @nrwl/react-native:lib shared-ui-layout +npx nx g @nx/react-native:lib shared-ui-layout ``` And you will see the following: @@ -200,7 +200,7 @@ Run: To generate a new component inside `shared-ui-layout` run: ```shell -npx nx g @nrwl/react-native:component layout --project=shared-ui-layout --export +npx nx g @nx/react-native:component layout --project=shared-ui-layout --export ``` And you will see the following updated for `shared-ui-layout`: @@ -245,8 +245,8 @@ That's it! There is no need to build the library prior to using it. When you upd For libraries intended to be built and published to a registry (e.g. npm) you can use the `--publishable` and `--importPath` options. ```shell -npx nx g @nrwl/react-native:lib shared-ui-layout --publishable --importPath=@happynrwl/ui-components -npx nx g @nrwl/react-native:component layout --project=shared-ui-layout --export +npx nx g @nx/react-native:lib shared-ui-layout --publishable --importPath=@happynrwl/ui-components +npx nx g @nx/react-native:component layout --project=shared-ui-layout --export ``` Run `npx nx build shared-ui-layout` to build the library. It will generate the following: diff --git a/docs/shared/guides/setup-incremental-builds-angular.md b/docs/shared/guides/setup-incremental-builds-angular.md index 707827942371d..a6efc7b20dcf0 100644 --- a/docs/shared/guides/setup-incremental-builds-angular.md +++ b/docs/shared/guides/setup-incremental-builds-angular.md @@ -37,10 +37,10 @@ To enable incremental builds you need to use buildable libraries. You can generate a new buildable library with: ```shell -nx g @nrwl/angular:lib my-lib --buildable +nx g @nx/angular:lib my-lib --buildable ``` -The generated buildable library uses the `@nrwl/angular:ng-packagr-lite` executor which is optimized for the incremental +The generated buildable library uses the `@nx/angular:ng-packagr-lite` executor which is optimized for the incremental builds scenario: ```jsonc @@ -49,7 +49,7 @@ builds scenario: ... "targets": { "build": { - "executor": "@nrwl/angular:ng-packagr-lite", + "executor": "@nx/angular:ng-packagr-lite", "outputs": [ "{workspaceRoot}/dist/libs/my-lib" ], @@ -70,13 +70,13 @@ builds scenario: {% callout type="warning" title="More details" %} Please note that it is important to keep the `outputs` property in sync with the `dest` property in the file `ng-package.json` located inside the library root. When a library is generated, this is configured correctly, but if the path is later changed in `ng-package.json`, it needs to be updated as well in the project configuration. -The `@nrwl/angular:package` executor also supports incremental builds. It is used to build and package an Angular library to be distributed as an NPM package following the Angular Package Format (APF) specification. It will be automatically configured when generating a publishable library (`nx g @nrwl/angular:lib my-lib --publishable --importPath my-lib`). +The `@nx/angular:package` executor also supports incremental builds. It is used to build and package an Angular library to be distributed as an NPM package following the Angular Package Format (APF) specification. It will be automatically configured when generating a publishable library (`nx g @nx/angular:lib my-lib --publishable --importPath my-lib`). {% /callout %} ## Adjust the application executor -Change your Angular application’s "build" target executor to `@nrwl/angular:webpack-browser` and the "serve" target -executor to `@nrwl/web:file-server` as shown below: +Change your Angular application’s "build" target executor to `@nx/angular:webpack-browser` and the "serve" target +executor to `@nx/web:file-server` as shown below: ```jsonc { @@ -84,7 +84,7 @@ executor to `@nrwl/web:file-server` as shown below: ... "targets": { "build": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "outputs": [ "{options.outputPath}" ], @@ -98,7 +98,7 @@ executor to `@nrwl/web:file-server` as shown below: "defaultConfiguration": "production" }, "serve": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options": { "buildTarget": "my-app:build" }, @@ -138,7 +138,7 @@ your `project.json` file. The file-server executor will pass those to the `nx bu ... "targets": { "build": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "outputs": [ "{options.outputPath}" ], @@ -151,7 +151,7 @@ your `project.json` file. The file-server executor will pass those to the `nx bu } }, "serve": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options": { "buildTarget": "my-app:build", "parallel": true @@ -170,7 +170,7 @@ your `project.json` file. The file-server executor will pass those to the `nx bu ### Build target name It is required to use the same target name for the build target (target using one of the executors that support -incremental builds: `@nrwl/angular:webpack-browser`, `@nrwl/angular:package` and `@nrwl/angular:ng-packagr-lite`) in the +incremental builds: `@nx/angular:webpack-browser`, `@nx/angular:package` and `@nx/angular:ng-packagr-lite`) in the project being built and the buildable libraries it depends on. The executors that support incremental builds rely on the build target name of the project to identify which of the libraries it depends on are buildable. @@ -185,7 +185,7 @@ Say you have the same application above with a configuration as follows: ... "targets": { "build-base": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "outputs": [ "{options.outputPath}" ], @@ -214,7 +214,7 @@ Say you have the same application above with a configuration as follows: } }, "serve": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options": { "buildTarget": "my-app:build-base", "parallel": true @@ -254,7 +254,7 @@ depends on must also be `build-base`: ... "targets": { "build-base": { - "executor": "@nrwl/angular:ng-packagr-lite", + "executor": "@nx/angular:ng-packagr-lite", "outputs": [ "{workspaceRoot}/dist/libs/my-lib" ], diff --git a/docs/shared/guides/turbo-and-nx.md b/docs/shared/guides/turbo-and-nx.md index 46a5d13d04237..764f60eacf45e 100644 --- a/docs/shared/guides/turbo-and-nx.md +++ b/docs/shared/guides/turbo-and-nx.md @@ -170,7 +170,7 @@ It’s also worth noting that the backend of Nx Cloud is written in Kotlin. This Nx was released in 2016. Turborepo was open sourced in December of 2021. Turborepo doesn't have a large community yet, but it probably will at some point. -- There are about [3 million downloads per week](https://www.npmjs.com/package/@nrwl/tao). +- There are about [3 million downloads per week](https://www.npmjs.com/package/@nx/tao). - There are about 1 million+ unique [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) (a plugin for VSCode) installations. - There is a rich ecosystem of [third-party plugins.](https://nx.dev/community) - There are 5500+ active users in [the community slack.](https://nrwlcommunity.slack.com/join/shared_invite/zt-jba969hz-e5zm1Ou_jiOP1J2h8UTu0w#/shared-invite/email) diff --git a/docs/shared/guides/use-environment-variables-in-angular.md b/docs/shared/guides/use-environment-variables-in-angular.md index 8bb2bd46b8e20..f718584449e78 100644 --- a/docs/shared/guides/use-environment-variables-in-angular.md +++ b/docs/shared/guides/use-environment-variables-in-angular.md @@ -1,12 +1,12 @@ # Using environment variables in Angular applications -Angular builders (e.g. `@nrwl/angular:webpack-browser` and `@angular-devkit/build-angular:browser`) don't have built-in support for using environment variables when building applications. +Angular builders (e.g. `@nx/angular:webpack-browser` and `@angular-devkit/build-angular:browser`) don't have built-in support for using environment variables when building applications. To add support for environment variables we need to use the webpack `DefinePlugin` in our own custom webpack configuration. We'll see how to do so in the following sections. ## A note on `NODE_ENV` -The webpack-based Angular builders (e.g. `@nrwl/angular:webpack-browser` and `@angular-devkit/build-angular:browser`) set the webpack's `mode` configuration option based on the values for the following in the builder options: +The webpack-based Angular builders (e.g. `@nx/angular:webpack-browser` and `@angular-devkit/build-angular:browser`) set the webpack's `mode` configuration option based on the values for the following in the builder options: - `optimization` - `optimization.scripts` @@ -42,7 +42,7 @@ Next, update the `build` and `serve` targets (in `project.json` or `angular.json { "build": { // NOTE: change the executor to one that supports custom webpack config. - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", // snip "options": { // NOTE: This file needs to be created. @@ -54,7 +54,7 @@ Next, update the `build` and `serve` targets (in `project.json` or `angular.json }, "serve": { // NOTE: use dev-server that supports custom webpack config. - "executor": "@nrwl/angular:webpack-dev-server" + "executor": "@nx/angular:webpack-dev-server" // snip } } diff --git a/docs/shared/guides/use-environment-variables-in-react.md b/docs/shared/guides/use-environment-variables-in-react.md index 60201a0663a2e..2bf1490f3bb41 100644 --- a/docs/shared/guides/use-environment-variables-in-react.md +++ b/docs/shared/guides/use-environment-variables-in-react.md @@ -2,7 +2,7 @@ ## For React applications using Vite -In React applications using Vite (e.g. those using `@nrwl/vite:*` executors), Nx includes the following variables in the build process: +In React applications using Vite (e.g. those using `@nx/vite:*` executors), Nx includes the following variables in the build process: - `NODE_ENV` - Variables prefixed with `VITE_`, such as `VITE_CUSTOM_VAR` @@ -17,7 +17,7 @@ You cannot interpolate environment variables into your `index.html` file for Rea ## For non-Vite React applications -In React applications (e.g. those using `@nrwl/webpack:webpack` or `@nrwl/next:build` executors for `build` target), Nx +In React applications (e.g. those using `@nx/web:webpack` or `@nx/next:build` executors for `build` target), Nx includes the following variables in the build process: - `NODE_ENV` diff --git a/docs/shared/guides/using-tailwind-css-in-react.md b/docs/shared/guides/using-tailwind-css-in-react.md index 1bca59ead19f4..226d33af8c33b 100644 --- a/docs/shared/guides/using-tailwind-css-in-react.md +++ b/docs/shared/guides/using-tailwind-css-in-react.md @@ -6,10 +6,10 @@ For more in-depth look on this topic, be sure to check out our blog post on [Set ## Automated Setup -The easiest way to set up Tailwind is using the `@nrwl/react:setup-tailwind` generator. +The easiest way to set up Tailwind is using the `@nx/react:setup-tailwind` generator. ```shell -nx g @nrwl/react:setup-tailwind --project= +nx g @nx/react:setup-tailwind --project= ``` This generator will install the necessary dependencies and add `postcss.config.js` and `tailwind.config.js` files. @@ -78,7 +78,7 @@ Nx has a utility function that can be used to construct the glob representation The function receives a directory path that is used to identify the project for which the dependencies are going to be identified (therefore it needs to be a directory path within a project). It can also receive an optional glob pattern to append to each dependency source root path to conform the final glob pattern. If the glob pattern is not provided, it will default to `/**/!(*.stories|*.spec).{ts,html}`. ```javascript {% fileName="apps/app1/tailwind.config.js" %} -const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/react/tailwind'); const { join } = require('path'); module.exports = { @@ -126,7 +126,7 @@ Open up the `apps/{your app here}/project.json` file and add the following to th // ... "targets": { "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/web:webpack", "options": { // ... "postcssConfig": "apps/{your app here}/postcss.config.js" diff --git a/docs/shared/guides/using-tailwind-css-with-angular-projects.md b/docs/shared/guides/using-tailwind-css-with-angular-projects.md index 896746b91a10b..da803e248d802 100644 --- a/docs/shared/guides/using-tailwind-css-with-angular-projects.md +++ b/docs/shared/guides/using-tailwind-css-with-angular-projects.md @@ -13,13 +13,13 @@ post [Set up Tailwind CSS with Angular in an Nx workspace](https://medium.com/nr The Nx Angular plugin provides support for Tailwind CSS v2 and v3. The support includes the following features: -- A generator called `@nrwl/angular:setup-tailwind` that configures Tailwind CSS in an existing project. -- An option `--add-tailwind` for the `@nrwl/angular:app` generator to create an application with Tailwind CSS +- A generator called `@nx/angular:setup-tailwind` that configures Tailwind CSS in an existing project. +- An option `--add-tailwind` for the `@nx/angular:app` generator to create an application with Tailwind CSS pre-configured. -- An option `--add-tailwind` for the `@nrwl/angular:lib` generator to create a library with Tailwind CSS pre-configured. +- An option `--add-tailwind` for the `@nx/angular:lib` generator to create a library with Tailwind CSS pre-configured. This option can only be used with buildable and publishable libraries. -- Ability to build buildable libraries with Tailwind CSS using the `@nrwl/angular:ng-packagr-lite` executor. -- Ability to build publishable libraries with Tailwind CSS using the `@nrwl/angular:package` executor. +- Ability to build buildable libraries with Tailwind CSS using the `@nx/angular:ng-packagr-lite` executor. +- Ability to build publishable libraries with Tailwind CSS using the `@nx/angular:package` executor. The generation for existing or new projects will perform the following steps: @@ -65,7 +65,7 @@ will default to `/**/!(*.stories|*.spec).{ts,html}`. The following is an example of it being used in an application called `app1`: ```javascript {% fileName="apps/app1/tailwind.config.js" %} -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { @@ -115,7 +115,7 @@ This can be fixed in two manners: To generate an Angular application with Tailwind CSS configured by default, you can use the following command: ```shell -npx nx g @nrwl/angular:app my-app --add-tailwind +npx nx g @nx/angular:app my-app --add-tailwind ``` ### Generate an Angular buildable library with Tailwind CSS pre-configured @@ -123,7 +123,7 @@ npx nx g @nrwl/angular:app my-app --add-tailwind To generate an Angular buildable library with Tailwind CSS configured by default, you can use the following command: ```shell -npx nx g @nrwl/angular:lib my-lib --buildable --add-tailwind +npx nx g @nx/angular:lib my-lib --buildable --add-tailwind ``` ### Generate an Angular publishable library with Tailwind CSS pre-configured @@ -131,7 +131,7 @@ npx nx g @nrwl/angular:lib my-lib --buildable --add-tailwind To generate an Angular publishable library with Tailwind CSS configured by default, you can use the following command: ```shell -npx nx g @nrwl/angular:lib my-lib --publishable --importPath=@my-org/my-lib --add-tailwind +npx nx g @nx/angular:lib my-lib --publishable --importPath=@my-org/my-lib --add-tailwind ``` ### Add Tailwind CSS to an existing Angular application, buildable library or publishable library @@ -140,7 +140,7 @@ To add Tailwind CSS to an existing Angular application, buildable library or pub following command: ```shell -npx nx g @nrwl/angular:setup-tailwind my-project +npx nx g @nx/angular:setup-tailwind my-project ``` You can see the available options for the above generator in [its docs](/packages/angular/generators/setup-tailwind). @@ -249,7 +249,7 @@ Adjust the application's `tailwind.config.js` file to use the preset and remove included in the preset: ```javascript {% fileName="apps/app1/tailwind.config.js" %} -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); const sharedTailwindConfig = require('../../libs/tailwind-preset/tailwind.config'); @@ -265,7 +265,7 @@ module.exports = { Do the same with any buildable or publishable library `tailwind.config.js` file: ```javascript {% fileName="libs/lib1/tailwind.config.js" %} -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); const sharedTailwindConfig = require('../../libs/tailwind-preset/tailwind.config'); @@ -392,7 +392,7 @@ already included in the preset: ```javascript {% fileName="tailwind.config.js" %} // apps/app1/tailwind.config.js // apps/app2/tailwind.config.js -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); const sharedTailwindConfig = require('../../libs/tailwind-preset/tailwind.config'); @@ -409,7 +409,7 @@ Do the same with any shared buildable or publishable library `tailwind.config.js ```javascript {% fileName="tailwind.config.js" %} // libs/lib1/tailwind.config.js -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); const sharedTailwindConfig = require('../../libs/tailwind-preset/tailwind.config'); @@ -517,7 +517,7 @@ to have the following targets: ```jsonc {% fileName="project.json" %} ... "build-angular": { - "executor": "@nrwl/angular:package", + "executor": "@nx/angular:package", "outputs": ["{workspaceRoot}/dist/libs/lib1"], "options": { "project": "libs/lib1/ng-package.json", diff --git a/docs/shared/incremental-builds.md b/docs/shared/incremental-builds.md index 7fa3264eb36bb..0cb593badde99 100644 --- a/docs/shared/incremental-builds.md +++ b/docs/shared/incremental-builds.md @@ -4,8 +4,8 @@ As your applications are getting bigger, one of the main ways to scale your deve Right now, for instance, say we generate an application and a library as follows: ```shell -nx g @nrwl/react:app myapp -nx g @nrwl/react:lib mylib +nx g @nx/react:app myapp +nx g @nx/react:lib mylib ``` ...and then import the library from the application. In this case, `mylib` isn't a buildable library. We cannot test and lint it independently, but the only way to build it is by building some application using it (in this case `myapp`). The default setup is to use Webpack, which builds "mylib" and bundles it directly into "myapp". @@ -18,13 +18,13 @@ This provides the best dev experience for small and medium-size applications, be Nx has **publishable libraries**. As the name suggests, such libraries are meant to be built and published to some package registry s.t. they can be consumed also from outside the Nx workspace. The executor for building a publishable library does more than just building. It makes sure the output is properly compressed and might even produce more bundles s.t. the package can be consumed in a variety of ways (e.g. also produces UMD bundles). ```shell -nx g @nrwl/react:lib mylib --publishable --importPath=@myorg/mylib +nx g @nx/react:lib mylib --publishable --importPath=@myorg/mylib ``` On the other hand, the executor of a **buildable library**, performs a subset of the operations compared to the publishable library's executor. That's because buildable libraries are not intended to be published and thus only produce the minimum necessary output for the incremental build scenario to work. For example, no UMD bundles or minification is being done. The main goal of the executor is to perform the build as fast as possible. ```shell -nx g @nrwl/react:lib mylib --buildable +nx g @nx/react:lib mylib --buildable ``` Read more about [Publishable and Buildable Nx Libraries here.](/more-concepts/buildable-and-publishable-libraries) @@ -35,9 +35,9 @@ In an incremental build scenario, when building the app, all it's dependencies n It is costly to rebuild all the buildable libraries from scratch every time you want to serve the app. That's why the Nx computation caching is so important. The caching allows us to only rebuild a small subset of the libraries, which results in much better performance. -If we can share the cache with our teammates, we can get a much better dev experience. For instance, [this repo](https://github.com/nrwl/nx-incremental-large-repo) has a large application, where `nx serve` takes just a few seconds. +If we can share the cache with our teammates, we can get a much better dev experience. For instance, [this repo](https://github.com/nx/nx-incremental-large-repo) has a large application, where `nx serve` takes just a few seconds. -{% github-repository url="https://github.com/nrwl/nx-incremental-large-repo" /%} +{% github-repository url="https://github.com/nx/nx-incremental-large-repo" /%} ![comparison: webpack vs incremental build](/shared/incremental-build-webpack-vs-incremental.png) @@ -68,7 +68,7 @@ If you are only planning to use incremental builds to speed up your CI, then the ## Custom Serve Target -If you are implementing a custom serve command, you can use `WebpackNxBuildCoordinationPlugin` provided by `@nrwl/webpack`. It's a webpack plugin you can use to coordinate the compiling of the libs and the webpack linking. +If you are implementing a custom serve command, you can use `WebpackNxBuildCoordinationPlugin` provided by `@nx/webpack`. It's a webpack plugin you can use to coordinate the compiling of the libs and the webpack linking. ## Using Webpack Module Federation to implement incremental builds diff --git a/docs/shared/installation/troubleshoot-installation.md b/docs/shared/installation/troubleshoot-installation.md index ed01c32b20a25..47acd6adc4104 100644 --- a/docs/shared/installation/troubleshoot-installation.md +++ b/docs/shared/installation/troubleshoot-installation.md @@ -9,7 +9,7 @@ With more recent versions of Nx, we publish native binaries that should be autom Some npm users are experiencing errors like the following: ```shell -NX Cannot find module '@nrwl/nx-linux-x64-gnu' +NX Cannot find module '@nx/nx-linux-x64-gnu' ``` There are two reasons why this could potentially happen: diff --git a/docs/shared/mental-model.md b/docs/shared/mental-model.md index 79dee8488f547..b3939b05382ee 100644 --- a/docs/shared/mental-model.md +++ b/docs/shared/mental-model.md @@ -73,7 +73,7 @@ Let’s look at the test target relying on its dependencies. ```json { "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/apps/app1"], "dependsOn": ["^test"], "options": { diff --git a/docs/shared/migration/angular-integrated.md b/docs/shared/migration/angular-integrated.md index 459c6afc601c0..0f9ee80a8e964 100644 --- a/docs/shared/migration/angular-integrated.md +++ b/docs/shared/migration/angular-integrated.md @@ -3,12 +3,12 @@ To take advantage of Nx's monorepo features provided by Nx and the Nx Angular plugin, you can also perform a migration from an Angular CLI to an Integrated Nx Monorepo with the command: ```shell -ng add @nrwl/angular@ +ng add @nx/angular@ ``` -This installs the `@nrwl/angular` (or `@nrwl/workspace`) package into your workspace and runs a generator (or schematic) to transform your workspace. The generator applies the following changes to your workspace: +This installs the `@nx/angular` (or `@nx/workspace`) package into your workspace and runs a generator (or schematic) to transform your workspace. The generator applies the following changes to your workspace: -- Installs the `nx` and `@nrwl/workspace` packages. +- Installs the `nx` and `@nx/workspace` packages. - Moves your applications into the `apps` folder, and updates the relevant file paths in your configuration files. - Moves your e2e suites into the `apps/-e2e` folder, and updates the relevant file paths in your configuration files. - Moves your libraries into the `libs` folder, and updates the relevant file paths in your configuration files. @@ -67,7 +67,7 @@ Your workspace is now powered by Nx! You can verify that your application still To migrate to legacy versions of Nx prior to Nx 13.10, run the command: ```shell -ng add @nrwl/workspace@ +ng add @nx/workspace@ ``` Refer to the [Nx and Angular Version Compatibility Matrix](/packages/angular/documents/angular-nx-version-matrix) for matching Angular and Nx versions. diff --git a/docs/shared/migration/manual.md b/docs/shared/migration/manual.md index 5c0d9f97ca458..cfd2990ec65c5 100644 --- a/docs/shared/migration/manual.md +++ b/docs/shared/migration/manual.md @@ -35,18 +35,18 @@ The `apps` directory is the place where your top-level applications will be stor {% tab label="Angular" %} ```shell -npm install --save-dev @nrwl/angular +npm install --save-dev @nx/angular # then -nx generate @nrwl/angular:application my-application +nx generate @nx/angular:application my-application ``` {% /tab %} {% tab label="React" %} ```shell -npm install --save-dev @nrwl/react +npm install --save-dev @nx/react # then -nx generate @nrwl/react:application my-application +nx generate @nx/react:application my-application ``` {% /tab %} @@ -175,14 +175,14 @@ If your code is divided into libraries, you should also generate libraries for y {% tab label="Angular" %} ```shell -nx generate @nrwl/angular:library +nx generate @nx/angular:library ``` {% /tab %} {% tab label="React" %} ```shell -nx generate @nrwl/react:library +nx generate @nx/react:library ``` {% /tab %} diff --git a/docs/shared/migration/migration-angular.md b/docs/shared/migration/migration-angular.md index 2443ff64a7fd6..a59e8e8c48e48 100644 --- a/docs/shared/migration/migration-angular.md +++ b/docs/shared/migration/migration-angular.md @@ -14,7 +14,7 @@ This command will install the correct version of Nx based on your Angular versio This will enable you to use the Nx CLI in your existing Angular CLI workspace while keeping your existing file structure in place. The following changes will be made in your repo to enable Nx: -- The `nx`, `@nrwl/workspace` and `prettier` packages will be installed. +- The `nx`, `@nx/workspace` and `prettier` packages will be installed. - An `nx.json` file will be created in the root of your workspace. - For an Angular 14+ repo, the `angular.json` file is split into separate `project.json` files for each project. @@ -49,9 +49,9 @@ When you click this button, we’ll run the `nx init` command to set up the Nx C The script will make the following changes: -- Installs the `@nrwl/workspace` and `nx` packages. +- Installs the `@nx/workspace` and `nx` packages. - If you opted into Nx Cloud, `nx-cloud` will be installed as well. - - If your project's Angular version is greater than or equal to version 13, then the `@nrwl/angular` package will be installed as well. + - If your project's Angular version is greater than or equal to version 13, then the `@nx/angular` package will be installed as well. - Creates an `nx.json` file in the root of your workspace. By running this command and accepting Nx Cloud, Nx distributed caching is now enabled. diff --git a/docs/shared/migration/migration-angularjs.md b/docs/shared/migration/migration-angularjs.md index 6e9748a31f03a..d44bc0f24d7d5 100644 --- a/docs/shared/migration/migration-angularjs.md +++ b/docs/shared/migration/migration-angularjs.md @@ -42,7 +42,7 @@ At the next prompt, you can choose whether to use [Nx Cloud](https://nx.app) or Your new workspace won’t have much in it because of the `apps` preset. You’ll need to generate an application to have some structure created. Add the Angular plugin to your workspace: ```shell -npm install -D @nrwl/angular +npm install -D @nx/angular ``` For this example, we will use Karma and Protractor, the most common unit test runner and e2e test runner for AngularJS. @@ -54,7 +54,7 @@ Codebases with existing unit and e2e tests should continue to use whatever runne With the Angular capability added, generate your application: ```shell -nx generate @nrwl/angular:application --name=realworld --unitTestRunner=karma --e2eTestRunner=protractor +nx generate @nx/angular:application --name=realworld --unitTestRunner=karma --e2eTestRunner=protractor ``` Accept the default options for each prompt: @@ -362,10 +362,10 @@ So far, you’ve mostly gotten already existing code and processes to work. This But migrating AngularJS code means we need to switch some of our tools to a more modern tool stack. Specifically, using webpack and babel is going to allow us to take advantage of Nx more easily. Becoming an expert in these build tools is outside the scope of this article, but I’ll address some AngularJS specific concerns. To get started, install these new dependencies: ```shell -npm install -D @nrwl/web babel-plugin-angularjs-annotate +npm install -D @nx/web babel-plugin-angularjs-annotate ``` -Nx already has most of what you need for webpack added as a dependency. `@nrwl/web` contains the [executors](/plugin-features/use-task-executors) we need to use to build and serve the application with webpack and +Nx already has most of what you need for webpack added as a dependency. `@nx/web` contains the [executors](/plugin-features/use-task-executors) we need to use to build and serve the application with webpack and `babel-plugin-angularjs-annotate` is going to accomplish the same thing that `browserify-ngannotate` previously did in gulp: add dependency injection annotations. Start with a `webpack.config.js` file in your application’s root directory: @@ -407,7 +407,7 @@ To use webpack instead of gulp, go back to your `apps/realworld/project.json` fi ```jsonc {% fileName="apps/realworld/project.json" %} ... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/web:webpack", "options": { "outputPath": "dist/apps/realworld", "index": "apps/realworld/src/index.html", @@ -449,7 +449,7 @@ To use webpack instead of gulp, go back to your `apps/realworld/project.json` fi } }, "serve": { - "executor": "@nrwl/web:dev-server", + "executor": "@nx/web:dev-server", "options": { "buildTarget": "realworld:build" } diff --git a/docs/shared/node-server-tutorial/1-code-generation.md b/docs/shared/node-server-tutorial/1-code-generation.md index 75e709141fd2d..9e694b1ce4d1f 100644 --- a/docs/shared/node-server-tutorial/1-code-generation.md +++ b/docs/shared/node-server-tutorial/1-code-generation.md @@ -53,12 +53,12 @@ This tutorial uses the `express` framework. The `node-standalone` preset also pr ## Generating Libraries -To create the `auth` library, use the `@nrwl/node:lib` generator: +To create the `auth` library, use the `@nx/node:lib` generator: ![Nx Generator Syntax](/shared/node-server-tutorial/generator-syntax.svg) -```{% command="npx nx g @nrwl/node:lib auth --buildable" path="~/products-api" %} -> NX Generating @nrwl/node:library +```{% command="npx nx g @nx/node:lib auth --buildable" path="~/products-api" %} +> NX Generating @nx/node:library CREATE auth/README.md CREATE auth/.babelrc diff --git a/docs/shared/node-server-tutorial/3-task-running.md b/docs/shared/node-server-tutorial/3-task-running.md index a2ca65b9c3e4c..6d7bad8825c7d 100644 --- a/docs/shared/node-server-tutorial/3-task-running.md +++ b/docs/shared/node-server-tutorial/3-task-running.md @@ -26,7 +26,7 @@ Here's the `project.json` file for the `auth` project: "projectType": "library", "targets": { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/./auth", @@ -37,14 +37,14 @@ Here's the `project.json` file for the `auth` project: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["auth/**/*.ts"] } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "auth/jest.config.ts", diff --git a/docs/shared/node-server-tutorial/4-task-pipelines.md b/docs/shared/node-server-tutorial/4-task-pipelines.md index 26bb3a5db23f2..23e52355d6d81 100644 --- a/docs/shared/node-server-tutorial/4-task-pipelines.md +++ b/docs/shared/node-server-tutorial/4-task-pipelines.md @@ -139,21 +139,21 @@ Here are the outputs defined for the `auth` project: "name": "auth", "targets": { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/auth" } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "outputFile": "dist/auth/lint-report.txt" } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": {} } diff --git a/docs/shared/node-server-tutorial/5-docker-target.md b/docs/shared/node-server-tutorial/5-docker-target.md index 56905e6364ed7..d287e80716d8e 100644 --- a/docs/shared/node-server-tutorial/5-docker-target.md +++ b/docs/shared/node-server-tutorial/5-docker-target.md @@ -102,8 +102,8 @@ The `docker-build` command is defined as a target in the root `project.json` fil You can also add a `Dockerfile` to a new node app using the `--docker` flag. Here we're creating an `orders-api` application: -```{% command="npx nx g @nrwl/node:app orders-api --docker" path="~/products-api" %} -> NX Generating @nrwl/node:application +```{% command="npx nx g @nx/node:app orders-api --docker" path="~/products-api" %} +> NX Generating @nx/node:application ✔ Which framework do you want to use? · express CREATE orders-api/src/assets/.gitkeep diff --git a/docs/shared/npm-tutorial/integrated.md b/docs/shared/npm-tutorial/integrated.md index 5178b2dfb6e54..b08b1a48f78bd 100644 --- a/docs/shared/npm-tutorial/integrated.md +++ b/docs/shared/npm-tutorial/integrated.md @@ -32,12 +32,12 @@ myorg/ Nx comes with generators that can help with scaffolding applications. Run this generator to make a new library named `is-even`: ```shell -npx nx generate @nrwl/js:library is-even --publishable --importPath @myorg/is-even +npx nx generate @nx/js:library is-even --publishable --importPath @myorg/is-even ``` This command: -- Uses the `@nrwl/js` plugin's `library` generator to scaffold a new library named `is-even`. +- Uses the `@nx/js` plugin's `library` generator to scaffold a new library named `is-even`. - The `--publishable` flag makes sure we also get a `package.json` generated and a `publish` target we can invoke to publish to NPM. - The `--importPath` allows us to define the name of the NPM package. @@ -103,7 +103,7 @@ The local linking of packages in an integrated monorepo style is handled by Nx a To illustrate that, let's create another package `is-odd`. We can again run the generator for that: ```shell -npx nx generate @nrwl/js:library is-odd --publishable --importPath @myorg/is-odd +npx nx generate @nx/js:library is-odd --publishable --importPath @myorg/is-odd ``` Note how the `tsconfig.base.json` now has two entries: diff --git a/docs/shared/packages/angular/angular-plugin.md b/docs/shared/packages/angular/angular-plugin.md index 278ff1d3354e9..88e1aa4d0e4ab 100644 --- a/docs/shared/packages/angular/angular-plugin.md +++ b/docs/shared/packages/angular/angular-plugin.md @@ -20,11 +20,11 @@ more [here](/recipes/adopting-nx/migration-angular). Adding the Angular plugin to an existing Nx workspace can be done with the following: ```shell -yarn add -D @nrwl/angular +yarn add -D @nx/angular ``` ```shell -npm install -D @nrwl/angular +npm install -D @nx/angular ``` ## Using the Angular Plugin @@ -34,7 +34,7 @@ npm install -D @nrwl/angular It's straightforward to generate an Angular application: ```shell -nx g @nrwl/angular:app appName +nx g @nx/angular:app appName ``` By default, the application will be generated with: @@ -58,7 +58,7 @@ nx e2e appName Generating an Angular library is very similar to generating an application: ```shell -nx g @nrwl/angular:lib libName +nx g @nx/angular:lib libName ``` By default, the library will be generated with: @@ -81,12 +81,12 @@ Read more about: ### Fallback to `@schematics/angular` -If you try to invoke a generator that is not present in `@nrwl/angular`, the request will automatically be forwarded on -to `@schematics/angular`. So, even though there is no `@nrwl/angular:service` generator, the following command will +If you try to invoke a generator that is not present in `@nx/angular`, the request will automatically be forwarded on +to `@schematics/angular`. So, even though there is no `@nx/angular:service` generator, the following command will successfully create a service: ```shell -nx g @nrwl/angular:service my-service +nx g @nx/angular:service my-service ``` ## More Documentation diff --git a/docs/shared/packages/cypress/cypress-component-testing.md b/docs/shared/packages/cypress/cypress-component-testing.md index 89702e0a1c92c..8c3a3b4a75d69 100644 --- a/docs/shared/packages/cypress/cypress-component-testing.md +++ b/docs/shared/packages/cypress/cypress-component-testing.md @@ -8,14 +8,14 @@ directly to a project, like [Jest](/packages/jest) ## Add Component Testing to a Project -> Currently only [@nrwl/react](/packages/react/generators/cypress-component-configuration) and [@nrwl/angular](/packages/angular/generators/cypress-component-configuration) plugins support component testing +> Currently only [@nx/react](/packages/react/generators/cypress-component-configuration) and [@nx/angular](/packages/angular/generators/cypress-component-configuration) plugins support component testing Use the `cypress-component-configuration` generator from the respective plugin to add component testing to a project. ```shell -nx g @nrwl/react:cypress-component-configuration --project=your-project +nx g @nx/react:cypress-component-configuration --project=your-project -nx g @nrwl/angular:cypress-component-configuration --project=your-project +nx g @nx/angular:cypress-component-configuration --project=your-project ``` You can optionally pass in `--generate-tests` to create component tests for all components within the library. @@ -23,15 +23,15 @@ You can optionally pass in `--generate-tests` to create component tests for all Component testing supports both applications and libraries. By default, the generator attempts to find the build target for you based on the project's dependent apps. But you can manually specify the build target to use via the `--build-target` option. Note, in most cases, the build target will be from a different project than the one being configured. The only case where the build targets are from the same project is when the component tests are being added to an application. ```shell -nx g @nrwl/react:cypress-component-configuration --project=your-project --build-target=my-react-app:build +nx g @nx/react:cypress-component-configuration --project=your-project --build-target=my-react-app:build -nx g @nrwl/angular:cypress-component-configuration --project=your-project --build-target=my-ng-app:build +nx g @nx/angular:cypress-component-configuration --project=your-project --build-target=my-ng-app:build ``` The build target option can be changed later via updating the `devServerTarget` option in the `component-test` target. {% callout type="warning" title="Executor Options" %} -When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nrwl/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator. +When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nx/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator. {% /callout %} ## Testing Projects diff --git a/docs/shared/packages/cypress/cypress-plugin.md b/docs/shared/packages/cypress/cypress-plugin.md index 85566f8ea40de..472c050b47c62 100644 --- a/docs/shared/packages/cypress/cypress-plugin.md +++ b/docs/shared/packages/cypress/cypress-plugin.md @@ -13,14 +13,14 @@ Cypress is a test runner built for the modern web. It has a lot of great feature > > Info about [using Cypress and Storybook can be found here](/packages/storybook/documents/overview-react#cypress-tests-for-storiesbook) -If the `@nrwl/cypress` package is not installed, install the version that matches your `nx` package version. +If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version. ```shell -yarn add --dev @nrwl/cypress +yarn add --dev @nx/cypress ``` ```shell -npm install --save-dev @nrwl/cypress +npm install --save-dev @nx/cypress ``` ## E2E Testing @@ -28,7 +28,7 @@ npm install --save-dev @nrwl/cypress By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project. ```shell -nx g @nrwl/web:app frontend +nx g @nx/web:app frontend ``` ### Creating a Cypress E2E project for an existing project @@ -36,13 +36,13 @@ nx g @nrwl/web:app frontend To generate an E2E project based on an existing project, run the following generator ```shell -nx g @nrwl/cypress:cypress-project your-app-name-e2e --project=your-app-name +nx g @nx/cypress:cypress-project your-app-name-e2e --project=your-app-name ``` Optionally, you can use the `--baseUrl` option if you don't want cypress plugin to serve `your-app-name`. ```shell -nx g @nrwl/cypress:cypress-project your-app-name-e2e --baseUrl=http://localhost:4200 +nx g @nx/cypress:cypress-project your-app-name-e2e --baseUrl=http://localhost:4200 ``` Replace `your-app-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`. @@ -114,7 +114,7 @@ There are a handful of ways to pass environment variables to Cypress, but the mo Create a `cypress.env.json` file in the projects root i.e. `apps/my-cool-app-e2e/cypress.env.json`. Cypress will automatically pick up this file. This method is helpful for configurations that you want to not commit. Just don't forget to add the file to the `.gitignore` and add documentation so people in your repo know what values to popluate in their local copy of the `cypress.env.json` file. -Using [@nrwl/cypress:cypress](/packages/cypress/executors/cypress) env executor option is a good way to add values you want to define that you don't mine commit to the repository, such as a base API url. You can leverage [target configurations](/reference/project-configuration#targets) to define different values as well. +Using [@nx/cypress:cypress](/packages/cypress/executors/cypress) env executor option is a good way to add values you want to define that you don't mine commit to the repository, such as a base API url. You can leverage [target configurations](/reference/project-configuration#targets) to define different values as well. Optionally, you can pass environment variables via the commandline with the `--env` flag. diff --git a/docs/shared/packages/cypress/cypress-v11-migration.md b/docs/shared/packages/cypress/cypress-v11-migration.md index 74eb9b4802402..a9f5a7f042ffc 100644 --- a/docs/shared/packages/cypress/cypress-v11-migration.md +++ b/docs/shared/packages/cypress/cypress-v11-migration.md @@ -15,7 +15,7 @@ As of nx v15.1.0, if your project was already using Cypress v10, then your proje {% /callout %} ```shell -nx g @nrwl/cypress:migrate-to-cypress-11 +nx g @nx/cypress:migrate-to-cypress-11 ``` In general, these are the steps taken to migrate your project: diff --git a/docs/shared/packages/detox/detox-plugin.md b/docs/shared/packages/detox/detox-plugin.md index 7559a5f798928..816370dee1ac1 100644 --- a/docs/shared/packages/detox/detox-plugin.md +++ b/docs/shared/packages/detox/detox-plugin.md @@ -28,21 +28,21 @@ npm install -g jest By default, when creating a mobile application, Nx will use Detox to create the e2e tests project. ```shell -nx g @nrwl/react-native:app frontend +nx g @nx/react-native:app frontend ``` ### Creating a Detox E2E project for an existing project You can create a new Detox E2E project for an existing mobile project. -If the `@nrwl/detox` package is not installed, install the version that matches your `@nrwl/workspace` version. +If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version. {% tabs %} {%tab label="npm"%} ```sh # npm -npm install --save-dev @nrwl/detox +npm install --save-dev @nx/detox ``` {% /tab %} @@ -50,7 +50,7 @@ npm install --save-dev @nrwl/detox ```sh # yarn -yarn add --dev @nrwl/detox +yarn add --dev @nx/detox ``` {% /tab %} @@ -59,7 +59,7 @@ yarn add --dev @nrwl/detox Next, generate an E2E project based on an existing project. ```sh -nx g @nrwl/detox:app your-app-name-e2e --project=your-app-name +nx g @nx/detox:app your-app-name-e2e --project=your-app-name ``` Replace `your-app-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json`. diff --git a/docs/shared/packages/esbuild/esbuild-plugin.md b/docs/shared/packages/esbuild/esbuild-plugin.md index 3323df1e44519..5dba8a19770a4 100644 --- a/docs/shared/packages/esbuild/esbuild-plugin.md +++ b/docs/shared/packages/esbuild/esbuild-plugin.md @@ -17,14 +17,14 @@ To add the esbuild plugin to an existing workspace, run the following: {% tab label="npm" %} ```shell -npm install -D @nrwl/esbuild +npm install -D @nx/esbuild ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/esbuild +yarn add -D @nx/esbuild ``` {% /tab %} @@ -35,10 +35,10 @@ yarn add -D @nrwl/esbuild You can add a new library that builds using esbuild with: ```shell -nx g @nrwl/js:lib mylib --bundler=esbuild +nx g @nx/js:lib mylib --bundler=esbuild ``` -This command will install the esbuild plugin if needed, and set `@nrwl/esbuild:esbuild` executor for the `build` target. +This command will install the esbuild plugin if needed, and set `@nx/esbuild:esbuild` executor for the `build` target. ### Adding esbuild target to existing libraries @@ -70,7 +70,7 @@ Assets are non-JS and non-TS files, such as images, CSS, etc. You can add them t ```jsonc "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { //... "assets": [ @@ -120,7 +120,7 @@ Extra API options for esbuild can be passed in the `esbuildOptions` object for y ```jsonc "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { //... "esbuildOptions": { diff --git a/docs/shared/packages/expo/expo-plugin.md b/docs/shared/packages/expo/expo-plugin.md index e8f3da33a4e8a..2bd3082683376 100644 --- a/docs/shared/packages/expo/expo-plugin.md +++ b/docs/shared/packages/expo/expo-plugin.md @@ -18,14 +18,14 @@ Install the expo plugin {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/expo +npm i --save-dev @nx/expo ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/expo +yarn add --dev @nx/expo ``` {% /tab %} @@ -36,7 +36,7 @@ yarn add --dev @nrwl/expo Add a new application to your workspace with the following command: ```shell -nx g @nrwl/expo:app my-app +nx g @nx/expo:app my-app ``` Start the application by running: @@ -50,7 +50,7 @@ nx start my-app To generate a new library run: ```shell -npx nx g @nrwl/react-native:lib your-lib-name +npx nx g @nx/react-native:lib your-lib-name ``` ### Generating Components @@ -58,7 +58,7 @@ npx nx g @nrwl/react-native:lib your-lib-name To generate a new component inside library run: ```shell -npx nx g @nrwl/react-native:component your-component-name --project=your-lib-name --export +npx nx g @nx/react-native:component your-component-name --project=your-lib-name --export ``` Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json` diff --git a/docs/shared/packages/express/express-plugin.md b/docs/shared/packages/express/express-plugin.md index e26cc61b983ad..3b46eaaa38f7c 100644 --- a/docs/shared/packages/express/express-plugin.md +++ b/docs/shared/packages/express/express-plugin.md @@ -17,14 +17,14 @@ Install the express plugin {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/express +npm i --save-dev @nx/express ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/express +yarn add --dev @nx/express ``` {% /tab %} @@ -35,7 +35,7 @@ yarn add --dev @nrwl/express Add a new application to your workspace with the following command: ```shell -nx g @nrwl/express:app my-app +nx g @nx/express:app my-app ``` Serve the application by running @@ -46,7 +46,7 @@ nx serve my-app This starts the application on localhost:3333/api by default. -> Express does not come with any library generators, but you can leverage the[`@nrwl/js`](/packages/js#create-libraries) plugin to generate a Node.js library for your express application. +> Express does not come with any library generators, but you can leverage the[`@nx/js`](/packages/js#create-libraries) plugin to generate a Node.js library for your express application. ### Application Proxies @@ -54,7 +54,7 @@ The Express application generator has an option to configure other projects in t can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/express:app --frontendProject my-react-app +nx g @nx/express:app --frontendProject my-react-app ``` ## Using Express @@ -89,5 +89,5 @@ before serving the Express application. ## More Documentation - [Using Jest](/packages/jest) -- [@nrwl/js](/packages/js) +- [@nx/js](/packages/js) - [Express](https://expressjs.com/) diff --git a/docs/shared/packages/jest/jest-plugin.md b/docs/shared/packages/jest/jest-plugin.md index dbd920e158c6c..95f6c6d9f31ec 100644 --- a/docs/shared/packages/jest/jest-plugin.md +++ b/docs/shared/packages/jest/jest-plugin.md @@ -9,27 +9,27 @@ By default, Nx will use Jest when creating applications and libraries. ```shell -nx g @nrwl/web:app frontend +nx g @nx/web:app frontend ``` ### Adding Jest to an Existing Project -Add Jest to a project using the `jest-project` generator from `@nrwl/jest`. +Add Jest to a project using the `jest-project` generator from `@nx/jest`. -First, install `@nrwl/jest`, if not already installed using your preferred package manager. +First, install `@nx/jest`, if not already installed using your preferred package manager. ```shell -npm install --save-dev @nrwl/jest +npm install --save-dev @nx/jest ``` ```shell -yarn add --dev @nrwl/jest +yarn add --dev @nx/jest ``` Once installed, run the `jest-project` generator ```shell -nx g @nrwl/jest:jest-project --project= +nx g @nx/jest:jest-project --project= ``` > Hint: You can use the `--dry-run` flag to see what will be generated. @@ -99,12 +99,12 @@ Primary configurations for Jest will be via the `jest.config.ts` file that gener The root level `jest.config.ts` file configures [Jest multi project support](https://jestjs.io/docs/configuration#projects-arraystring--projectconfig). This configuration allows editor/IDE integrations to pick up individual project's configurations rather than the one at the root. -The set of Jest projects within Nx workspaces tends to change. Instead of statically defining a list in `jest.config.ts`, Nx provides a utility function called `getJestProjects` which queries for Jest configurations defined for targets which use the `@nrwl/jest:jest` executor. +The set of Jest projects within Nx workspaces tends to change. Instead of statically defining a list in `jest.config.ts`, Nx provides a utility function called `getJestProjects` which queries for Jest configurations defined for targets which use the `@nx/jest:jest` executor. You can add Jest projects which are not included in `getJestProjects()`, because they do not use the Nx Jest executor, by doing something like the following: ```typescript {% fileName="jest.config.ts"} -import { getJestProjects } from '@nrwl/jest'; +import { getJestProjects } from '@nx/jest'; export default { projects: [...getJestProjects(), '/path/to/jest.config.ts'], @@ -135,7 +135,7 @@ In order to use Jest's global setup/teardown functions that reference nx librari Nx provides a helper function that you can import within your setup/teardown file. ```typescript {% fileName="global-setup.ts" %} -import { registerTsProject } from '@nrwl/js/src/internal'; +import { registerTsProject } from '@nx/js/src/internal'; const cleanupRegisteredPaths = registerTsProject('.', 'tsconfig.base.json'); import { yourFancyFunction } from '@some-org/my-util-library'; @@ -166,4 +166,4 @@ export default { ## More Documentation - [Jest Docs](https://jestjs.io/) -- [@nrwl/jest options](/packages/jest) +- [@nx/jest options](/packages/jest) diff --git a/docs/shared/packages/js/js-plugin.md b/docs/shared/packages/js/js-plugin.md index ccb0c3a4d8afb..dac4c68489dee 100644 --- a/docs/shared/packages/js/js-plugin.md +++ b/docs/shared/packages/js/js-plugin.md @@ -4,20 +4,20 @@ The JS plugin contains executors and generators that are useful for JavaScript/T ### Installation -In any Nx workspace, you can install `@nrwl/js` by running the following commands if `@nrwl/js` package is not installed: +In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed: {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/js +npm i --save-dev @nx/js ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/js +yarn add --dev @nx/js ``` {% /tab %} @@ -25,7 +25,7 @@ yarn add --dev @nrwl/js ### `ts` Preset -When initializing a new Nx workspace, specifying `--preset=ts` will generate a workspace with `@nrwl/js` pre-installed. +When initializing a new Nx workspace, specifying `--preset=ts` will generate a workspace with `@nx/js` pre-installed. {% tabs %} {%tab label="npm"%} @@ -49,7 +49,7 @@ yarn create nx-workspace my-org --preset=ts You can add a new JS/TS library with the following command: ```shell -nx g @nrwl/js:lib my-lib +nx g @nx/js:lib my-lib ``` ## Build @@ -57,7 +57,7 @@ nx g @nrwl/js:lib my-lib You can `build` libraries that are generated with a bundler specified. ```shell -nx g @nrwl/js:lib my-buildable-lib --bundler=rollup +nx g @nx/js:lib my-buildable-lib --bundler=rollup ``` Generating a library with `--bundler` specified will add a `build` target to the library's `project.json` file allows the library to be built. @@ -84,9 +84,9 @@ nx lint my-lib ## Compiler -By default, `@nrwl/js` uses [TypeScript Compiler (TSC)](https://www.typescriptlang.org/docs/handbook/2/basic-types.html#tsc-the-typescript-compiler), via `@nrwl/js:tsc` executor, to compile your libraries. Optionally, you can switch `tsc` out for a different compiler with `--compiler` flag when executing the generators. +By default, `@nx/js` uses [TypeScript Compiler (TSC)](https://www.typescriptlang.org/docs/handbook/2/basic-types.html#tsc-the-typescript-compiler), via `@nx/js:tsc` executor, to compile your libraries. Optionally, you can switch `tsc` out for a different compiler with `--compiler` flag when executing the generators. -Currently, `@nrwl/js` supports the following compilers: +Currently, `@nx/js` supports the following compilers: - [Speedy Web Compiler (SWC)](https://swc.rs) @@ -95,15 +95,15 @@ Currently, `@nrwl/js` supports the following compilers: - Create a buildable library with `swc` ```shell -nx g @nrwl/js:lib my-swc-lib --bundler=swc +nx g @nx/js:lib my-swc-lib --bundler=swc ``` - Convert a `tsc` library to use `swc` ```shell -nx g @nrwl/js:convert-to-swc my-buildable-lib +nx g @nx/js:convert-to-swc my-buildable-lib ``` -Now the `build` command will use `@nrwl/js:swc` executor to compile your libraries. +Now the `build` command will use `@nx/js:swc` executor to compile your libraries. -> The first time you generate a `swc` library or convert a `tsc` library over to `swc`, `@nrwl/js` will install the necessary dependencies to use `swc`. +> The first time you generate a `swc` library or convert a `tsc` library over to `swc`, `@nx/js` will install the necessary dependencies to use `swc`. diff --git a/docs/shared/packages/linter/enforce-module-boundaries.md b/docs/shared/packages/linter/enforce-module-boundaries.md index 7e2b539cd7731..6af916e671ee7 100644 --- a/docs/shared/packages/linter/enforce-module-boundaries.md +++ b/docs/shared/packages/linter/enforce-module-boundaries.md @@ -1,4 +1,4 @@ -The `@nrwl/nx/enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps to prevent unplanned cross-dependencies. +The `@nx/enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps to prevent unplanned cross-dependencies. ## Usage @@ -11,7 +11,7 @@ You can use the `enforce-module-boundaries` rule by adding it to your ESLint rul { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { - "@nrwl/nx/enforce-module-boundaries": [ + "@nx/enforce-module-boundaries": [ "error", { // ...rule specific configuration diff --git a/docs/shared/packages/linter/eslint-plugin.md b/docs/shared/packages/linter/eslint-plugin.md index 9a577e5821f65..7c966c2c24aba 100644 --- a/docs/shared/packages/linter/eslint-plugin.md +++ b/docs/shared/packages/linter/eslint-plugin.md @@ -1,23 +1,23 @@ -The `@nrwl/eslint-plugin-nx` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called [enforce-module-boundaries](#enforce-module-boundaries-rule). +The `@nx/eslint-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called [enforce-module-boundaries](#enforce-module-boundaries-rule). ## Setting Up ESLint Plugin ### Installation -In any Nx workspace, you can install `@nrwl/eslint-plugin-nx` by running the following commands if the package is not already installed: +In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed: {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/eslint-plugin-nx +npm i --save-dev @nx/eslint-plugin ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/eslint-plugin-nx +yarn add --dev @nx/eslint-plugin ``` {% /tab %} @@ -29,28 +29,28 @@ The plugin contains the following rule configurations divided into sub-plugins. ### JavaScript -The `@nrwl/nx/javascript` ESLint plugin contains best practices when using JavaScript. +The `@nx/javascript` ESLint plugin contains best practices when using JavaScript. ### TypeScript -The `@nrwl/nx/typescript` ESLint plugin contains best practices when using TypeSript. +The `@nx/typescript` ESLint plugin contains best practices when using TypeSript. ### Angular Contains configurations matching best practices when using Angular framework: -- `@nrwl/nx/angular` -- `@nrwl/nx/angular-template` +- `@nx/angular` +- `@nx/angular-template` ### React Contains configurations matching best practices when using React framework: -- `@nrwl/nx/react-base` -- `@nrwl/nx/react-jsx` -- `@nrwl/nx/react-typescript` +- `@nx/react-base` +- `@nx/react-jsx` +- `@nx/react-typescript` -You can also use `@nrwl/nx/react` which includes all three `@nrwl/nx/react-*` plugins +You can also use `@nx/react` which includes all three `@nx/react-*` plugins ### Enforce Module Boundaries rule diff --git a/docs/shared/packages/linter/linter-plugin.md b/docs/shared/packages/linter/linter-plugin.md index d3720e15de704..98328abc80e16 100644 --- a/docs/shared/packages/linter/linter-plugin.md +++ b/docs/shared/packages/linter/linter-plugin.md @@ -4,14 +4,14 @@ The Linter plugin contains executors, generator, plugin and utilities used for l ### Installation -In any Nx workspace, you can install `@nrwl/linter` by running the following commands if `@nrwl/linter` package is not installed: +In any Nx workspace, you can install `@nx/linter` by running the following commands if `@nx/linter` package is not installed: ```shell -npm i --save-dev @nrwl/linter +npm i --save-dev @nx/linter ``` ```shell -yarn add --dev @nrwl/linter +yarn add --dev @nx/linter ``` ## Lint diff --git a/docs/shared/packages/nest/nest-plugin.md b/docs/shared/packages/nest/nest-plugin.md index 4ce12d7b72583..c9d5662de20da 100644 --- a/docs/shared/packages/nest/nest-plugin.md +++ b/docs/shared/packages/nest/nest-plugin.md @@ -24,11 +24,11 @@ yarn create nx-workspace my-workspace --preset=nest To add the Nest plugin to an existing workspace, run one the following commands: ```shell -npm install -D @nrwl/nest +npm install -D @nx/nest ``` ```shell -yarn add -D @nrwl/nest +yarn add -D @nx/nest ``` ### Create Applications @@ -36,7 +36,7 @@ yarn add -D @nrwl/nest You can add a new Nest application with the following command: ```shell -nx g @nrwl/nest:app my-nest-app +nx g @nx/nest:app my-nest-app ``` #### Application Proxies @@ -44,7 +44,7 @@ nx g @nrwl/nest:app my-nest-app Generating Nest applications has an option to configure other projects in the workspace to proxy API requests. This can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/nest:app my-nest-app --frontendProject my-angular-app +nx g @nx/nest:app my-nest-app --frontendProject my-angular-app ``` ### Create Libraries @@ -52,19 +52,19 @@ nx g @nrwl/nest:app my-nest-app --frontendProject my-angular-app You can add a new Nest library with the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib +nx g @nx/nest:lib my-nest-lib ``` To make the library `buildable`, use the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib --buildable +nx g @nx/nest:lib my-nest-lib --buildable ``` To make the library `publishable`, use the following command: ```shell -nx g @nrwl/nest:lib my-nest-lib --publishable --importPath=@my-workspace/my-nest-lib +nx g @nx/nest:lib my-nest-lib --publishable --importPath=@my-workspace/my-nest-lib ``` > Read more about [building and publishing libraries here](/more-concepts/buildable-and-publishable-libraries). diff --git a/docs/shared/packages/next/next-config-setup.md b/docs/shared/packages/next/next-config-setup.md index b03835294f1ae..8bed0d81ca94f 100644 --- a/docs/shared/packages/next/next-config-setup.md +++ b/docs/shared/packages/next/next-config-setup.md @@ -22,7 +22,7 @@ module.exports = withNx({ }); ``` -This guide contains information on how to compose the Nx plugin with other plugins, such as `@next/mdx`. Note that Nx prior to version 16 is missing the compose utility from the `@nrwl/next` package, and a workaround will be provided for Nx 15 and prior. +This guide contains information on how to compose the Nx plugin with other plugins, such as `@next/mdx`. Note that Nx prior to version 16 is missing the compose utility from the `@nx/next` package, and a workaround will be provided for Nx 15 and prior. {% callout type="warning" title="Avoid next-compose-plugins" %} There is a popular package called `next-compose-plugins` that has not been maintained for over two years. This package does not correctly combine plugins in all situations. If you do use it, replace the package with Nx 16's `composePlugins` utility (see below). @@ -34,9 +34,9 @@ Since Nx 16, we provide a `composePlugins` utility function that helps users com ```js // next.config.js -const { composePlugins, withNx } = require('@nrwl/next'); +const { composePlugins, withNx } = require('@nx/next'); /** - * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions} + * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { nx: { @@ -87,7 +87,7 @@ If you are not on Nx 16 and later versions, the `composePlugins` utility is not // ... /** - * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions} + * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { // ... diff --git a/docs/shared/packages/next/plugin-overview.md b/docs/shared/packages/next/plugin-overview.md index 8b1ead35ce61b..bba69db276399 100644 --- a/docs/shared/packages/next/plugin-overview.md +++ b/docs/shared/packages/next/plugin-overview.md @@ -10,16 +10,16 @@ The Next.js plugin contains executors and generators for managing Next.js applic To create a new Nx workspace with Next.js, run `npx create-nx-workspace@latest --preset=next`. -To add Next.js to an existing Nx workspace, install the `@nrwl/next` package. Make sure to install the version that matches your `@nrwl/workspace` version. +To add Next.js to an existing Nx workspace, install the `@nx/next` package. Make sure to install the version that matches your `@nx/workspace` version. ```shell #yarn -yarn add --dev @nrwl/next +yarn add --dev @nx/next ``` ```shell #npm -npm install --save-dev @nrwl/next +npm install --save-dev @nx/next ``` ### Creating Applications @@ -27,7 +27,7 @@ npm install --save-dev @nrwl/next You can add a new application with the following: ```shell -nx g @nrwl/next:app my-new-app +nx g @nx/next:app my-new-app ``` ### Generating Libraries @@ -44,7 +44,7 @@ and [Library Types](/more-concepts/library-types). To generate a new library run: ```shell -nx g @nrwl/next:lib my-new-lib +nx g @nx/next:lib my-new-lib ``` ### Generating Pages and Components @@ -52,9 +52,9 @@ nx g @nrwl/next:lib my-new-lib Nx also provides commands to quickly generate new pages and components for your application. ```shell -nx g @nrwl/next:page my-new-page --project=my-new-app +nx g @nx/next:page my-new-page --project=my-new-app -nx g @nrwl/next:component my-new-component --project=my-new-app +nx g @nx/next:component my-new-component --project=my-new-app ``` Above commands will add a new page `my-new-page` and a component `my-new-component` to `my-new-app` project respectively. @@ -98,7 +98,7 @@ There is no need to build the library prior to using it. When you update your li For libraries intended to be built and published to a registry (e.g. npm) you can use the `--publishable` and `--importPath` options. ```shell -nx g @nrwl/next:lib my-new-lib --publishable --importPath=@happynrwl/ui-components +nx g @nx/next:lib my-new-lib --publishable --importPath=@happynrwl/ui-components ``` ### Testing Projects diff --git a/docs/shared/packages/node/node-plugin.md b/docs/shared/packages/node/node-plugin.md index 2c397a4b746f4..a3c2ee6741e71 100644 --- a/docs/shared/packages/node/node-plugin.md +++ b/docs/shared/packages/node/node-plugin.md @@ -6,10 +6,10 @@ To add the Node plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/node +npm install -D @nx/node # For yarn users -yarn add -D @nrwl/node +yarn add -D @nx/node ``` ### Creating Applications @@ -17,7 +17,7 @@ yarn add -D @nrwl/node You can add a new application with the following: ```shell -nx g @nrwl/node:application my-new-app +nx g @nx/node:application my-new-app ``` You can run your application with `nx serve my-new-app`, which starts it in watch mode. @@ -27,11 +27,11 @@ You can run your application with `nx serve my-new-app`, which starts it in watc Node libraries are a good way to separate features within your organization. To create a Node library run the following command: ```shell -nx g @nrwl/node:lib my-new-lib +nx g @nx/node:lib my-new-lib # If you want the library to be buildable or publishable to npm -nx g @nrwl/node:lib my-new-lib --buildable -nx g @nrwl/node:lib my-new-lib \ +nx g @nx/node:lib my-new-lib --buildable +nx g @nx/node:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` @@ -70,7 +70,7 @@ The output is in the `dist` folder. You can customize the output folder by setti Generating Node applications has an option to configure other projects in the workspace to proxy API requests. This can be done by passing the `--frontendProject` with the project name you wish to enable proxy support for. ```shell -nx g @nrwl/node:application my-new-app \ +nx g @nx/node:application my-new-app \ --frontendProject my-react-app ``` diff --git a/docs/shared/packages/plugin/plugin.md b/docs/shared/packages/plugin/plugin.md index c0606a5df9667..c685286f1b64b 100644 --- a/docs/shared/packages/plugin/plugin.md +++ b/docs/shared/packages/plugin/plugin.md @@ -4,7 +4,7 @@ At its core, a generator is a function that creates or modifies code and an exec > A list of plugins that is maintained by Nrwl is found in the [Nrwl/nx repo](https://github.com/nrwl/nx/tree/master/packages). \ > A list of custom plugins created by the community is found in the [Community](/community) section. -> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nrwl_devkit) for more information.** +> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nx_devkit) for more information.** {% youtube src="https://www.youtube.com/embed/fC1-4fAZDP4" @@ -25,7 +25,7 @@ This command creates a brand-new workspace, and sets up a pre-configured plugin > Note, the command above will create a plugin with the package name set to `@my-org/my-plugin`. You can pass `--importPath` to provide a different package name. -> If you do not want to create a new workspace, install the `@nrwl/nx-plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nrwl/nx-plugin:plugin [pluginName]`. +> If you do not want to create a new workspace, install the `@nx/plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nx/plugin:plugin [pluginName]`. A new plugin is created with a default generator, executor, and e2e app. @@ -51,7 +51,7 @@ The `schema.d.ts` file is used for type checking inside the implementation file. ### Adding more generators To add more generators to the plugin, run the following command: -`nx generate @nrwl/nx-plugin:generator [generatorName] --project=[pluginName]`. +`nx generate @nx/plugin:generator [generatorName] --project=[pluginName]`. This will scaffold out a new generator and update the necessary files to support it. @@ -76,7 +76,7 @@ The default executor is set up to just emit a console log. Some examples of what ### Adding more executors To add more executors to the plugin, run the following command: -`nx generate @nrwl/nx-plugin:executor [executor] --project=[pluginName]`. +`nx generate @nx/plugin:executor [executor] --project=[pluginName]`. This will scaffold out a new generator and update the necessary files to support it. @@ -117,7 +117,7 @@ it('should create my-plugin', async (done) => { - The `ensureNxProject` is the function that will create the temporary directory. It takes two arguments, the plugin package name and the dist directory of when it's built. - The `runNxCommandAsync` will execute a `nx` command in the E2E directory. -There are additional functions that the `@nrwl/nx-plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory. +There are additional functions that the `@nx/plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory. ## Including Assets @@ -127,7 +127,7 @@ To make sure that assets are copied to the dist folder, open the plugin's `proje ```jsonc {% fileName="project.json" %} "build": { - "executor": "@nrwl/node:package", + "executor": "@nx/node:package", "options": { // shortened... "assets": [ diff --git a/docs/shared/packages/react-native/react-native-plugin.md b/docs/shared/packages/react-native/react-native-plugin.md index 4c58fdabd4ded..87eba3d362465 100644 --- a/docs/shared/packages/react-native/react-native-plugin.md +++ b/docs/shared/packages/react-native/react-native-plugin.md @@ -28,20 +28,20 @@ npx create-nx-workspace your-workspace-name ### Adding React Native to an Existing Workspace -For existing Nx workspaces, install the `@nrwl/react-native` package to add React Native capabilities to it. +For existing Nx workspaces, install the `@nx/react-native` package to add React Native capabilities to it. {% tabs %} {%tab label="npm"%} ```shell -npm i --save-dev @nrwl/react-native +npm i --save-dev @nx/react-native ``` {% /tab %} {%tab label="yarn"%} ```shell -yarn add --dev @nrwl/react-native +yarn add --dev @nx/react-native ``` {% /tab %} @@ -52,7 +52,7 @@ yarn add --dev @nrwl/react-native To create additional React Native apps run: ```shell -nx g @nrwl/react-native:app +nx g @nx/react-native:app ``` ### Generating Libraries @@ -60,7 +60,7 @@ nx g @nrwl/react-native:app To generate a new library run: ```shell -nx g @nrwl/react-native:lib your-lib-name +nx g @nx/react-native:lib your-lib-name ``` ### Generating Components @@ -68,7 +68,7 @@ nx g @nrwl/react-native:lib your-lib-name To generate a new component inside library run: ```shell -nx g @nrwl/react-native:component your-component-name --project=your-lib-name --export +nx g @nx/react-native:component your-component-name --project=your-lib-name --export ``` Replace `your-lib-name` with the app's name as defined in your `tsconfig.base.json` file or the `name` property of your `package.json` @@ -82,7 +82,7 @@ The Nx CLI provides the [`migrate` command](/core-features/automate-updating-dep To upgrade native iOS and Android code to latest, you can use the [upgrade-native](/packages/react-native/generators/upgrade-native) generator: ```shell -nx generate @nrwl/react-native:upgrade-native +nx generate @nx/react-native:upgrade-native ``` This is a command that will replace the iOS and Android native code folder entirely. diff --git a/docs/shared/packages/react/react-plugin.md b/docs/shared/packages/react/react-plugin.md index d2a5864d5c265..ef171ef6a4fcc 100644 --- a/docs/shared/packages/react/react-plugin.md +++ b/docs/shared/packages/react/react-plugin.md @@ -14,10 +14,10 @@ To add the React plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/react +npm install -D @nx/react # For yarn users -yarn add -D @nrwl/react +yarn add -D @nx/react ``` ### Creating Applications and Libraries @@ -25,7 +25,7 @@ yarn add -D @nrwl/react You can add a new application with the following: ```shell -nx g @nrwl/react:app my-new-app +nx g @nx/react:app my-new-app ``` To start the application in development mode, run `nx serve my-new-app`. @@ -33,12 +33,12 @@ To start the application in development mode, run `nx serve my-new-app`. And add a new library as follows: ```shell -nx g @nrwl/react:lib my-new-lib +nx g @nx/react:lib my-new-lib # If you want the library to be buildable or publishable to npm -nx g @nrwl/react:lib my-new-lib --bundler=vite -nx g @nrwl/react:lib my-new-lib --bundler=rollup -nx g @nrwl/react:lib my-new-lib \ +nx g @nx/react:lib my-new-lib --bundler=vite +nx g @nx/react:lib my-new-lib --bundler=rollup +nx g @nx/react:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` @@ -50,12 +50,12 @@ Read more about [building and publishing libraries here](/more-concepts/buildabl Adding a component to an existing project can be done with: ```shell -nx g @nrwl/react:component my-new-component \ +nx g @nx/react:component my-new-component \ --project=my-new-app # Note: If you want to export the component # from the library use --export -nx g @nrwl/react:component my-new-component \ +nx g @nx/react:component my-new-component \ --project=my-new-lib \ --export ``` @@ -67,7 +67,7 @@ Replace `my-new-app` and `my-new-lib` with the name of your projects. If you want to add a new hook, run the following ```shell -nx g @nrwl/react:hook my-new-hook --project=my-new-lib +nx g @nx/react:hook my-new-hook --project=my-new-lib ``` Replace `my-new-lib` with the name of your project. diff --git a/docs/shared/packages/storybook/angular-browser-target.md b/docs/shared/packages/storybook/angular-browser-target.md index 62dcfe098d8ec..9c4537da40e21 100644 --- a/docs/shared/packages/storybook/angular-browser-target.md +++ b/docs/shared/packages/storybook/angular-browser-target.md @@ -52,7 +52,7 @@ Your Storybook targets in your `project.json` will look like this: ```jsonc {% fileName="project.json" %} "storybook": { - "executor": "@nrwl/storybook:storybook", + "executor": "@nx/storybook:storybook", "options": { ... "projectBuildConfig": "my-project:build-storybook" @@ -60,7 +60,7 @@ Your Storybook targets in your `project.json` will look like this: ... }, "build-storybook": { - "executor": "@nrwl/storybook:build", + "executor": "@nx/storybook:build", ... "options": { ... diff --git a/docs/shared/packages/storybook/angular-storybook-compodoc.md b/docs/shared/packages/storybook/angular-storybook-compodoc.md index defc5e8fd808f..9ba52a8ff1c4d 100644 --- a/docs/shared/packages/storybook/angular-storybook-compodoc.md +++ b/docs/shared/packages/storybook/angular-storybook-compodoc.md @@ -141,7 +141,7 @@ Make sure you are on Nx version `>=14.1.8` and your `storybook` target is using If you are using an older version of Nx, you can use [`nx migrate`](/packages/nx/documents/migrate) to migrate your codebase to a later version. Using `nx migrate` will also make sure to update your `storybook` and `build-storybook` targets to match the new format. -If you **are** on Nx `>=14.1.8` and you are still using the old executor (`@nrwl/storybook:storybook`), you can read our documentation about the [Angular Storybook targets](/packages/storybook/documents/angular-storybook-targets) to help you change your `storybook` and `build-storybook` targets across your workspace for your Angular projects using Storybook. +If you **are** on Nx `>=14.1.8` and you are still using the old executor (`@nx/storybook:storybook`), you can read our documentation about the [Angular Storybook targets](/packages/storybook/documents/angular-storybook-targets) to help you change your `storybook` and `build-storybook` targets across your workspace for your Angular projects using Storybook. {% /callout %} ### 4. Let Storybook know of the `documentation.json` file diff --git a/docs/shared/packages/storybook/angular-storybook-targets.md b/docs/shared/packages/storybook/angular-storybook-targets.md index 10c195b283ef6..bebfe5e2caa39 100644 --- a/docs/shared/packages/storybook/angular-storybook-targets.md +++ b/docs/shared/packages/storybook/angular-storybook-targets.md @@ -20,9 +20,9 @@ If you are on Nx version `<14.1.8` and you want to move to the latest version (o If you have already moved on a version of Nx `>=14.1.8` without using `nx migrate` and now you are having trouble with your Angular projects using Storybook (eg. `Property 'uiFramework' does not match the schema. '@storybook/angular' should be one of ...`), that means that your targets are still using the old schema and they should change. The way to fix that is to call `nx migrate` again like this: ```bash -nx migrate @nrwl/storybook@14.1.0 --to="@nrwl/storybook@14.2.0" +nx migrate @nx/storybook@14.1.0 --to="@nx/storybook@14.2.0" ``` and follow the instructions that will be printed in the console. -This command will generate a new `migrations.json` file which will contain the "change-storybook-targets" migration script. This script (when called with `yarn nx migrate --run-migrations`) will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`). +This command will generate a new `migrations.json` file which will contain the "change-storybook-targets" migration script. This script (when called with `yarn nx migrate --run-migrations`) will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nx/storybook:build-storybook` and `@nx/storybook:storybook`). diff --git a/docs/shared/packages/storybook/best-practices.md b/docs/shared/packages/storybook/best-practices.md index 7fd0094b9fe86..07e5ffa035d92 100644 --- a/docs/shared/packages/storybook/best-practices.md +++ b/docs/shared/packages/storybook/best-practices.md @@ -31,7 +31,7 @@ First, let’s see what Nx offers, when you are in the process of developing a p #### Configuration generation -You can generate the Storybook configuration files and settings using the Nx [`@nrwl/storybook:configuration` generator](/packages/storybook/generators/configuration). You can read more about configuring Storybook with Nx in our [`@nrwl/storybook` package overview page](/packages/storybook#generating-storybook-configuration). With Nx, you configure Storybook for each individual project. +You can generate the Storybook configuration files and settings using the Nx [`@nx/storybook:configuration` generator](/packages/storybook/generators/configuration). You can read more about configuring Storybook with Nx in our [`@nx/storybook` package overview page](/packages/storybook#generating-storybook-configuration). With Nx, you configure Storybook for each individual project. #### Stories generation diff --git a/docs/shared/packages/storybook/migrate-webpack-final-react.md b/docs/shared/packages/storybook/migrate-webpack-final-react.md index 490f705b92ea0..de4ebf8e763e1 100644 --- a/docs/shared/packages/storybook/migrate-webpack-final-react.md +++ b/docs/shared/packages/storybook/migrate-webpack-final-react.md @@ -19,7 +19,7 @@ width="100%" /%} Here are the main differences to the previous versions of Nx: - there's no `webpack.config.js`; Custom webpack configurations can be added in the `webpackFinal` property of the `main.js` file -- the `main.js` file now contains a predefined Storybook addon exported by `@nrwl/react/plugins/storybook`. +- the `main.js` file now contains a predefined Storybook addon exported by `@nx/react/plugins/storybook`. Here's an example of a newly generated `main.js` file: @@ -41,7 +41,7 @@ module.exports = { '../src/lib/**/*.stories.mdx', '../src/lib/**/*.stories.@(js|jsx|ts|tsx)', ], - addons: [...rootMain.addons, '@nrwl/react/plugins/storybook'], + addons: [...rootMain.addons, '@nx/react/plugins/storybook'], webpackFinal: async (config, { configType }) => { // apply any global webpack configs that might have been specified in .storybook/main.js if (rootMain.webpackFinal) { @@ -193,7 +193,7 @@ module.exports = async ({ config, mode }) => { }; ``` -Such webpack file is no more needed as the `@nrwl/react/plugins/storybook` now takes care of it. +Such webpack file is no more needed as the `@nx/react/plugins/storybook` now takes care of it. In case you made custom modifications to the `webpack.config.js` file, you need to move them over to the `main.js` `webpackFinal` property and then delete the `webpack.config.js`. diff --git a/docs/shared/packages/storybook/plugin-angular.md b/docs/shared/packages/storybook/plugin-angular.md index 3357fca44e107..6745532ca332a 100644 --- a/docs/shared/packages/storybook/plugin-angular.md +++ b/docs/shared/packages/storybook/plugin-angular.md @@ -13,15 +13,15 @@ You first need to set up Storybook for your Nx workspace, if you haven't already ## Generate Storybook Configuration for an Angular project -You can generate Storybook configuration for an individual Angular project by using the [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration), like this: +You can generate Storybook configuration for an individual Angular project by using the [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration), like this: ```shell -nx g @nrwl/angular:storybook-configuration project-name +nx g @nx/angular:storybook-configuration project-name ``` ## Auto-generate Stories -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) has the option to automatically generate `*.stories.ts` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) has the option to automatically generate `*.stories.ts` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```text / @@ -29,10 +29,10 @@ The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/genera └── my.component.stories.ts ``` -If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nrwl/angular:stories` generator](/packages/angular/generators/stories): +If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nx/angular:stories` generator](/packages/angular/generators/stories): ```shell -nx g @nrwl/angular:stories --project= +nx g @nx/angular:stories --project= ``` {% callout type="note" title="Example" %} @@ -41,7 +41,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c The command to generate stories for that library would be: ```shell -nx g @nrwl/angular:stories --project=feature-ui +nx g @nx/angular:stories --project=feature-ui ``` and the result would be the following: @@ -75,7 +75,7 @@ and the result would be the following: ## Cypress tests for Stories -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. To launch Storybook and run the Cypress tests against the iframe inside of Storybook: @@ -99,7 +99,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c ### Story file -The [`@nrwl/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) would generate a Story file that looks like this: +The [`@nx/angular:storybook-configuration` generator](/packages/angular/generators/storybook-configuration) would generate a Story file that looks like this: ```typescript {% fileName="libs/feature/ui/src/lib/my-button/my-button.component.stories.ts" %} import { Meta } from '@storybook/angular'; diff --git a/docs/shared/packages/storybook/plugin-overview.md b/docs/shared/packages/storybook/plugin-overview.md index bcd7fdd3ca497..cbfce9d597ef9 100644 --- a/docs/shared/packages/storybook/plugin-overview.md +++ b/docs/shared/packages/storybook/plugin-overview.md @@ -19,14 +19,14 @@ Starting with Nx 16, Storybook 7 is going to be used by default to configure you {% tab label="yarn" %} ```shell -yarn add -D @nrwl/storybook +yarn add -D @nx/storybook ``` {% /tab %} {% tab label="npm" %} ```shell -npm install -D @nrwl/storybook +npm install -D @nx/storybook ``` {% /tab %} @@ -39,7 +39,7 @@ npm install -D @nrwl/storybook You can generate Storybook configuration for an individual project with this command: ```shell -nx g @nrwl/storybook:configuration project-name +nx g @nx/storybook:configuration project-name ``` If you are NOT using a framework-specific generator, in the field `storybook7UiFramework` you must choose one of the following Storybook frameworks: @@ -84,7 +84,7 @@ These framework-specific generators will also **generate stories** for you. You can choose to configure your project using TypeScript instead of JavaScript. To do that, just add the `--tsConfiguration=true` flag to the above command, like this: ```shell -nx g @nrwl/storybook:configuration project-name --tsConfiguration=true +nx g @nx/storybook:configuration project-name --tsConfiguration=true ``` [Here is the Storybook documentation](https://storybook.js.org/docs/react/configure/overview#configure-your-project-with-typescript) if you want to learn more. diff --git a/docs/shared/packages/storybook/plugin-react.md b/docs/shared/packages/storybook/plugin-react.md index 2206993acccec..7f1056e356a98 100644 --- a/docs/shared/packages/storybook/plugin-react.md +++ b/docs/shared/packages/storybook/plugin-react.md @@ -13,27 +13,27 @@ You first need to set up Storybook for your Nx workspace, if you haven't already ## Generate Storybook Configuration for a React project -You can generate Storybook configuration for an individual React project by using the [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration), like this: +You can generate Storybook configuration for an individual React project by using the [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration), like this: ```shell -nx g @nrwl/react:storybook-configuration project-name +nx g @nx/react:storybook-configuration project-name ``` ## Nx React Storybook Preset -The [`@nrwl/react`](/packages/react) package ships with a Storybook addon to make sure it uses the very same configuration as your Nx React application. When you generate a Storybook configuration for a project, it'll automatically add the addon to your configuration. +The [`@nx/react`](/packages/react) package ships with a Storybook addon to make sure it uses the very same configuration as your Nx React application. When you generate a Storybook configuration for a project, it'll automatically add the addon to your configuration. ```typescript module.exports = { ... - addons: ['@storybook/addon-essentials', ..., '@nrwl/react/plugins/storybook'], + addons: ['@storybook/addon-essentials', ..., '@nx/react/plugins/storybook'], ... }; ``` ## Auto-generate Stories -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) has the option to automatically generate `*.stories.ts|tsx` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) has the option to automatically generate `*.stories.ts|tsx` files for each component declared in the library. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```text / @@ -41,10 +41,10 @@ The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators └── my-component.stories.tsx ``` -If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nrwl/react:stories` generator](/packages/react/generators/stories): +If you add more components to your project, and want to generate stories for all your (new) components at any point, you can use the [`@nx/react:stories` generator](/packages/react/generators/stories): ```shell -nx g @nrwl/react:stories --project= +nx g @nx/react:stories --project= ``` {% callout type="note" title="Example" %} @@ -53,7 +53,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c The command to generate stories for that library would be: ```shell -nx g @nrwl/react:stories --project=feature-ui +nx g @nx/react:stories --project=feature-ui ``` and the result would be the following: @@ -87,7 +87,7 @@ and the result would be the following: ## Cypress tests for Stories -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) gives the option to set up an e2e Cypress app that is configured to run against the project's Storybook instance. To launch Storybook and run the Cypress tests against the iframe inside of Storybook: @@ -111,7 +111,7 @@ Let's take for a example a library in your workspace, under `libs/feature/ui`, c ### Story file -The [`@nrwl/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) would generate a Story file that looks like this: +The [`@nx/react:storybook-configuration` generator](/packages/react/generators/storybook-configuration) would generate a Story file that looks like this: ```typescript {% fileName="libs/feature/ui/src/lib/my-button/my-button.stories.tsx" %} import type { Meta } from '@storybook/react'; diff --git a/docs/shared/packages/storybook/storybook-7-setup.md b/docs/shared/packages/storybook/storybook-7-setup.md index 6196fa6470641..a2aa0a5521694 100644 --- a/docs/shared/packages/storybook/storybook-7-setup.md +++ b/docs/shared/packages/storybook/storybook-7-setup.md @@ -33,14 +33,14 @@ For migrating your existing Nx workspace with existing Storybook configuration t {% tab label="yarn" %} ```shell -yarn add -D @nrwl/storybook +yarn add -D @nx/storybook ``` {% /tab %} {% tab label="npm" %} ```shell -npm install -D @nrwl/storybook +npm install -D @nx/storybook ``` {% /tab %} @@ -53,13 +53,13 @@ npm install -D @nrwl/storybook You can generate Storybook configuration for an individual project with this command: ```shell -nx g @nrwl/storybook:configuration project-name --storybook7Configuration --storybook7UiFramework=@storybook/react-webpack5 +nx g @nx/storybook:configuration project-name --storybook7Configuration --storybook7UiFramework=@storybook/react-webpack5 ``` -Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nrwl/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nrwl/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nrwl/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration), for example: +Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nx/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nx/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nx/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration), for example: ```shell -nx g @nrwl/angular:storybook-configuration my-angular-project --storybook7Configuration +nx g @nx/angular:storybook-configuration my-angular-project --storybook7Configuration ``` {% callout type="info" title="For Nx versions <15.9" %} @@ -114,7 +114,7 @@ The Storybook configuration generated by Nx for Storybook 7 is very similar to t #### Changes in the `storybook` and `build-storybook` targets - The `uiFramework` field is not needed any more, thus it is not set. Nx was using the `uiFramework` field to load any framework specific options for the Storybook builder. This is no longer needed, since the `framework` set in `.storybook/main.js|ts` takes care of that. -- More options from the Storybook CLI are now exposed in the executors. You can see these in the [`@nrwl/storybook:storybook`](/packages/storybook/executors/storybook) and [`@nrwl/storybook:build`](/packages/storybook/executors/build) executor schemas. You can read more about these options in the [Storybook 7 CLI docs](https://storybook.js.org/docs/7.0/react/api/cli-options). If there's an option you need to pass but it's not in the executor schema, you can always pass it, since the executors are just passing the options to the Storybook CLI. +- More options from the Storybook CLI are now exposed in the executors. You can see these in the [`@nx/storybook:storybook`](/packages/storybook/executors/storybook) and [`@nx/storybook:build`](/packages/storybook/executors/build) executor schemas. You can read more about these options in the [Storybook 7 CLI docs](https://storybook.js.org/docs/7.0/react/api/cli-options). If there's an option you need to pass but it's not in the executor schema, you can always pass it, since the executors are just passing the options to the Storybook CLI. ## Use Storybook 7 diff --git a/docs/shared/packages/storybook/storybook-v6-angular.md b/docs/shared/packages/storybook/storybook-v6-angular.md index 7cf6449f1e01a..d2a5fd4a36b11 100644 --- a/docs/shared/packages/storybook/storybook-v6-angular.md +++ b/docs/shared/packages/storybook/storybook-v6-angular.md @@ -33,7 +33,7 @@ In that case, when you run the Nx migration scripts, the scripts will ignore the ### Some info about the generator -The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: +The `@nx/angular:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: - It will generate new Storybook configuration files using the new (`>6.x`) Storybook way. The way it will do that is, it will look in all the `project.json` files and it will find all the projects that have a `Storybook` configuration. Using the `configFolder` path provided there, it will go and generate new Storybook instances in all these paths. Finally, it will generate a new Storybook instance at the root directory. @@ -46,7 +46,7 @@ The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator will not exactly That way, you can have working Storybook instances for all your projects just by running ```shell -nx g @nrwl/angular:storybook-migrate-defaults-5-to-6 +nx g @nx/angular:storybook-migrate-defaults-5-to-6 ``` ### What if I had made changes to the defaults? @@ -59,7 +59,7 @@ Please check out this official [Storybook 6 Migration Guide](https://medium.com/ The generator gives you the option to migrate one project at a time. You can provide the `--name=PROJECT_NAME` flag, and then the generator will **only** generate new files for the specified project. -Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nrwl/angular:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. +Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nx/angular:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. ### General tip: @@ -67,7 +67,7 @@ Please note that this option will NOT update all the Storybook-related (`@storyb ## Upgrading to Storybook 6 manually -There is really no great reason for doing the migration completely manually. The `@nrwl/angular:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). +There is really no great reason for doing the migration completely manually. The `@nx/angular:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). However, if you still want to do everything manually, these are the steps you should follow: diff --git a/docs/shared/packages/storybook/storybook-v6-react.md b/docs/shared/packages/storybook/storybook-v6-react.md index 053fa0caa623f..ff90ea654afff 100644 --- a/docs/shared/packages/storybook/storybook-v6-react.md +++ b/docs/shared/packages/storybook/storybook-v6-react.md @@ -33,7 +33,7 @@ In that case, when you run the Nx migration scripts, the scripts will ignore the ### Some info about the generator -The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: +The `@nx/react:storybook-migrate-defaults-5-to-6` generator will not exactly do a migration. It will perform the following actions: - It will generate new Storybook configuration files using the new (`>6.x`) Storybook way. The way it will do that is, it will look in all the `project.json` files and it will find all the projects that have a `Storybook` configuration. Using the `configFolder` path provided there, it will go and generate new Storybook instances in all these paths. Finally, it will generate a new Storybook instance at the root directory. @@ -46,7 +46,7 @@ The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator will not exactly d That way, you can have working Storybook instances for all your projects just by running ```shell -nx g @nrwl/react:storybook-migrate-defaults-5-to-6 +nx g @nx/react:storybook-migrate-defaults-5-to-6 ``` ### What if I had made changes to the defaults? @@ -59,7 +59,7 @@ Please check out this official [Storybook 6 Migration Guide](https://medium.com/ The generator gives you the option to migrate one project at a time. You can provide the `--name=PROJECT_NAME` flag, and then the generator will **only** generate new files for the specified project. -Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nrwl/react:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. +Please note that this option will NOT update all the Storybook-related (`@storybook/*`) packages in your `package.json`, or the root Storybook folder. The reason is that if you want to do the migration gradually, one project at a time, you want your old, existing, projects, to still work. That way, you will still be able to run your old, non-migrated Storybook projects. However, you will not be able to run any migrated Storbook projects. Once you have migrated all your Storybook projects, you can run `nx g @nx/react:storybook-migrate-defaults-5-to-6` once again, and the generator will take care of updating all the Storybook-related (`@storybook/*`) packages in your `package.json` and it will also generate the new Storybook files for the root Storybook directory. ### General tip: @@ -67,7 +67,7 @@ Please note that this option will NOT update all the Storybook-related (`@storyb ## Upgrading to Storybook 6 manually -There is really no great reason for doing the migration completely manually. The `@nrwl/react:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). +There is really no great reason for doing the migration completely manually. The `@nx/react:storybook-migrate-defaults-5-to-6` generator [will take care of Steps 1, 2 and 3](#upgrading-to-storybook-6-using-the-nx-migration-generator). What you will need to do after running the generator is that you have to manually migrate any custom changes you had done to the default Storybook configuration files that were automatically generated by Nx when you first used Nx Storybook. To do the manual migration you should use the official [Storybook 6 Migration Guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) article, as well as the [detailed guides here](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-53x-to-60x). However, if you still want to do everything manually, these are the steps you should follow: diff --git a/docs/shared/packages/vite/set-up-vite-manually.md b/docs/shared/packages/vite/set-up-vite-manually.md index eb6fa564e3fc0..c29bd86f22b19 100644 --- a/docs/shared/packages/vite/set-up-vite-manually.md +++ b/docs/shared/packages/vite/set-up-vite-manually.md @@ -6,14 +6,14 @@ description: This guide explains how you can manually set up your project to use # Manually set up your project to use Vite.js {% callout type="note" title="Use our generator!" %} -It is recommended that you use the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator to do convert an existing project to use [Vite](https://vitejs.dev/). +It is recommended that you use the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator to do convert an existing project to use [Vite](https://vitejs.dev/). {% /callout %} -You can use the `@nrwl/vite:dev-server`,`@nrwl/vite:build` and `@nrwl/vite:test` executors to serve, build and test your project using [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/). To do this, you need to make a few adjustments to your project. It is recommended that you use the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator to do this, but you can also do it manually. +You can use the `@nx/vite:dev-server`,`@nx/vite:build` and `@nx/vite:test` executors to serve, build and test your project using [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/). To do this, you need to make a few adjustments to your project. It is recommended that you use the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator to do this, but you can also do it manually. A reason you may need to do this manually, is if our generator does not support conversion for your project, or if you want to experiment with custom options. -The list of steps below assumes that your project can be converted to use the `@nrwl/vite` executors. However, if it's not supported by the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator, it's likely that your project will not work as expected when converted. So, proceed with caution and always commit your code before making any changes. +The list of steps below assumes that your project can be converted to use the `@nx/vite` executors. However, if it's not supported by the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator, it's likely that your project will not work as expected when converted. So, proceed with caution and always commit your code before making any changes. ## 1. Change the executors in your `project.json` @@ -21,7 +21,7 @@ The list of steps below assumes that your project can be converted to use the `@ This applies to applications, not libraries. -In your app's `project.json` file, change the executor of your `serve` target to use `@nrwl/vite:dev-server` and set it up with the following options: +In your app's `project.json` file, change the executor of your `serve` target to use `@nx/vite:dev-server` and set it up with the following options: ```json //... @@ -29,7 +29,7 @@ In your app's `project.json` file, change the executor of your `serve` target to "targets": { //... "serve": { - "executor": "@nrwl/vite:dev-server", + "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -43,12 +43,12 @@ In your app's `project.json` file, change the executor of your `serve` target to ``` {% callout type="note" title="Other options" %} -Any extra options that you may need to add to your server's configuration can be added in your project's `vite.config.ts` file. You can find all the options that are supported in the [Vite.js documentation](https://vitejs.dev/config/). You can see which of these options you can add in your `project.json` in the [`@nrwl/vite:dev-server`](/packages/vite/executors/dev-server#options) documentation. +Any extra options that you may need to add to your server's configuration can be added in your project's `vite.config.ts` file. You can find all the options that are supported in the [Vite.js documentation](https://vitejs.dev/config/). You can see which of these options you can add in your `project.json` in the [`@nx/vite:dev-server`](/packages/vite/executors/dev-server#options) documentation. {% /callout %} ### The `build` target -In your project's `project.json` file, change the executor of your `build` target to use `@nrwl/vite:build` and set it up with the following options: +In your project's `project.json` file, change the executor of your `build` target to use `@nx/vite:build` and set it up with the following options: ```json //... @@ -56,7 +56,7 @@ In your project's `project.json` file, change the executor of your `build` targe "targets": { //... "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", ... "options": { "outputPath": "dist/apps/my-app" diff --git a/docs/shared/packages/vite/vite-plugin.md b/docs/shared/packages/vite/vite-plugin.md index 6adcf0119f1eb..fd2e513cf04f0 100644 --- a/docs/shared/packages/vite/vite-plugin.md +++ b/docs/shared/packages/vite/vite-plugin.md @@ -38,57 +38,57 @@ There is a number of ways to use Vite in your existing workspace. ### Generate a new project using Vite -You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Vite.js. The [`@nrwl/react:app`](/packages/react/generators/application), [`@nrwl/react:lib`](/packages/react/generators/library) and [`@nrwl/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `vite`. This will generate a new application configured to use Vite.js, and it will also install all the necessary dependencies, including the `@nrwl/vite` plugin. +You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Vite.js. The [`@nx/react:app`](/packages/react/generators/application), [`@nx/react:lib`](/packages/react/generators/library) and [`@nx/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `vite`. This will generate a new application configured to use Vite.js, and it will also install all the necessary dependencies, including the `@nx/vite` plugin. To generate a React application using Vite.js, run the following: ```bash -nx g @nrwl/react:app my-app --bundler=vite +nx g @nx/react:app my-app --bundler=vite ``` To generate a React library using Vite.js, run the following: ```bash -nx g @nrwl/react:lib my-lib --bundler=vite +nx g @nx/react:lib my-lib --bundler=vite ``` To generate a Web application using Vite.js, run the following: ```bash -nx g @nrwl/web:app my-app --bundler=vite +nx g @nx/web:app my-app --bundler=vite ``` ### Modify an existing React or Web project to use Vite.js -You can use the `@nrwl/vite:configuration` generator to change your React or Web project to use Vite.js. This generator will modify your project's configuration to use Vite.js, and it will also install all the necessary dependencies, including the `@nrwl/vite` plugin.. +You can use the `@nx/vite:configuration` generator to change your React or Web project to use Vite.js. This generator will modify your project's configuration to use Vite.js, and it will also install all the necessary dependencies, including the `@nx/vite` plugin.. -You can read more about this generator on the [`@nrwl/vite:configuration`](/packages/vite/generators/configuration) generator page. +You can read more about this generator on the [`@nx/vite:configuration`](/packages/vite/generators/configuration) generator page. ### Initialize Vite.js If you do not want to create any new projects or convert any existing projects yet, you can still use Nx to install all the necessary dependencies for Vite.js. This, for example, could be useful if you want to set up Vite.js manually for a project. -#### Install the `@nrwl/vite` plugin +#### Install the `@nx/vite` plugin {% tabs %} {% tab label="npm" %} ```shell -npm install -D @nrwl/vite +npm install -D @nx/vite ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/vite +yarn add -D @nx/vite ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm install -D @nrwl/vite +pnpm install -D @nx/vite ``` {% /tab %} @@ -99,7 +99,7 @@ pnpm install -D @nrwl/vite After you install the plugin, you can initialize Vite.js. You can do this by running the `init` executor. This executor will make sure to install all the necessary dependencies. ```bash -nx g @nrwl/vite:init +nx g @nx/vite:init ``` {% callout type="note" title="Choosing a framework" %} diff --git a/docs/shared/packages/web/web-plugin.md b/docs/shared/packages/web/web-plugin.md index dcd117ec4ee12..ff46772929595 100644 --- a/docs/shared/packages/web/web-plugin.md +++ b/docs/shared/packages/web/web-plugin.md @@ -12,10 +12,10 @@ To add the web plugin to an existing workspace, run one of the following: ```shell # For npm users -npm install -D @nrwl/web +npm install -D @nx/web # For yarn users -yarn add -D @nrwl/web +yarn add -D @nx/web ``` ### Creating Applications @@ -23,7 +23,7 @@ yarn add -D @nrwl/web You can add a new application with the following: ```shell -nx g @nrwl/web:app my-new-app +nx g @nx/web:app my-new-app ``` The application uses no framework and generates with web components. You can add any framework you want on top of the default setup. @@ -36,13 +36,13 @@ If you are looking to add a React application, check out the [React plugin](/pac ### Creating Libraries -To create a generic TypeScript library (i.e. non-framework specific), use the [`@nrwl/js`](/packages/js) plugin. +To create a generic TypeScript library (i.e. non-framework specific), use the [`@nx/js`](/packages/js) plugin. ```shell -nx g @nrwl/js:lib my-new-lib +nx g @nx/js:lib my-new-lib # If you want the library to be publishable to npm -nx g @nrwl/js:lib my-new-lib \ +nx g @nx/js:lib my-new-lib \ --publishable \ --importPath=@myorg/my-new-lib ``` diff --git a/docs/shared/packages/webpack/plugin-overview.md b/docs/shared/packages/webpack/plugin-overview.md index b724870e27b38..1d9d6f637fe9b 100644 --- a/docs/shared/packages/webpack/plugin-overview.md +++ b/docs/shared/packages/webpack/plugin-overview.md @@ -5,7 +5,7 @@ description: The Nx Plugin for Webpack contains executors and generators that su The Nx plugin for [webpack](https://webpack.js.org/). -[Webpack](https://webpack.js.org/) is a static module bundler for modern JavaScript applications. The `@nrwl/webpack` plugin provides executors that allow you to build and serve your projects using webpack, plus an executor for SSR. +[Webpack](https://webpack.js.org/) is a static module bundler for modern JavaScript applications. The `@nx/webpack` plugin provides executors that allow you to build and serve your projects using webpack, plus an executor for SSR. Nx now allows you to [customize your webpack configuration](/packages/webpack/documents/webpack-config-setup) for your projects. And we also offer [a number of webpack plugins](/packages/webpack/documents/webpack-plugins) for supporting Nx and other frameworks. @@ -27,22 +27,22 @@ npx create-nx-workspace@latest --preset=react-monorepo --bundler=webpack ## Generate a new project using Webpack -You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Webpack in an existing Nx workspace. The [`@nrwl/react:app`](/packages/react/generators/application), [`@nrwl/node:app`](/packages/node/generators/application) and [`@nrwl/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `webpack`. This will generate a new application configured to use Webpack, and it will also install all the necessary dependencies, including the `@nrwl/webpack` plugin. +You can generate a [React](/packages/react) application or library or a [Web](/packages/web) application that uses Webpack in an existing Nx workspace. The [`@nx/react:app`](/packages/react/generators/application), [`@nx/node:app`](/packages/node/generators/application) and [`@nx/web:app`](/packages/web/generators/application) generators accept the `bundler` option, where you can pass `webpack`. This will generate a new application configured to use Webpack, and it will also install all the necessary dependencies, including the `@nx/webpack` plugin. To generate a React application using Webpack, run the following: ```bash -nx g @nrwl/react:app my-app --bundler=webpack +nx g @nx/react:app my-app --bundler=webpack ``` To generate a Node application using Webpack, run the following: ```bash -nx g @nrwl/node:app my-app --bundler=webpack +nx g @nx/node:app my-app --bundler=webpack ``` To generate a Web application using Webpack, run the following: ```bash -nx g @nrwl/web:app my-app --bundler=webpack +nx g @nx/web:app my-app --bundler=webpack ``` diff --git a/docs/shared/packages/webpack/webpack-config-setup.md b/docs/shared/packages/webpack/webpack-config-setup.md index 0c196dd13dc18..322cd684703d1 100644 --- a/docs/shared/packages/webpack/webpack-config-setup.md +++ b/docs/shared/packages/webpack/webpack-config-setup.md @@ -13,7 +13,7 @@ You can configure Webpack using a `webpack.config.js` file in your project. You "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -43,7 +43,7 @@ Set `isolatedConfig` to `true` in your `project.json` file in the `build` target "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -65,7 +65,7 @@ Now, you need to manually add the Nx webpack plugins in your `webpack.config.js` You should start with a basic webpack configuration for Nx in your project, that looks like this: ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); module.exports = composePlugins(withNx(), (config, { options, context }) => { // customize webpack config here @@ -81,14 +81,14 @@ The `composePlugins` function takes a list of plugins and a function, and return 1. `config`: The webpack configuration object. 2. An object with the following properties: - - `options`: The options passed to the `@nrwl/webpack:webpack` executor. - - `context`: The context passed of the `@nrwl/webpack:webpack` executor. + - `options`: The options passed to the `@nx/webpack:webpack` executor. + - `context`: The context passed of the `@nx/webpack:webpack` executor. This gives you the ability to customize the webpack configuration as needed, and make use of the options and context passed to the executor, as well. ### Add configurations for other functionalities -In addition to the basic configuration, you can add configurations for other frameworks or features. The `@nrwl/webpack` package provides plugins such as `withWeb` and `withReact`. This plugins provide features such as TS support, CSS support, JSX support, etc. You can read more about how these plugins work and how to use them in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins). +In addition to the basic configuration, you can add configurations for other frameworks or features. The `@nx/webpack` package provides plugins such as `withWeb` and `withReact`. This plugins provide features such as TS support, CSS support, JSX support, etc. You can read more about how these plugins work and how to use them in our [Webpack Plugins guide](/packages/webpack/documents/webpack-plugins). You may still reconfigure everything manually, without using the Nx plugins. However, these plugins ensure that you have the necessary configuration for Nx to work with your project. @@ -98,11 +98,11 @@ For most apps, the default configuration of webpack is sufficient, but sometimes ### Configure webpack for React projects -React projects use the `@nrwl/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config. +React projects use the `@nx/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config. ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact } = require('@nx/react'); // Nx plugins for webpack. module.exports = composePlugins( @@ -138,7 +138,7 @@ npm install -D css-loader {% /tabs %} ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); const { merge } = require('webpack-merge'); module.exports = composePlugins(withNx(), (config, { options, context }) => { @@ -157,14 +157,14 @@ module.exports = composePlugins(withNx(), (config, { options, context }) => { ### Configure webpack for Module Federation -If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nrwl/angular` or `@nrwl/react` then +If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nx/angular` or `@nx/react` then you can customize your webpack configuration as follows. ```js {% fileName="apps/my-app/webpack.config.js" %} -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); const { merge } = require('webpack-merge'); -const withModuleFederation = require('@nrwl/react/module-federation'); -// or `const withModuleFederation = require('@nrwl/angular/module-federation');` +const withModuleFederation = require('@nx/react/module-federation'); +// or `const withModuleFederation = require('@nx/angular/module-federation');` module.exports = composePlugins( withNx(), @@ -188,7 +188,7 @@ config object. Next.js supports webpack customization in the `next.config.js` file. ```js {% fileName="next.config.js" %} -const { withNx } = require('@nrwl/next/plugins/with-nx'); +const { withNx } = require('@nx/next/plugins/with-nx'); const nextConfig = { webpack: ( diff --git a/docs/shared/packages/webpack/webpack-plugins.md b/docs/shared/packages/webpack/webpack-plugins.md index d8929d6752ef2..90897910400a3 100644 --- a/docs/shared/packages/webpack/webpack-plugins.md +++ b/docs/shared/packages/webpack/webpack-plugins.md @@ -27,7 +27,7 @@ Disable type checks (useful to speed up builds). ### Example ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); module.exports = composePlugins(withNx(), (config) => { // Further customize webpack config @@ -110,7 +110,7 @@ Enables the use of subresource integrity validation. ### Example ```js -const { composePlugins, withNx, withWeb } = require('@nrwl/webpack'); +const { composePlugins, withNx, withWeb } = require('@nx/webpack'); module.exports = composePlugins( // always pass withNx() first @@ -143,8 +143,8 @@ SVGR allows SVG files to be imported as React components. Set this to `false` to ### Example ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact } = require('@nx/react'); module.exports = composePlugins( withNx(), // always pass withNx() first @@ -223,8 +223,8 @@ Shared libraries in addition to the ones that Nx detects automatically. Items ma {% tab label="React Module Federation" %} ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact, withModuleFederation } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact, withModuleFederation } = require('@nx/react'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -248,7 +248,7 @@ module.exports = composePlugins( const { composePlugins, withModuleFederation, -} = require('@nrwl/angular/module-federation'); +} = require('@nx/angular/module-federation'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -267,8 +267,8 @@ module.exports = composePlugins( {% tab label="React Module Federation for SSR " %} ```js -const { composePlugins, withNx } = require('@nrwl/webpack'); -const { withReact, withModuleFederatioForSSRn } = require('@nrwl/react'); +const { composePlugins, withNx } = require('@nx/webpack'); +const { withReact, withModuleFederatioForSSRn } = require('@nx/react'); // Host config // e.g. { remotes: ['about', 'dashboard'] } @@ -292,7 +292,7 @@ module.exports = composePlugins( const { composePlugins, withModuleFederationForSSR, -} = require('@nrwl/angular/module-federation'); +} = require('@nx/angular/module-federation'); // Host config // e.g. { remotes: ['about', 'dashboard'] } diff --git a/docs/shared/packages/workspace/workspace-plugin.md b/docs/shared/packages/workspace/workspace-plugin.md index 316e3e85055ed..935c733904536 100644 --- a/docs/shared/packages/workspace/workspace-plugin.md +++ b/docs/shared/packages/workspace/workspace-plugin.md @@ -2,18 +2,18 @@ The workspace plugin contains executors and generators that are useful for any N ## Creating Local Generators -Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nrwl/nx-plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins. +Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nx/plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins. > See more about [local generators](/recipes/generators/local-generators) ## Reorganizing Projects After some time of working within a workspace, projects might need to be moved or sometimes even removed. -The workspace plugin provides the [`@nrwl/workspace:move`](/packages/workspace/generators/move) and [`@nrwl/workspace:remove`](/packages/workspace/generators/remove) generators to help aid with this. +The workspace plugin provides the [`@nx/workspace:move`](/packages/workspace/generators/move) and [`@nx/workspace:remove`](/packages/workspace/generators/remove) generators to help aid with this. ### Moving Projects -Running `nx g @nrwl/workspace:move --projectName my-lib --destination new/location/my-lib` will move the `my-lib` library to `libs/new/location/my-lib`. +Running `nx g @nx/workspace:move --projectName my-lib --destination new/location/my-lib` will move the `my-lib` library to `libs/new/location/my-lib`. Moving the files manually can be done easily but a lot of steps are often missed when projects are moved. This generator will also handle the following: @@ -24,11 +24,11 @@ Moving the files manually can be done easily but a lot of steps are often missed 5. Paths in target options such as output path will be changed 6. Other configuration will be updated too, such as `extends` in `tsconfig.json`, the name of the project in `jest.config.js`, and the extends in `.eslintrc.json` -> See more about [`@nrwl/workspace:move`](/packages/workspace/generators/move) +> See more about [`@nx/workspace:move`](/packages/workspace/generators/move) ### Removing Projects -Running `nx g @nrwl/workspace:remove my-lib` will remove the `my-lib` from the workspace. It is important to note that sometimes, projects cannot be removed if they are still depended on by other projects. +Running `nx g @nx/workspace:remove my-lib` will remove the `my-lib` from the workspace. It is important to note that sometimes, projects cannot be removed if they are still depended on by other projects. Like when moving projects, some steps are often missed when removing projects. This generator will also handle the following: @@ -37,12 +37,12 @@ Like when moving projects, some steps are often missed when removing projects. T 3. The project's configuration will be removed. 4. The path mapping in `tsconfig.base.json` will be removed. -> See more about [`@nrwl/workspace:remove`](/packages/workspace/generators/remove) +> See more about [`@nx/workspace:remove`](/packages/workspace/generators/remove) ## Running custom commands Executors provide an optimized way of running targets but unfortunately, not every target has an executor written for it. The [`nx:run-commands`](/packages/nx/executors/run-commands) executor is an executor that runs any command or multiple commands in the shell. This can be useful when integrating with other tools which do not have an executor provided. There is also a generator to help configure this executor. -Running `nx g @nrwl/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'` will create a `my-feature-lib:printhello` target that executes `echo hello` in the shell. +Running `nx g @nx/workspace:run-commands printhello --project my-feature-lib --command 'echo hello'` will create a `my-feature-lib:printhello` target that executes `echo hello` in the shell. > See more about [`nx:run-commands`](/packages/nx/executors/run-commands) diff --git a/docs/shared/plugin-features/use-code-generators.md b/docs/shared/plugin-features/use-code-generators.md index c5e08f5cf014e..ed131979a6268 100644 --- a/docs/shared/plugin-features/use-code-generators.md +++ b/docs/shared/plugin-features/use-code-generators.md @@ -16,7 +16,7 @@ Generators allow you to create or modify your codebase in a simple and repeatabl ```shell nx generate [plugin]:[generator-name] [options] -nx generate @nrwl/react:component mycmp --project=myapp +nx generate @nx/react:component mycmp --project=myapp ``` It is important to have a clean git working directory before invoking a generator so that you can easily revert changes and re-invoke the generator with different inputs. diff --git a/docs/shared/plugin-features/use-task-executors.md b/docs/shared/plugin-features/use-task-executors.md index 59cab1ef5db3c..e6e8be5af5c22 100644 --- a/docs/shared/plugin-features/use-task-executors.md +++ b/docs/shared/plugin-features/use-task-executors.md @@ -20,7 +20,7 @@ Executors are associated with specific targets in a project's `project.json` fil "generators": {}, "targets": { "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", "options": { "outputPath": "dist/apps/cart", ... @@ -33,7 +33,7 @@ Executors are associated with specific targets in a project's `project.json` fil } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { ... } @@ -50,7 +50,7 @@ Each project has targets configured to run an executor with a specific set of op Each executor definition has an `executor` property and, optionally, an `options` and a `configurations` property. -- `executor` is a string of the form `[package name]:[executor name]`. For the `build` executor, the package name is `@nrwl/web` and the executor name is `webpack`. +- `executor` is a string of the form `[package name]:[executor name]`. For the `build` executor, the package name is `@nx/web` and the executor name is `webpack`. - `options` is an object that contains any configuration defaults for the executor. These options vary from executor to executor. - `configurations` allows you to create presets of options for different scenarios. All the configurations start with the properties defined in `options` as a baseline and then overwrite those options. In the example, there is a `production` configuration that overrides the default options to set `sourceMap` to `false`. diff --git a/docs/shared/react-standalone-tutorial/1-code-generation.md b/docs/shared/react-standalone-tutorial/1-code-generation.md index 6b994c8c463a3..144ec231acab4 100644 --- a/docs/shared/react-standalone-tutorial/1-code-generation.md +++ b/docs/shared/react-standalone-tutorial/1-code-generation.md @@ -65,13 +65,13 @@ There are two projects that have been created for you: As far as Nx is concerned, the root-level `store` app owns every file that doesn't belong to a different project. So files in the `e2e` folder belong to the `e2e` project, everything else belongs to `store`. -{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nrwl/cypress package page." url="/packages/cypress" /%} +{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nx/cypress package page." url="/packages/cypress" /%} ## Generating a Component for the Store -```{% command="npx nx g @nrwl/react:component shop" path="~/store" %} +```{% command="npx nx g @nx/react:component shop" path="~/store" %} -> NX Generating @nrwl/react:component +> NX Generating @nx/react:component ✔ Which stylesheet format would you like to use? · css ✔ Should this component be exported in the project? (y/N) · false @@ -84,11 +84,11 @@ CREATE src/app/shop/shop.tsx ## Generating Libraries -To create the `cart` and `shared/ui` libraries, use the `@nrwl/react:lib` generator: +To create the `cart` and `shared/ui` libraries, use the `@nx/react:lib` generator: -```{% command="npx nx g @nrwl/react:library cart" path="~/store" %} +```{% command="npx nx g @nx/react:library cart" path="~/store" %} -> NX Generating @nrwl/react:library +> NX Generating @nx/react:library ✔ Which stylesheet format would you like to use? · css ✔ What unit test runner should be used? · vitest ✔ Which bundler would you like to use to build the library? · vite @@ -115,9 +115,9 @@ CREATE cart/src/lib/cart.spec.tsx CREATE cart/src/lib/cart.tsx ``` -```{% command="npx nx g @nrwl/react:lib shared/ui" path="~/store" %} +```{% command="npx nx g @nx/react:lib shared/ui" path="~/store" %} -> NX Generating @nrwl/react:library +> NX Generating @nx/react:library ✔ Which bundler would you like to use to build the library? · vite UPDATE nx.json diff --git a/docs/shared/react-standalone-tutorial/2-project-graph.md b/docs/shared/react-standalone-tutorial/2-project-graph.md index 8b3d3e3c0bf7e..000ba5a8da164 100644 --- a/docs/shared/react-standalone-tutorial/2-project-graph.md +++ b/docs/shared/react-standalone-tutorial/2-project-graph.md @@ -109,11 +109,11 @@ When a library is created, Nx adds a new Typescript path to the `tsconfig.base.j ### `shared-ui` -Run the `@nrwl/react:component` generator with the command: +Run the `@nx/react:component` generator with the command: -```{% command="npx nx g @nrwl/react:component banner --project=shared-ui --export" path="~/store" %} +```{% command="npx nx g @nx/react:component banner --project=shared-ui --export" path="~/store" %} -> NX Generating @nrwl/react:component +> NX Generating @nx/react:component CREATE shared/ui/src/lib/banner/banner.module.css CREATE shared/ui/src/lib/banner/banner.spec.tsx diff --git a/docs/shared/react-standalone-tutorial/3-task-running.md b/docs/shared/react-standalone-tutorial/3-task-running.md index 93ad15c0f93ea..23a108aba5191 100644 --- a/docs/shared/react-standalone-tutorial/3-task-running.md +++ b/docs/shared/react-standalone-tutorial/3-task-running.md @@ -23,21 +23,21 @@ Here's the `project.json` file for your `shared-ui` project: "tags": [], "targets": { "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/shared/ui" } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["shared/ui/**/*.{ts,tsx,js,jsx}"] } }, "test": { - "executor": "@nrwl/vite:test", + "executor": "@nx/vite:test", "outputs": ["{projectRoot}/coverage"], "options": { "passWithNoTests": true diff --git a/docs/shared/react-standalone-tutorial/4-task-pipelines.md b/docs/shared/react-standalone-tutorial/4-task-pipelines.md index eec6eef33c823..f0419dc88bfe5 100644 --- a/docs/shared/react-standalone-tutorial/4-task-pipelines.md +++ b/docs/shared/react-standalone-tutorial/4-task-pipelines.md @@ -120,21 +120,21 @@ Here are the outputs defined for the `shared-ui` project: "name": "shared-ui", "targets": { "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/shared/ui" } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["shared/ui/**/*.{ts,tsx,js,jsx}"] } }, "test": { - "executor": "@nrwl/vite:test", + "executor": "@nx/vite:test", "outputs": ["{projectRoot}/coverage"], "options": { "passWithNoTests": true diff --git a/docs/shared/react-tutorial/1-code-generation.md b/docs/shared/react-tutorial/1-code-generation.md index 2b47e049a3b96..07b0d8c751ac0 100644 --- a/docs/shared/react-tutorial/1-code-generation.md +++ b/docs/shared/react-tutorial/1-code-generation.md @@ -46,15 +46,15 @@ Once the command completes, notice two projects were added to the workspace: - A React application located in `apps/store`. - A Project for Cypress e2e tests for our `store` application in `apps/store-e2e`. -{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nrwl/cypress package page." url="/packages/cypress" /%} +{% card title="Nx Cypress Support" description="While we see the Cypress project here, we won't go deeper on Cypress in this tutorial. You can find more materials on Nx Cypress support on the @nx/cypress package page." url="/packages/cypress" /%} ## Adding Another Application to Your Workspace Run this command to create your `admin` app: -```{% command="npx nx g @nrwl/react:app admin" path="~/myorg" %} +```{% command="npx nx g @nx/react:app admin" path="~/myorg" %} -> NX Generating @nrwl/react:application +> NX Generating @nx/react:application CREATE apps/admin/.babelrc CREATE apps/admin/.browserslistrc @@ -91,11 +91,11 @@ CREATE apps/admin/tsconfig.spec.json ## Generating Libraries -To create the `common-ui` and `products` libraries, use the `@nrwl/react:lib` and `@nrwl/js:lib` generators respectively: +To create the `common-ui` and `products` libraries, use the `@nx/react:lib` and `@nx/js:lib` generators respectively: -```{% command="npx nx g @nrwl/react:lib common-ui" path="~/myorg" %} +```{% command="npx nx g @nx/react:lib common-ui" path="~/myorg" %} -> NX Generating @nrwl/react:library +> NX Generating @nx/react:library CREATE libs/common-ui/project.json CREATE libs/common-ui/.eslintrc.json @@ -112,9 +112,9 @@ CREATE libs/common-ui/src/lib/common-ui.spec.tsx CREATE libs/common-ui/src/lib/common-ui.tsx ``` -```{% command="npx nx g @nrwl/js:lib products" path="~/myorg" %} +```{% command="npx nx g @nx/js:lib products" path="~/myorg" %} -> NX Generating @nrwl/js:library +> NX Generating @nx/js:library CREATE libs/products/README.md CREATE libs/products/package.json diff --git a/docs/shared/react-tutorial/2-project-graph.md b/docs/shared/react-tutorial/2-project-graph.md index 9697217417d87..4858e6ac59952 100644 --- a/docs/shared/react-tutorial/2-project-graph.md +++ b/docs/shared/react-tutorial/2-project-graph.md @@ -12,11 +12,11 @@ The Project Graph is derived from the source code of your workspace. Make the fo ### `common-ui` -Run the `@nrwl/react:component` generator with the command: +Run the `@nx/react:component` generator with the command: -```{% command="npx nx g @nrwl/react:component banner --project=common-ui --export" path="~/myorg" %} +```{% command="npx nx g @nx/react:component banner --project=common-ui --export" path="~/myorg" %} -> NX Generating @nrwl/react:component +> NX Generating @nx/react:component CREATE libs/common-ui/src/lib/banner/banner.module.css CREATE libs/common-ui/src/lib/banner/banner.spec.tsx diff --git a/docs/shared/react-tutorial/3-task-running.md b/docs/shared/react-tutorial/3-task-running.md index afc0d01ed09ec..0cbd5d2d433ed 100644 --- a/docs/shared/react-tutorial/3-task-running.md +++ b/docs/shared/react-tutorial/3-task-running.md @@ -23,14 +23,14 @@ Here's the `project.json` file for your `common-ui` project: "tags": [], "targets": { "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/common-ui/**/*.{ts,tsx,js,jsx}"] } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/libs/common-ui"], "options": { "jestConfig": "libs/common-ui/jest.config.ts", diff --git a/docs/shared/react-tutorial/4-workspace-optimization.md b/docs/shared/react-tutorial/4-workspace-optimization.md index 75c79c71f9e09..873b8c572c439 100644 --- a/docs/shared/react-tutorial/4-workspace-optimization.md +++ b/docs/shared/react-tutorial/4-workspace-optimization.md @@ -64,7 +64,7 @@ Outputs are defined for every target in your workspace: "projectType": "library", "targets": { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/products", @@ -74,14 +74,14 @@ Outputs are defined for every target in your workspace: } }, "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/products/**/*.ts"] } }, "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/libs/products"], "options": { "jestConfig": "libs/products/jest.config.ts", diff --git a/docs/shared/recipes/advanced-update.md b/docs/shared/recipes/advanced-update.md index abc0eb94146ed..5017f627ba9cf 100644 --- a/docs/shared/recipes/advanced-update.md +++ b/docs/shared/recipes/advanced-update.md @@ -103,7 +103,7 @@ As the migration runs and collects the package updates, you'll be prompted to ap Once you have skipped some optional updates, there'll come a time when you'll want to update those packages. To do so, you'll need to generate the package updates and migrations from the Nx version that contained those skipped updates. -Say you skipped updating Jest to **v28.x.x**. That package update was meant to happen as part of the `@nrwl/jest@14.6.0` update, but you decided to skip it at the time. The recommended way to collect the migrations from such an older version is to run the following: +Say you skipped updating Jest to **v28.x.x**. That package update was meant to happen as part of the `@nx/jest@14.6.0` update, but you decided to skip it at the time. The recommended way to collect the migrations from such an older version is to run the following: ```shell nx migrate latest --from=nx@14.5.0 --exclude-applied-migrations @@ -133,7 +133,7 @@ nx migrate latest --to="jest@22.0.0,cypress@3.4.0" By default, Nx uses currently installed packages to calculate what migrations need to run. To override them, override the version: ```shell -nx migrate latest --to="@nrwl/jest@12.0.0" +nx migrate latest --to="@nx/jest@12.0.0" ``` {% callout type="warning" title="Overriding versions" %} diff --git a/docs/shared/recipes/analyze-source-files.md b/docs/shared/recipes/analyze-source-files.md index 303f2e704314c..ea972000831c3 100644 --- a/docs/shared/recipes/analyze-source-files.md +++ b/docs/shared/recipes/analyze-source-files.md @@ -5,7 +5,7 @@ If you want to disable detecting dependencies from source code and want to only ```json {% fileName="nx.json" %} { "pluginsConfig": { - "@nrwl/js": { + "@nx/js": { "analyzeSourceFiles": false } } diff --git a/docs/shared/recipes/ci-deployment.md b/docs/shared/recipes/ci-deployment.md index f57e1376a9d7a..5007b546613d0 100644 --- a/docs/shared/recipes/ci-deployment.md +++ b/docs/shared/recipes/ci-deployment.md @@ -8,20 +8,20 @@ Additionally, we should generate pruned lock file according to the generated `pa ## Supported executors -The `@nrwl/webpack:webpack` executor supports the `generatePackageJson` flag which generates both `package.json` as well as the lock file. +The `@nx/webpack:webpack` executor supports the `generatePackageJson` flag which generates both `package.json` as well as the lock file. Some executors automatically generate output `package.json` and the lock file generation is supported using the `generateLockfile` flag: -- `@nrwl/js:swc` -- `@nrwl/js:tsc` -- `@nrwl/next:build` +- `@nx/js:swc` +- `@nx/js:tsc` +- `@nx/next:build` ## Using a custom executor -If you are using a custom executor or an executor that does not support `generatePackgeJson` or `generateLockfile` flags, you can still use Nx to generate `package.json` and the lock file. The `createPackageJson` and `createLockFile` functions are exported from `@nrwl/devkit`: +If you are using a custom executor or an executor that does not support `generatePackgeJson` or `generateLockfile` flags, you can still use Nx to generate `package.json` and the lock file. The `createPackageJson` and `createLockFile` functions are exported from `@nx/devkit`: ```typescript -import { createPackageJson, createLockFile } from '@nrwl/devkit'; +import { createPackageJson, createLockFile } from '@nx/devkit'; import { writeFileSync } from 'fs'; export default async function buildExecutor( diff --git a/docs/shared/recipes/deployment/deno-deploy.md b/docs/shared/recipes/deployment/deno-deploy.md index ae16fa5b2dd95..978b04a0a5178 100644 --- a/docs/shared/recipes/deployment/deno-deploy.md +++ b/docs/shared/recipes/deployment/deno-deploy.md @@ -7,7 +7,7 @@ In this guide, we'll show you how to deploy serverless functions using [Deno Dep You can create a new Deno project with a single command. ```shell -npx create-nx-workspace@latest denoapp --preset=@nrwl/deno +npx create-nx-workspace@latest denoapp --preset=@nx/deno ``` Once the command is finished, you can `cd` into the workspace. @@ -24,27 +24,27 @@ For existing projects, see the next section, otherwise you can skip to [deployme **Skip this step if you are not configuring an existing project.** -For existing workspaces, you will need to install the `@nrwl/deno` package. +For existing workspaces, you will need to install the `@nx/deno` package. {% tabs %} {% tab label="npm" %} ```shell -npm i -D @nrwl/deno +npm i -D @nx/deno ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/deno +yarn add -D @nx/deno ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm add -D @nrwl/deno +pnpm add -D @nx/deno ``` {% /tab %} @@ -53,7 +53,7 @@ pnpm add -D @nrwl/deno Now, you can generate a Deno project. ```shell -nx g @nrwl/deno:app denoapp +nx g @nx/deno:app denoapp ``` You are now ready to deploy the project. @@ -63,7 +63,7 @@ You are now ready to deploy the project. We will use [Deno Deploy](https://deno.com/deploy) to host our serverless functions. First, you'll need to run the generator to set up your project. ```shell -nx g @nrwl/deno:setup-serverless --platform=deno-deploy +nx g @nx/deno:setup-serverless --platform=deno-deploy ``` A new `nx deploy` target will be added to your project, but before you can run it there are a few set up steps. diff --git a/docs/shared/recipes/deployment/deno-netlify.md b/docs/shared/recipes/deployment/deno-netlify.md index 3b47635a1baf1..9294d14bcaf59 100644 --- a/docs/shared/recipes/deployment/deno-netlify.md +++ b/docs/shared/recipes/deployment/deno-netlify.md @@ -7,7 +7,7 @@ In this guide, we'll show you how to deploy Deno serverless functions using [Net You can create a new Deno project with a single command. ```shell -npx create-nx-workspace@latest denoapp --preset=@nrwl/deno +npx create-nx-workspace@latest denoapp --preset=@nx/deno ``` Once the command is finished, you can `cd` into the workspace. @@ -24,27 +24,27 @@ For existing projects, see the next section, otherwise you can skip to [deployme **Skip this step if you are not configuring an existing project.** -For existing workspaces, you will need to install the `@nrwl/deno` package. +For existing workspaces, you will need to install the `@nx/deno` package. {% tabs %} {% tab label="npm" %} ```shell -npm i -D @nrwl/deno +npm i -D @nx/deno ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/deno +yarn add -D @nx/deno ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm add -D @nrwl/deno +pnpm add -D @nx/deno ``` {% /tab %} @@ -53,7 +53,7 @@ pnpm add -D @nrwl/deno Now, you can generate a Deno project. ```shell -nx g @nrwl/deno:app denoapp +nx g @nx/deno:app denoapp ``` You are now ready to deploy the project. @@ -63,7 +63,7 @@ You are now ready to deploy the project. First, you'll need to run the generator to set up your project. ```shell -nx g @nrwl/deno:setup-serverless --platform=netlify +nx g @nx/deno:setup-serverless --platform=netlify ``` This will add a `netlify.toml` file and install the `netlify-cli` package. You can deploy your app with the following command. diff --git a/docs/shared/recipes/deployment/node-aws-lambda.md b/docs/shared/recipes/deployment/node-aws-lambda.md index 65d127e18deb5..330b3638e817c 100644 --- a/docs/shared/recipes/deployment/node-aws-lambda.md +++ b/docs/shared/recipes/deployment/node-aws-lambda.md @@ -8,34 +8,34 @@ For new workspaces you can create a Nx workspace with AWS lambda functions with ```shell npx create-nx-workspace@latest my-functions \ ---preset=@nrwl/aws-lambda \ +--preset=@nx/aws-lambda \ ``` ## Configuring existing projects **Skip this step if you are not configuring an existing project.** -You will need to install `@nrwl/aws-lambda` if you haven't already. +You will need to install `@nx/aws-lambda` if you haven't already. {% tabs %} {% tab label="npm" %} ```shell -npm i -D @nrwl/aws-lambda +npm i -D @nx/aws-lambda ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/aws-lambda +yarn add -D @nx/aws-lambda ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm add -D @nrwl/aws-lambda +pnpm add -D @nx/aws-lambda ``` {% /tab %} @@ -44,13 +44,13 @@ pnpm add -D @nrwl/aws-lambda - Add AWS lambda configuration by running the following command: ```shell -nx generate @nrwl/aws-lambda:setup-serverless +nx generate @nx/aws-lambda:setup-serverless ``` - Create a new aws-lambda project with: ```shell -nx generate @nrwl/aws-lambda:serverless +nx generate @nx/aws-lambda:serverless ``` This will do a few things: diff --git a/docs/shared/recipes/deployment/node-server-fly-io.md b/docs/shared/recipes/deployment/node-server-fly-io.md index cf8b2e6b16133..10a932a278b8f 100644 --- a/docs/shared/recipes/deployment/node-server-fly-io.md +++ b/docs/shared/recipes/deployment/node-server-fly-io.md @@ -36,27 +36,27 @@ For existing projects, see the next section, otherwise you can skip to [deployme If you have an existing Node.js server project, you can add the same deployment capabilities as we've just covered. Firstly, if the project is not an Nx project you can initialize it as such by running the `npx nx init` command in your project. Next, we can add the `build` and `docker-build` targets by invoking a couple of generators. -You will need to install `@nrwl/node` and `@nrwl/esbuild` if you haven't already. +You will need to install `@nx/node` and `@nx/esbuild` if you haven't already. {% tabs %} {% tab label="npm" %} ```bash -npm i -D @nrwl/node @nrwl/esbuild +npm i -D @nx/node @nx/esbuild ``` {% /tab %} {% tab label="yarn" %} ```bash -yarn add -D @nrwl/node @nrwl/esbuild +yarn add -D @nx/node @nx/esbuild ``` {% /tab %} {% tab label="pnpm" %} ```bash -pnpm add -D @nrwl/node @nrwl/esbuild +pnpm add -D @nx/node @nx/esbuild ``` {% /tab %} @@ -67,17 +67,17 @@ Now, set up the build and Docker targets with these commands. You will be prompt ```bash # Add build target # You can skip this step if your project already has a build target. -nx g @nrwl/esbuild:esbuild-project --skipValidation +nx g @nx/esbuild:esbuild-project --skipValidation # Add Dockerfile -nx g @nrwl/node:setup-docker +nx g @nx/node:setup-docker ``` You are now ready to deploy the project. ## Deploying the server to Fly.io -Recall that a `Dockerfile` has been created for our project. If you missed the Docker setup, you can always run the `nx g @nrwl/node:setup-docker` command to generate the `Dockerfile`. +Recall that a `Dockerfile` has been created for our project. If you missed the Docker setup, you can always run the `nx g @nx/node:setup-docker` command to generate the `Dockerfile`. Now, all we need to do is set up Fly.io and deploy! If you haven't used Fly.io before, you need to install the CLI and create an account. It'll only take a couple of minutes. diff --git a/docs/shared/recipes/deployment/node-serverless-functions-netlify.md b/docs/shared/recipes/deployment/node-serverless-functions-netlify.md index dc7126c5f81f8..9ad95f4150fdb 100644 --- a/docs/shared/recipes/deployment/node-serverless-functions-netlify.md +++ b/docs/shared/recipes/deployment/node-serverless-functions-netlify.md @@ -8,7 +8,7 @@ For new workspaces you can create a Nx workspace with serverless function with o ```shell npx create-nx-workspace@latest my-functions \ ---preset=@nrwl/netlify \ +--preset=@nx/netlify \ --site=my-site \ # Site ID or name to deploy the functions ``` @@ -16,27 +16,27 @@ npx create-nx-workspace@latest my-functions \ **Skip this step if you are not configuring an existing project.** -You will need to install `@nrwl/netlify` if you haven't already. +You will need to install `@nx/netlify` if you haven't already. {% tabs %} {% tab label="npm" %} ```shell -npm i -D @nrwl/netlify +npm i -D @nx/netlify ``` {% /tab %} {% tab label="yarn" %} ```shell -yarn add -D @nrwl/netlify +yarn add -D @nx/netlify ``` {% /tab %} {% tab label="pnpm" %} ```shell -pnpm add -D @nrwl/netlify +pnpm add -D @nx/netlify ``` {% /tab %} @@ -45,13 +45,13 @@ pnpm add -D @nrwl/netlify - Add serverless configuration by running the following command: ```shell -nx generate @nrwl/netlify:setup-serverless +nx generate @nx/netlify:setup-serverless ``` - Create a new netlify serverless project with: ```shell -nx generate @nrwl/netlfiy:serverless +nx generate @nx/netlfiy:serverless ``` This will do a few things: diff --git a/docs/shared/recipes/generators/composing-generators.md b/docs/shared/recipes/generators/composing-generators.md index ad64ee88df18d..9876963ec58a1 100644 --- a/docs/shared/recipes/generators/composing-generators.md +++ b/docs/shared/recipes/generators/composing-generators.md @@ -7,7 +7,7 @@ Generators are useful individually, but reusing and composing generators allows Nx Devkit generators can be imported and invoked like any javascript function. They often return a `Promise`, so they can be used with the `await` keyword to mimic synchronous code. Because this is standard javascript, control flow logic can be adjusted with `if` blocks and `for` loops as usual. ```typescript -import { libraryGenerator } from '@nrwl/js'; +import { libraryGenerator } from '@nx/js'; export default async function (tree: Tree, schema: any) { await libraryGenerator( @@ -22,7 +22,7 @@ export default async function (tree: Tree, schema: any) { Codemods created for use with [`jscodeshift`](https://github.com/facebook/jscodeshift) can be used within Nx Devkit generators using the `visitNotIgnoredFiles` helper function. This way you can compose codemods with other generators while retaining `--dry-run` and Nx Console compatibilities. ```typescript -import { Tree, visitNotIgnoredFiles } from '@nrwl/devkit'; +import { Tree, visitNotIgnoredFiles } from '@nx/devkit'; import { applyTransform } from 'jscodeshift/src/testUtils'; import arrowFunctionsTransform from './arrow-functions'; diff --git a/docs/shared/recipes/generators/creating-files.md b/docs/shared/recipes/generators/creating-files.md index 01d9fe1f9507e..20a6680d358ae 100644 --- a/docs/shared/recipes/generators/creating-files.md +++ b/docs/shared/recipes/generators/creating-files.md @@ -40,8 +40,8 @@ import { generateFiles, joinPathFragments, readProjectConfiguration, -} from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { libraryGenerator } from '@nx/js'; export default async function (tree: Tree, schema: any) { await libraryGenerator(tree, { name: schema.name }); diff --git a/docs/shared/recipes/generators/generator-options.md b/docs/shared/recipes/generators/generator-options.md index 9b704f5f7721d..668e9e85b0147 100644 --- a/docs/shared/recipes/generators/generator-options.md +++ b/docs/shared/recipes/generators/generator-options.md @@ -14,8 +14,8 @@ export interface GeneratorOptions { Import the TypeScript schema into your generator file and replace the `any` in your generator function with the interface. ```typescript -import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/js'; +import { Tree, formatFiles, installPackagesTask } from '@nx/devkit'; +import { libraryGenerator } from '@nx/js'; export default async function (tree: Tree, schema: GeneratorOptions) { await libraryGenerator(tree, { name: `${schema.name}-${schema.type || ''}` }); diff --git a/docs/shared/recipes/generators/local-generators.md b/docs/shared/recipes/generators/local-generators.md index 22dbc676a542c..ffe2ba3511ce3 100644 --- a/docs/shared/recipes/generators/local-generators.md +++ b/docs/shared/recipes/generators/local-generators.md @@ -15,14 +15,14 @@ If you don't already have a local plugin, use Nx to generate one: ```shell # replace `latest` with the version that matches your Nx version -npm install @nrwl/nx-plugin@latest -nx g @nrwl/nx-plugin:plugin my-plugin +npm install @nx/plugin@latest +nx g @nx/plugin:plugin my-plugin ``` Use the Nx CLI to generate the initial files needed for your generator. ```shell -nx generate @nrwl/nx-plugin:generator my-generator --project=my-plugin +nx generate @nx/plugin:generator my-generator --project=my-plugin ``` After the command is finished, the generator is created in the plugin `generators` folder. @@ -50,8 +50,8 @@ The `schema.json` provides a description of the generator, available options, va The initial generator function creates a library. ```typescript -import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/js'; +import { Tree, formatFiles, installPackagesTask } from '@nx/devkit'; +import { libraryGenerator } from '@nx/js'; export default async function (tree: Tree, schema: any) { await libraryGenerator(tree, { name: schema.name }); @@ -64,7 +64,7 @@ export default async function (tree: Tree, schema: any) { To invoke other generators, import the entry point function and run it against the tree. `async/await` can be used to make code with Promises read like procedural code. The generator function may return a callback function that is executed after changes to the file system have been applied. -In the `schema.json` file for your generator, the `name` is provided as a default option. The `cli` property is set to `nx` to signal that this is a generator that uses `@nrwl/devkit` and not `@angular-devkit`. +In the `schema.json` file for your generator, the `name` is provided as a default option. The `cli` property is set to `nx` to signal that this is a generator that uses `@nx/devkit` and not `@angular-devkit`. ```json {% fileName="schema.json" %} { @@ -114,4 +114,4 @@ Nx uses the paths from `tsconfig.base.json` when running plugins locally, but us ## Generator Utilities -The [`@nrwl/devkit` package](/packages/devkit/documents/nrwl_devkit) provides many utility functions that can be used in generators to help with modifying files, reading and updating configuration files, and working with an Abstract Syntax Tree (AST). +The [`@nx/devkit` package](/packages/devkit/documents/nx_devkit) provides many utility functions that can be used in generators to help with modifying files, reading and updating configuration files, and working with an Abstract Syntax Tree (AST). diff --git a/docs/shared/recipes/generators/modifying-files.md b/docs/shared/recipes/generators/modifying-files.md index 9e611f75fb9b5..762f0bc4c61e2 100644 --- a/docs/shared/recipes/generators/modifying-files.md +++ b/docs/shared/recipes/generators/modifying-files.md @@ -13,7 +13,7 @@ JSON files are fairly simple to modify, given their predictable structure. The following example adds a `package.json` script that issues a friendly greeting. ```typescript -import { updateJson } from '@nrwl/devkit'; +import { updateJson } from '@nx/devkit'; export default async function (tree: Tree, schema: any) { updateJson(tree, 'package.json', (pkgJson) => { @@ -85,7 +85,7 @@ Second, we need to choose a selector to target this node. Just like with CSS sel The finished code looks like this: ```typescript -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import { TypeReferenceNode } from 'typescript'; diff --git a/docs/shared/recipes/module-federation-with-ssr.md b/docs/shared/recipes/module-federation-with-ssr.md index a71c63d97e6ce..d1e440965bb98 100644 --- a/docs/shared/recipes/module-federation-with-ssr.md +++ b/docs/shared/recipes/module-federation-with-ssr.md @@ -24,7 +24,7 @@ Run the following command with the options listed to create an empty workspace. {% tab label="Angular" %} -```{% command="npm install --save-dev @nrwl/angular" path="~/myorg" %} +```{% command="npm install --save-dev @nx/angular" path="~/myorg" %} ``` @@ -32,7 +32,7 @@ Run the following command with the options listed to create an empty workspace. {% tab label="React" %} -```{% command="npm install --save-dev @nrwl/react" path="~/myorg" %} +```{% command="npm install --save-dev @nx/react" path="~/myorg" %} ``` @@ -55,7 +55,7 @@ Nx allows you to do this with a single command: {% tab label="Angular" %} -```{% command="npx nx g @nrwl/angular:host store --ssr --remotes=product,checkout" path="~/myorg" %} +```{% command="npx nx g @nx/angular:host store --ssr --remotes=product,checkout" path="~/myorg" %} ``` @@ -63,7 +63,7 @@ Nx allows you to do this with a single command: {% tab label="React" %} -```{% command="npx nx g @nrwl/react:host store --ssr --remotes=product,checkout" path="~/myorg" %} +```{% command="npx nx g @nx/react:host store --ssr --remotes=product,checkout" path="~/myorg" %} ``` diff --git a/docs/shared/recipes/one-storybook-for-all.md b/docs/shared/recipes/one-storybook-for-all.md index e1624cf06f831..bb7c40154380a 100644 --- a/docs/shared/recipes/one-storybook-for-all.md +++ b/docs/shared/recipes/one-storybook-for-all.md @@ -16,17 +16,17 @@ Let’s see how we can implement this solution: According to the framework you are using, use the corresponding generator to generate a new library. Let’s suppose that you are using React and all your stories are using `@storybook/react`: ```shell -nx g @nrwl/react:library storybook-host +nx g @nx/react:library storybook-host ``` Now, you have a new library, which will act as a shell/host for all your stories. ### Configure the new library to use Storybook -Now let’s configure our new library to use Storybook, using the [`@nrwl/storybook:configuration` generator](/packages/storybook/generators/configuration). Run: +Now let’s configure our new library to use Storybook, using the [`@nx/storybook:configuration` generator](/packages/storybook/generators/configuration). Run: ```shell -nx g @nrwl/storybook:configuration storybook-host +nx g @nx/storybook:configuration storybook-host ``` and choose the framework you want to use (in our case, choose `@storybook/react`). @@ -43,7 +43,7 @@ Here is a sample `libs/storybook-host/.storybook/main.js` file: module.exports = { core: { builder: 'webpack5' }, stories: ['../../**/ui/**/src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'], - addons: ['@storybook/addon-essentials', '@nrwl/react/plugins/storybook'], + addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'], }; ``` diff --git a/docs/shared/recipes/one-storybook-per-scope.md b/docs/shared/recipes/one-storybook-per-scope.md index a95e1b2734f23..34cf3a5d23f83 100644 --- a/docs/shared/recipes/one-storybook-per-scope.md +++ b/docs/shared/recipes/one-storybook-per-scope.md @@ -87,9 +87,9 @@ Let's assume in this case that all our libraries are using Angular. Let's generate three Angular libraries, one for each scope, and let's call them `storybook-host-client`, `storybook-host-admin`, and `storybook-host-shared`. We can do this by running the following commands: ```shell -nx g @nrwl/angular:lib storybook-host-client -nx g @nrwl/angular:lib storybook-host-admin -nx g @nrwl/angular:lib storybook-host-shared +nx g @nx/angular:lib storybook-host-client +nx g @nx/angular:lib storybook-host-admin +nx g @nx/angular:lib storybook-host-shared ``` ### Generate the Storybook configuration for the libraries @@ -97,9 +97,9 @@ nx g @nrwl/angular:lib storybook-host-shared Now, we need to generate Storybook configuration for all these new libraries. We don't want to generate `stories` or a new Cypress project for these libraries, so we can run the following commands: ```shell -nx g @nrwl/storybook:configuration storybook-host-client --uiFramework=@storybook/angular -nx g @nrwl/storybook:configuration storybook-host-admin --uiFramework=@storybook/angular -nx g @nrwl/storybook:configuration storybook-host-shared --uiFramework=@storybook/angular +nx g @nx/storybook:configuration storybook-host-client --uiFramework=@storybook/angular +nx g @nx/storybook:configuration storybook-host-admin --uiFramework=@storybook/angular +nx g @nx/storybook:configuration storybook-host-shared --uiFramework=@storybook/angular ``` ### Import the stories diff --git a/docs/shared/recipes/one-storybook-with-composition.md b/docs/shared/recipes/one-storybook-with-composition.md index f2f3148749336..59f0ab70951fc 100644 --- a/docs/shared/recipes/one-storybook-with-composition.md +++ b/docs/shared/recipes/one-storybook-with-composition.md @@ -26,7 +26,7 @@ It does not matter which framework you use for the host Storybook library. It ca So, let’s use React for the Storybook Composition host library: ```shell -nx g @nrwl/react:lib storybook-host +nx g @nx/react:lib storybook-host ``` Now that your library is generated, you can write your intro in the generated component (you can also do this later, it does not matter). @@ -36,7 +36,7 @@ Now that your library is generated, you can write your intro in the generated co Since you do need a story for your host Storybook, you should use the React storybook configuration generator, and actually choose to generate stories (not an e2e project though): ```shell -nx g @nrwl/react:storybook-configuration –-name=storybook-host +nx g @nx/react:storybook-configuration –-name=storybook-host ``` And choose `yes` to generate stories, and `no` to generate a Cypress app. @@ -63,7 +63,7 @@ module.exports = { }, }, stories: ['../src/lib/**/*.stories.tsx'], - addons: ['@storybook/addon-essentials', '@nrwl/react/plugins/storybook'], + addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'], }; ``` diff --git a/docs/shared/recipes/plugins/compose-executors.md b/docs/shared/recipes/plugins/compose-executors.md index 3110773fd2798..449f11f54c499 100644 --- a/docs/shared/recipes/plugins/compose-executors.md +++ b/docs/shared/recipes/plugins/compose-executors.md @@ -20,7 +20,7 @@ This only works when you know what executor you want to invoke. Sometimes, howev ```json {% fileName="project.json" %} { "e2e": { - "builder": "@nrwl/cypress:cypress", + "builder": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/myapp-e2e/cypress.json", "tsConfig": "apps/myapp-e2e/tsconfig.e2e.json", @@ -69,7 +69,7 @@ The `runExecutor` utility will find the target in the configuration, find the ex | readTargetOptions | Reads and combines options for a given target | | runExecutor | Constructs options and invokes an executor | -See more helper functions in the [Devkit API Docs](/packages/devkit/documents/nrwl_devkit#functions) +See more helper functions in the [Devkit API Docs](/packages/devkit/documents/nx_devkit#functions) ## Using RxJS observables diff --git a/docs/shared/recipes/plugins/create-preset.md b/docs/shared/recipes/plugins/create-preset.md index 8187aed382585..b8ff727823c89 100644 --- a/docs/shared/recipes/plugins/create-preset.md +++ b/docs/shared/recipes/plugins/create-preset.md @@ -32,7 +32,7 @@ If you **don't** have an existing plugin you can create one by running To create our preset inside of our plugin we can run ```shell - nx generate @nrwl/nx-plugin:generator --name=preset --project=happynrwl + nx generate @nx/plugin:generator --name=preset --project=happynrwl ``` {% callout type="warning" title="Double check" %} diff --git a/docs/shared/recipes/plugins/local-executors.md b/docs/shared/recipes/plugins/local-executors.md index b43d6aea4fa44..66e8fdd4f86ec 100644 --- a/docs/shared/recipes/plugins/local-executors.md +++ b/docs/shared/recipes/plugins/local-executors.md @@ -10,14 +10,14 @@ If you don't already have a local plugin, use Nx to generate one: ```shell # replace `latest` with the version that matches your Nx version -npm install @nrwl/nx-plugin@latest -nx g @nrwl/nx-plugin:plugin my-plugin +npm install @nx/plugin@latest +nx g @nx/plugin:plugin my-plugin ``` Use the Nx CLI to generate the initial files needed for your executor. ```shell -nx generate @nrwl/nx-plugin:executor echo --project=my-plugin +nx generate @nx/plugin:executor echo --project=my-plugin ``` After the command is finished, the executor is created in the plugin `executors` folder. @@ -65,7 +65,7 @@ In our `executor.ts` file, we're creating an `Options` interface that matches th The `executor.ts` contains the actual code for your executor. Your executor's implementation must export a function that takes an options object and returns a `Promise<{ success: boolean }>`. ```typescript -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; import { exec } from 'child_process'; import { promisify } from 'util'; @@ -149,7 +149,7 @@ Part of the power of the executor API is the ability to compose executors via ex Here's an example of this (from a hypothetical project), that serves an api (project name: "api") in watch mode, then serves a frontend app (project name: "web-client") in watch mode: ```typescript -import { ExecutorContext, runExecutor } from '@nrwl/devkit'; +import { ExecutorContext, runExecutor } from '@nx/devkit'; export interface MultipleExecutorOptions {} @@ -185,7 +185,7 @@ For other ideas on how to create your own executors, you can always check out Nx For most executors, the default hashing in Nx makes sense. The output of the executor is dependent on the files in the project that it is being run for, or that project's dependencies, and nothing else. Changing a miscellaneous file at the workspace root will not affect that executor, and changing _*any*_ file inside of the project may affect the executor. When dealing with targets which only depend on a small subset of the files in a project, or may depend on arbitrary data that is not stored within the project, the default hasher may not make sense anymore. In these cases, the target will either experience more frequent cache misses than necessary or not be able to be cached. -Executors can provide a custom hasher that Nx uses when determining if a target run should be a cache hit, or if it must be run. When generating an executor for a plugin, you can use `nx g @nrwl/nx-plugin:executor my-executor --project my-plugin --includeHasher` to automatically add a custom hasher. +Executors can provide a custom hasher that Nx uses when determining if a target run should be a cache hit, or if it must be run. When generating an executor for a plugin, you can use `nx g @nx/plugin:executor my-executor --project my-plugin --includeHasher` to automatically add a custom hasher. If you want to add a custom hasher manually, create a new file beside your executor's implementation. We will use `hasher.ts` as an example here. You'll also need to update `executors.json`, so that it resembles something like this: @@ -204,7 +204,7 @@ If you want to add a custom hasher manually, create a new file beside your execu This would allow you to write a custom function in `hasher.ts`, which Nx would use to calculate the target's hash. As an example, consider the below hasher which mimics the behavior of Nx's default hashing algorithm. ```typescript -import { CustomHasher, Task, HasherContext } from '@nrwl/devkit'; +import { CustomHasher, Task, HasherContext } from '@nx/devkit'; export const mimicNxHasher: CustomHasher = async ( task: Task, @@ -219,7 +219,7 @@ export default mimicNxHasher; The hash function can do anything it wants, but it is important to remember that the hasher replaces the hashing done normally by Nx. If you change the hasher, Nx may return cache hits when you do not anticipate it. Imagine the below custom hasher: ```typescript -import { CustomHasher, Task, HasherContext } from '@nrwl/devkit'; +import { CustomHasher, Task, HasherContext } from '@nx/devkit'; export const badHasher: CustomHasher = async ( task: Task, diff --git a/docs/shared/recipes/plugins/migration-generators.md b/docs/shared/recipes/plugins/migration-generators.md index aa6fb5b04b685..ea523ec217711 100644 --- a/docs/shared/recipes/plugins/migration-generators.md +++ b/docs/shared/recipes/plugins/migration-generators.md @@ -11,7 +11,7 @@ For this example, we'll create a new migration generator that updates repos to u ### 1. Generate a migration ```shell -nx generate @nrwl/nx-plugin:migration 'Change Executor Name' --packageVersion=2.0.1 --project=pluginName --description='Changes the executor name from oldExecutorName to newExecutorName' +nx generate @nx/plugin:migration 'Change Executor Name' --packageVersion=2.0.1 --project=pluginName --description='Changes the executor name from oldExecutorName to newExecutorName' ``` This command will update the following files: @@ -42,7 +42,7 @@ And it creates a blank generator under: `libs/pluginName/src/migrations/change-e ### 2. Write the Generator Code ```ts {% fileName="change-executor-name.ts" %} -import { getProjects, Tree, updateProjectConfiguration } from '@nrwl/devkit'; +import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; export function changeExecutorNameToNewName(tree: Tree) { const projects = getProjects(tree); diff --git a/docs/shared/recipes/plugins/project-graph-plugins.md b/docs/shared/recipes/plugins/project-graph-plugins.md index 3c9da438834a4..d6c92608b84c0 100644 --- a/docs/shared/recipes/plugins/project-graph-plugins.md +++ b/docs/shared/recipes/plugins/project-graph-plugins.md @@ -45,7 +45,7 @@ import { ProjectGraphBuilder, ProjectGraphProcessorContext, DependencyType, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function processProjectGraph( graph: ProjectGraph, @@ -120,7 +120,7 @@ Dynamic dependencies are a special type of explicit dependencies. In contrast to A typical example would be lazy-loaded routes. Having separation between these two allows us to identify situations where static import breaks the lazy-loading. ```typescript -import { DependencyType } from '@nrwl/devkit'; +import { DependencyType } from '@nx/devkit'; // Add a new edge builder.addDynamicDependency( diff --git a/docs/shared/recipes/plugins/project-inference-plugins.md b/docs/shared/recipes/plugins/project-inference-plugins.md index 309aa493244ed..374ea5b99dba8 100644 --- a/docs/shared/recipes/plugins/project-inference-plugins.md +++ b/docs/shared/recipes/plugins/project-inference-plugins.md @@ -64,7 +64,7 @@ Plugins should export a function named `registerProjectTargets` that infers the The `registerProjectTargets` function should return a `Record`, which describes the targets inferred for that specific project file. ```typescript -import { TargetConfiguration } from '@nrwl/devkit'; +import { TargetConfiguration } from '@nx/devkit'; export const projectFilePatterns = ['project.json', 'my-other-project-file']; diff --git a/docs/shared/recipes/rescope.md b/docs/shared/recipes/rescope.md new file mode 100644 index 0000000000000..fddce9bb5ae4e --- /dev/null +++ b/docs/shared/recipes/rescope.md @@ -0,0 +1,59 @@ +# Rescope Packages from @nrwl to @nx + +As of version 16, all the official Nx plugins are moving from the `@nrwl` npm scope to `@nx`. The goal is for anyone looking through a list of dependencies to easily make the connection between the `nx` package and the `@nx` plugins that are associated with it. + +`@nrwl/*` packages are still provided and reexport the `@nx/*` packages so any third-party plugins should continue to work. + +## What Do You Need To Do? + +For new repos, run `npx create-nx-workspace` as usual. The correct packages will be added. + +For existing repos, run `nx migrate` as you normally would. When migrating to version 16 or higher, the package names will be automatically updated for you. If you have a local script, update it to use `@nx/*` packages. + +If you maintain a Nx plugin, please update it to use the `@nx/*` packages. + +> If you come across Nrwl in blog posts, videos, or elsewhere, that content is likely referring to these packages. Depending on when the content was published, it is likely still relevant. + +### Rename + +The packages are being renamed as defined in the tables below: + +The following packages were not simply rescoped `@nrwl` to `@nx`. + +| Nx 15 and lower | Nx 16 and higher | +| ---------------------- | ----------------- | +| @nrwl/nx-cloud | nx-cloud | +| @nrwl/eslint-plugin-nx | @nx/eslint-plugin | +| @nrwl/nx-plugin | @nx/plugin | + +### Rescope Only + +All other packages keep the same name, but change scope from `@nrwl` to `@nx`. + +| Nx 15 and lower | Nx 16 and higher | +| ------------------ | ---------------- | +| @nrwl/angular | @nx/angular | +| @nrwl/cypress | @nx/cypress | +| @nrwl/detox | @nx/detox | +| @nrwl/devkit | @nx/devkit | +| @nrwl/esbuild | @nx/esbuild | +| @nrwl/expo | @nx/expo | +| @nrwl/express | @nx/express | +| @nrwl/jest | @nx/jest | +| @nrwl/js | @nx/js | +| @nrwl/linter | @nx/linter | +| @nrwl/nest | @nx/nest | +| @nrwl/next | @nx/next | +| @nrwl/node | @nx/node | +| @nrwl/react | @nx/react | +| @nrwl/react-native | @nx/react-native | +| @nrwl/rollup | @nx/rollup | +| @nrwl/storybook | @nx/storybook | +| @nrwl/vite | @nx/vite | +| @nrwl/web | @nx/web | +| @nrwl/webpack | @nx/webpack | +| @nrwl/workspace | @nx/workspace | + +## @nrwl Scope End of Life + +Starting in version 18, the `@nrwl` scoped packages will no longer be published to npm. Only the `@nx` scoped packages will be available on the npm registry. diff --git a/docs/shared/recipes/set-up-a-new-workspace.md b/docs/shared/recipes/set-up-a-new-workspace.md index 8b637d09de412..985a0084e90e6 100644 --- a/docs/shared/recipes/set-up-a-new-workspace.md +++ b/docs/shared/recipes/set-up-a-new-workspace.md @@ -16,7 +16,7 @@ npx create-nx-workspace --preset=apps # create an empty workspace set up for building packages npx create-nx-workspace --preset=core -# create an empty workspace set up for building packages with the @nrwl/js plugin installed +# create an empty workspace set up for building packages with the @nx/js plugin installed npx create-nx-workspace --preset=ts ``` diff --git a/docs/shared/recipes/standalone-ngrx-apis.md b/docs/shared/recipes/standalone-ngrx-apis.md index 9781c0c07c093..e50bec27bb2e3 100644 --- a/docs/shared/recipes/standalone-ngrx-apis.md +++ b/docs/shared/recipes/standalone-ngrx-apis.md @@ -13,7 +13,7 @@ This guide will show you how to leverage this using the NgRx generator. {% callout type="check" title="Prerequisites" %} Before following along with this guide, ensure you have: -1. An Nx >= 15.6.0 Workspace with `@nrwl/angular` installed +1. An Nx >= 15.6.0 Workspace with `@nx/angular` installed 2. Angular 15 must be installed {% /callout %} @@ -23,7 +23,7 @@ Before following along with this guide, ensure you have: 1. Generate an Angular application with Standalone Components and routing ```bash -nx g @nrwl/angular:app testapp --standalone --routing +nx g @nx/angular:app testapp --standalone --routing ``` 2. Generate NgRx Root State @@ -32,14 +32,14 @@ nx g @nrwl/angular:app testapp --standalone --routing {% tab label="Nx Standalone Repo" %} ```bash -nx g @nrwl/angular:ngrx --root --parent=testapp/src/main.ts +nx g @nx/angular:ngrx --root --parent=testapp/src/main.ts ``` {% /tab %} {% tab label="Nx Integrated Monorepo" %} ```bash -nx g @nrwl/angular:ngrx --root --parent=apps/testapp/src/main.ts +nx g @nx/angular:ngrx --root --parent=apps/testapp/src/main.ts ``` {% /tab %} @@ -51,14 +51,14 @@ nx g @nrwl/angular:ngrx --root --parent=apps/testapp/src/main.ts {% tab label="Nx Standalone Repo" %} ```bash -nx g @nrwl/angular:ngrx users --parent=testapp/src/app/app.routes.ts +nx g @nx/angular:ngrx users --parent=testapp/src/app/app.routes.ts ``` {% /tab %} {% tab label="Nx Integrated Monorepo" %} ```bash -nx g @nrwl/angular:ngrx users --parent=apps/testapp/src/app/app.routes.ts +nx g @nx/angular:ngrx users --parent=apps/testapp/src/app/app.routes.ts ``` {% /tab %} diff --git a/docs/shared/recipes/use-executor-configurations.md b/docs/shared/recipes/use-executor-configurations.md index 928f9e58a73eb..4a2a56b27bcb2 100644 --- a/docs/shared/recipes/use-executor-configurations.md +++ b/docs/shared/recipes/use-executor-configurations.md @@ -5,7 +5,7 @@ The `configurations` property provides extra sets of values that will be merged ```json {% fileName="project.json" %} { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "outputs": ["{workspaceRoot}/dist/libs/mylib"], "dependsOn": ["^build"], "options": { @@ -27,7 +27,7 @@ or `nx run mylib:build:production`. The following code snippet shows how the executor options get constructed: ```javascript -require(`@nrwl/jest`).executors['jest']({ +require(`@nx/jest`).executors['jest']({ ...options, ...selectedConfiguration, ...commandLineArgs, @@ -45,7 +45,7 @@ For example, running e2e tests for multiple environments. By default it would ma ```json {% fileName="project.json" %} { "e2e": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/my-app-e2e/cypress.config.ts" }, diff --git a/docs/shared/reference/nx-json.md b/docs/shared/reference/nx-json.md index c5fab7f658aaf..c10d6de807363 100644 --- a/docs/shared/reference/nx-json.md +++ b/docs/shared/reference/nx-json.md @@ -34,7 +34,7 @@ The following is an expanded version showing all options. Your `nx.json` will li } }, "generators": { - "@nrwl/js:library": { + "@nx/js:library": { "buildable": true } }, @@ -166,7 +166,7 @@ When defining any options or configurations inside of a target default, you may ```json {% fileName="nx.json" %} { "targetDefaults": { - "@nrwl/js:tsc": { + "@nx/js:tsc": { "options": { "main": "{projectRoot}/src/index.ts" }, @@ -187,7 +187,7 @@ When defining any options or configurations inside of a target default, you may ``` {% callout type="note" title="Target Default Priority" %} -Note that the inputs and outputs are respecified on the @nrwl/js:tsc default configuration. This is **required**, as when reading target defaults Nx will only ever look at one key. If there is a default configuration based on the executor used, it will be read first. If not, Nx will fall back to looking at the configuration based on target name. For instance, running `nx build project` will read the options from `targetDefaults[@nrwl/js:tsc]` if the target configuration for build uses the @nrwl/js:tsc executor. It **would not** read any of the configuration from the `build` target default configuration unless the executor does not match. +Note that the inputs and outputs are respecified on the @nx/js:tsc default configuration. This is **required**, as when reading target defaults Nx will only ever look at one key. If there is a default configuration based on the executor used, it will be read first. If not, Nx will fall back to looking at the configuration based on target name. For instance, running `nx build project` will read the options from `targetDefaults[@nx/js:tsc]` if the target configuration for build uses the @nx/js:tsc executor. It **would not** read any of the configuration from the `build` target default configuration unless the executor does not match. {% /callout %} ### Generators @@ -198,7 +198,7 @@ pass `--buildable=true` when creating new libraries. ```json {% fileName="nx.json" %} { "generators": { - "@nrwl/js:library": { + "@nx/js:library": { "buildable": true } } diff --git a/docs/shared/reference/project-configuration.md b/docs/shared/reference/project-configuration.md index 6921290657b58..3a66789833dec 100644 --- a/docs/shared/reference/project-configuration.md +++ b/docs/shared/reference/project-configuration.md @@ -27,13 +27,13 @@ The following configuration creates `build` and `test` targets for Nx. "root": "libs/mylib/", "targets": { "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { /* ... */ } }, "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "options": { /* ... */ } @@ -96,14 +96,14 @@ You can add Nx-specific configuration as follows: }, "targets": { "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "inputs": ["default", "^production"], "outputs": [], "dependsOn": ["build"], "options": {} }, "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "inputs": ["production", "^production"], "outputs": ["{workspaceRoot}/dist/libs/mylib"], "dependsOn": ["^build"], diff --git a/docs/shared/workspace/grouping-libraries.md b/docs/shared/workspace/grouping-libraries.md index a9f7916917cfe..2040c1d659be6 100644 --- a/docs/shared/workspace/grouping-libraries.md +++ b/docs/shared/workspace/grouping-libraries.md @@ -4,7 +4,7 @@ Libraries should be grouped by _scope_. A library's scope is either application ## Move Generator -Don't be too anxious about choosing the exact right folder structure from the beginning. Libraries can be moved or renamed using the [`@nrwl/workspace:move` generator](/packages/workspace/generators/move). +Don't be too anxious about choosing the exact right folder structure from the beginning. Libraries can be moved or renamed using the [`@nx/workspace:move` generator](/packages/workspace/generators/move). For instance, if a library under the `booking` folder is now being shared by multiple apps, you can move it to the shared folder like this: @@ -13,12 +13,12 @@ nx g move --project booking-some-library shared/some-library ``` {% callout type="note" title="Angular" %} -For Angular projects, you should use the [`@nrwl/angular:move` generator](/packages/angular/generators/move) instead. +For Angular projects, you should use the [`@nx/angular:move` generator](/packages/angular/generators/move) instead. {% /callout %} ## Remove Generator -Similarly, if you no longer need a library, you can remove it with the [`@nrwl/workspace:remove` generator](/packages/workspace/generators/remove). +Similarly, if you no longer need a library, you can remove it with the [`@nx/workspace:remove` generator](/packages/workspace/generators/remove). ```shell nx g remove booking-some-library 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 2cce8a3bc3713..fd54218f54498 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx @@ -125,6 +125,13 @@ export function Content({ > {schemaViewModel.type} + + Rescope @nrwl to @nx + {schemaViewModel.deprecated && ( + + Rescope @nrwl to @nx +
{ path: '/storybook/storybook-composition-setup', }, { - title: 'Module: @nrwl/devkit', + title: 'Module: @nx/devkit', path: '/devkit/index', }, { diff --git a/nx-dev/nx-dev-e2e/src/e2e/packages.cy.ts b/nx-dev/nx-dev-e2e/src/e2e/packages.cy.ts index b9d1240803517..010e17bc421f1 100644 --- a/nx-dev/nx-dev-e2e/src/e2e/packages.cy.ts +++ b/nx-dev/nx-dev-e2e/src/e2e/packages.cy.ts @@ -6,94 +6,94 @@ import { assertTextOnPage } from './helpers'; */ describe('nx-dev: Packages Section', () => { (<{ title: string; path: string }[]>[ - { title: '@nrwl/angular', path: '/packages/angular' }, + { title: '@nx/angular', path: '/packages/angular' }, { - title: '@nrwl/angular:add-linting', + title: '@nx/angular:add-linting', path: '/packages/angular/generators/add-linting', }, { - title: '@nrwl/angular:application', + title: '@nx/angular:application', path: '/packages/angular/generators/application', }, { - title: '@nrwl/angular:component', + title: '@nx/angular:component', path: '/packages/angular/generators/component', }, { - title: '@nrwl/angular:component-cypress-spec', + title: '@nx/angular:component-cypress-spec', path: '/packages/angular/generators/component-cypress-spec', }, { - title: '@nrwl/angular:component-story', + title: '@nx/angular:component-story', path: '/packages/angular/generators/component-story', }, { - title: '@nrwl/angular:convert-tslint-to-eslint', + title: '@nx/angular:convert-tslint-to-eslint', path: '/packages/angular/generators/convert-tslint-to-eslint', }, - { title: '@nrwl/angular:init', path: '/packages/angular/generators/init' }, + { title: '@nx/angular:init', path: '/packages/angular/generators/init' }, { - title: '@nrwl/angular:library', + title: '@nx/angular:library', path: '/packages/angular/generators/library', }, { - title: '@nrwl/angular:library-secondary-entry-point', + title: '@nx/angular:library-secondary-entry-point', path: '/packages/angular/generators/library-secondary-entry-point', }, { - title: '@nrwl/angular:remote', + title: '@nx/angular:remote', path: '/packages/angular/generators/remote', }, - { title: '@nrwl/angular:move', path: '/packages/angular/generators/move' }, + { title: '@nx/angular:move', path: '/packages/angular/generators/move' }, { - title: '@nrwl/angular:convert-to-with-mf', + title: '@nx/angular:convert-to-with-mf', path: '/packages/angular/generators/convert-to-with-mf', }, - { title: '@nrwl/angular:host', path: '/packages/angular/generators/host' }, + { title: '@nx/angular:host', path: '/packages/angular/generators/host' }, { - title: '@nrwl/angular:ng-add', + title: '@nx/angular:ng-add', path: '/packages/angular/generators/ng-add', }, - { title: '@nrwl/angular:ngrx', path: '/packages/angular/generators/ngrx' }, - { title: '@nrwl/angular:scam', path: '/packages/angular/generators/scam' }, + { title: '@nx/angular:ngrx', path: '/packages/angular/generators/ngrx' }, + { title: '@nx/angular:scam', path: '/packages/angular/generators/scam' }, { - title: '@nrwl/angular:scam-directive', + title: '@nx/angular:scam-directive', path: '/packages/angular/generators/scam-directive', }, { - title: '@nrwl/angular:scam-pipe', + title: '@nx/angular:scam-pipe', path: '/packages/angular/generators/scam-pipe', }, { - title: '@nrwl/angular:setup-mf', + title: '@nx/angular:setup-mf', path: '/packages/angular/generators/setup-mf', }, { - title: '@nrwl/angular:setup-tailwind', + title: '@nx/angular:setup-tailwind', path: '/packages/angular/generators/setup-tailwind', }, { - title: '@nrwl/angular:stories', + title: '@nx/angular:stories', path: '/packages/angular/generators/stories', }, { - title: '@nrwl/', + title: '@nx/', path: '/packages/angular/generators/storybook-configuration', }, { - title: '@nrwl/angular:web-worker', + title: '@nx/angular:web-worker', path: '/packages/angular/generators/web-worker', }, { - title: '@nrwl/angular:delegate-build', + title: '@nx/angular:delegate-build', path: '/packages/angular/executors/delegate-build', }, { - title: '@nrwl/angular:ng-packagr-lite', + title: '@nx/angular:ng-packagr-lite', path: '/packages/angular/executors/ng-packagr-lite', }, { - title: '@nrwl/angular:package', + title: '@nx/angular:package', path: '/packages/angular/executors/package', }, { title: 'create-nx-plugin', path: '/packages/create-nx-plugin' }, @@ -101,165 +101,165 @@ describe('nx-dev: Packages Section', () => { title: 'create-nx-workspace', path: '/packages/create-nx-workspace', }, - { title: '@nrwl/cypress', path: '/packages/cypress' }, - { title: '@nrwl/cypress:init', path: '/packages/cypress/generators/init' }, + { title: '@nx/cypress', path: '/packages/cypress' }, + { title: '@nx/cypress:init', path: '/packages/cypress/generators/init' }, { - title: '@nrwl/cypress:cypress-project', + title: '@nx/cypress:cypress-project', path: '/packages/cypress/generators/cypress-project', }, { - title: '@nrwl/cypress:cypress', + title: '@nx/cypress:cypress', path: '/packages/cypress/executors/cypress', }, - { title: '@nrwl/detox', path: '/packages/detox' }, - { title: '@nrwl/detox:init', path: '/packages/detox/generators/init' }, + { title: '@nx/detox', path: '/packages/detox' }, + { title: '@nx/detox:init', path: '/packages/detox/generators/init' }, { - title: '@nrwl/detox:application', + title: '@nx/detox:application', path: '/packages/detox/generators/application', }, - { title: '@nrwl/detox:build', path: '/packages/detox/executors/build' }, - { title: '@nrwl/detox:test', path: '/packages/detox/executors/test' }, - { title: '@nrwl/devkit', path: '/packages/devkit' }, - { title: '@nrwl/esbuild', path: '/packages/esbuild' }, + { title: '@nx/detox:build', path: '/packages/detox/executors/build' }, + { title: '@nx/detox:test', path: '/packages/detox/executors/test' }, + { title: '@nx/devkit', path: '/packages/devkit' }, + { title: '@nx/esbuild', path: '/packages/esbuild' }, { - title: '@nrwl/esbuild:esbuild', + title: '@nx/esbuild:esbuild', path: '/packages/esbuild/executors/esbuild', }, - { title: '@nrwl/eslint-plugin', path: '/packages/eslint-plugin' }, - { title: '@nrwl/expo', path: '/packages/expo' }, + { title: '@nx/eslint-plugin', path: '/packages/eslint-plugin' }, + { title: '@nx/expo', path: '/packages/expo' }, { - title: '@nrwl/expo:init', + title: '@nx/expo:init', path: '/packages/expo/generators/init', }, { - title: '@nrwl/expo:application', + title: '@nx/expo:application', path: '/packages/expo/generators/application', }, { - title: '@nrwl/expo:library', + title: '@nx/expo:library', path: '/packages/expo/generators/library', }, { - title: '@nrwl/expo:component', + title: '@nx/expo:component', path: '/packages/expo/generators/component', }, { - title: '@nrwl/expo:start', + title: '@nx/expo:start', path: '/packages/expo/executors/start', }, { - title: '@nrwl/expo:sync-deps', + title: '@nx/expo:sync-deps', path: '/packages/expo/executors/sync-deps', }, { - title: '@nrwl/expo:ensure-symlink', + title: '@nx/expo:ensure-symlink', path: '/packages/expo/executors/ensure-symlink', }, - { title: '@nrwl/express', path: '/packages/express' }, - { title: '@nrwl/express:init', path: '/packages/express/generators/init' }, + { title: '@nx/express', path: '/packages/express' }, + { title: '@nx/express:init', path: '/packages/express/generators/init' }, { - title: '@nrwl/express:application', + title: '@nx/express:application', path: '/packages/express/generators/application', }, - { title: '@nrwl/jest', path: '/packages/jest' }, - { title: '@nrwl/jest:init', path: '/packages/jest/generators/init' }, + { title: '@nx/jest', path: '/packages/jest' }, + { title: '@nx/jest:init', path: '/packages/jest/generators/init' }, { - title: '@nrwl/jest:jest-project', + title: '@nx/jest:jest-project', path: '/packages/jest/generators/jest-project', }, - { title: '@nrwl/jest', path: '/packages/jest/executors/jest' }, - { title: '@nrwl/js', path: '/packages/js' }, - { title: '@nrwl/js:library', path: '/packages/js/generators/library' }, - { title: '@nrwl/js:init', path: '/packages/js/generators/init' }, + { title: '@nx/jest', path: '/packages/jest/executors/jest' }, + { title: '@nx/js', path: '/packages/js' }, + { title: '@nx/js:library', path: '/packages/js/generators/library' }, + { title: '@nx/js:init', path: '/packages/js/generators/init' }, { - title: '@nrwl/js:convert-to-swc', + title: '@nx/js:convert-to-swc', path: '/packages/js/generators/convert-to-swc', }, - { title: '@nrwl/js:tsc', path: '/packages/js/executors/tsc' }, - { title: '@nrwl/js:swc', path: '/packages/js/executors/swc' }, - { title: '@nrwl/linter', path: '/packages/linter' }, + { title: '@nx/js:tsc', path: '/packages/js/executors/tsc' }, + { title: '@nx/js:swc', path: '/packages/js/executors/swc' }, + { title: '@nx/linter', path: '/packages/linter' }, { - title: '@nrwl/linter:workspace-rules-project', + title: '@nx/linter:workspace-rules-project', path: '/packages/linter/generators/workspace-rules-project', }, { - title: '@nrwl/linter', + title: '@nx/linter', path: '/packages/linter/generators/workspace-rule', }, - { title: '@nrwl/linter', path: '/packages/linter/executors/eslint' }, - { title: '@nrwl/nest', path: '/packages/nest' }, + { title: '@nx/linter', path: '/packages/linter/executors/eslint' }, + { title: '@nx/nest', path: '/packages/nest' }, { - title: '@nrwl/nest:application', + title: '@nx/nest:application', path: '/packages/nest/generators/application', }, { - title: '@nrwl/nest:convert-tslint-to-eslint', + title: '@nx/nest:convert-tslint-to-eslint', path: '/packages/nest/generators/convert-tslint-to-eslint', }, - { title: '@nrwl/nest:init', path: '/packages/nest/generators/init' }, - { title: '@nrwl/nest:library', path: '/packages/nest/generators/library' }, - { title: '@nrwl/nest:class', path: '/packages/nest/generators/class' }, + { title: '@nx/nest:init', path: '/packages/nest/generators/init' }, + { title: '@nx/nest:library', path: '/packages/nest/generators/library' }, + { title: '@nx/nest:class', path: '/packages/nest/generators/class' }, { - title: '@nrwl/nest:controller', + title: '@nx/nest:controller', path: '/packages/nest/generators/controller', }, { - title: '@nrwl/nest:decorator', + title: '@nx/nest:decorator', path: '/packages/nest/generators/decorator', }, - { title: '@nrwl/nest:filter', path: '/packages/nest/generators/filter' }, - { title: '@nrwl/nest:gateway', path: '/packages/nest/generators/gateway' }, - { title: '@nrwl/nest:guard', path: '/packages/nest/generators/guard' }, + { title: '@nx/nest:filter', path: '/packages/nest/generators/filter' }, + { title: '@nx/nest:gateway', path: '/packages/nest/generators/gateway' }, + { title: '@nx/nest:guard', path: '/packages/nest/generators/guard' }, { - title: '@nrwl/nest:interceptor', + title: '@nx/nest:interceptor', path: '/packages/nest/generators/interceptor', }, { - title: '@nrwl/nest:interface', + title: '@nx/nest:interface', path: '/packages/nest/generators/interface', }, { - title: '@nrwl/nest:middleware', + title: '@nx/nest:middleware', path: '/packages/nest/generators/middleware', }, - { title: '@nrwl/nest:module', path: '/packages/nest/generators/module' }, - { title: '@nrwl/nest:pipe', path: '/packages/nest/generators/pipe' }, + { title: '@nx/nest:module', path: '/packages/nest/generators/module' }, + { title: '@nx/nest:pipe', path: '/packages/nest/generators/pipe' }, { - title: '@nrwl/nest:provider', + title: '@nx/nest:provider', path: '/packages/nest/generators/provider', }, { - title: '@nrwl/nest:resolver', + title: '@nx/nest:resolver', path: '/packages/nest/generators/resolver', }, { - title: '@nrwl/nest:resource', + title: '@nx/nest:resource', path: '/packages/nest/generators/resource', }, - { title: '@nrwl/nest:service', path: '/packages/nest/generators/service' }, - { title: '@nrwl/next', path: '/packages/next' }, - { title: '@nrwl/next:init', path: '/packages/next/generators/init' }, + { title: '@nx/nest:service', path: '/packages/nest/generators/service' }, + { title: '@nx/next', path: '/packages/next' }, + { title: '@nx/next:init', path: '/packages/next/generators/init' }, { - title: '@nrwl/next:application', + title: '@nx/next:application', path: '/packages/next/generators/application', }, - { title: '@nrwl/next:page', path: '/packages/next/generators/page' }, + { title: '@nx/next:page', path: '/packages/next/generators/page' }, { - title: '@nrwl/next:component', + title: '@nx/next:component', path: '/packages/next/generators/component', }, - { title: '@nrwl/next:library', path: '/packages/next/generators/library' }, - { title: '@nrwl/next:build', path: '/packages/next/executors/build' }, - { title: '@nrwl/next:server', path: '/packages/next/executors/server' }, - { title: '@nrwl/next:export', path: '/packages/next/executors/export' }, - { title: '@nrwl/node', path: '/packages/node' }, - { title: '@nrwl/node:init', path: '/packages/node/generators/init' }, + { title: '@nx/next:library', path: '/packages/next/generators/library' }, + { title: '@nx/next:build', path: '/packages/next/executors/build' }, + { title: '@nx/next:server', path: '/packages/next/executors/server' }, + { title: '@nx/next:export', path: '/packages/next/executors/export' }, + { title: '@nx/node', path: '/packages/node' }, + { title: '@nx/node:init', path: '/packages/node/generators/init' }, { - title: '@nrwl/node:application', + title: '@nx/node:application', path: '/packages/node/generators/application', }, - { title: '@nrwl/node:library', path: '/packages/node/generators/library' }, - { title: '@nrwl/node:node', path: '/packages/node/executors/node' }, + { title: '@nx/node:library', path: '/packages/node/generators/library' }, + { title: '@nx/node:node', path: '/packages/node/executors/node' }, { title: 'nx', path: '/packages/nx' }, { title: 'nx:noop', path: '/packages/nx/executors/noop' }, { @@ -267,201 +267,209 @@ describe('nx-dev: Packages Section', () => { path: '/packages/nx/executors/run-commands', }, { title: 'nx:run-script', path: '/packages/nx/executors/run-script' }, - { title: 'nx-plugin', path: '/packages/plugin' }, + { title: 'plugin', path: '/packages/plugin' }, { - title: '@nrwl/nx-plugin:plugin', + title: '@nx/plugin:plugin', path: '/packages/plugin/generators/plugin', }, { - title: '@nrwl/nx-plugin:e2e-project', + title: '@nx/plugin:e2e-project', path: '/packages/plugin/generators/e2e-project', }, { - title: '@nrwl/nx-plugin:migration', + title: '@nx/plugin:migration', path: '/packages/plugin/generators/migration', }, { - title: '@nrwl/nx-plugin:generator', + title: '@nx/plugin:generator', path: '/packages/plugin/generators/generator', }, { - title: '@nrwl/nx-plugin:executor', + title: '@nx/plugin:executor', path: '/packages/plugin/generators/executor', }, - { title: '@nrwl/nx-plugin:e2e', path: '/packages/plugin/executors/e2e' }, - { title: '@nrwl/react', path: '/packages/react' }, - { title: '@nrwl/react:init', path: '/packages/react/generators/init' }, + { title: '@nx/plugin:e2e', path: '/packages/plugin/executors/e2e' }, + { title: '@nx/react', path: '/packages/react' }, + { title: '@nx/react:init', path: '/packages/react/generators/init' }, { - title: '@nrwl/react:application', + title: '@nx/react:application', path: '/packages/react/generators/application', }, { - title: '@nrwl/react:library', + title: '@nx/react:library', path: '/packages/react/generators/library', }, { - title: '@nrwl/react:component', + title: '@nx/react:component', path: '/packages/react/generators/component', }, - { title: '@nrwl/react:redux', path: '/packages/react/generators/redux' }, + { title: '@nx/react:redux', path: '/packages/react/generators/redux' }, { - title: '@nrwl/react:storybook-configuration', + title: '@nx/react:storybook-configuration', path: '/packages/react/generators/storybook-configuration', }, { - title: '@nrwl/react:component-story', + title: '@nx/react:component-story', path: '/packages/react/generators/component-story', }, { - title: '@nrwl/react:stories', + title: '@nx/react:stories', path: '/packages/react/generators/stories', }, { - title: '@nrwl/react:component-cypress-spec', + title: '@nx/react:component-cypress-spec', path: '/packages/react/generators/component-cypress-spec', }, - { title: '@nrwl/react:hook', path: '/packages/react/generators/hook' }, - { title: '@nrwl/react:host', path: '/packages/react/generators/host' }, - { title: '@nrwl/react:remote', path: '/packages/react/generators/remote' }, + { title: '@nx/react:hook', path: '/packages/react/generators/hook' }, + { title: '@nx/react:host', path: '/packages/react/generators/host' }, + { title: '@nx/react:remote', path: '/packages/react/generators/remote' }, { - title: '@nrwl/react:module-federation-dev-server', + title: '@nx/react:module-federation-dev-server', path: '/packages/react/executors/module-federation-dev-server', }, - { title: '@nrwl/react-native', path: '/packages/react-native' }, + { title: '@nx/react-native', path: '/packages/react-native' }, { - title: '@nrwl/react-native:init', + title: '@nx/react-native:init', path: '/packages/react-native/generators/init', }, { - title: '@nrwl/react-native:application', + title: '@nx/react-native:application', path: '/packages/react-native/generators/application', }, { - title: '@nrwl/react-native:library', + title: '@nx/react-native:library', path: '/packages/react-native/generators/library', }, { - title: '@nrwl/react-native:component', + title: '@nx/react-native:component', path: '/packages/react-native/generators/component', }, { - title: '@nrwl/', + title: '@nx/', path: '/packages/react-native/generators/storybook-configuration', }, { - title: '@nrwl/react-native:component-story', + title: '@nx/react-native:component-story', path: '/packages/react-native/generators/component-story', }, { - title: '@nrwl/react-native:stories', + title: '@nx/react-native:stories', path: '/packages/react-native/generators/stories', }, { - title: '@nrwl/react-native:upgrade-native', + title: '@nx/react-native:upgrade-native', path: '/packages/react-native/generators/upgrade-native', }, { - title: '@nrwl/react-native:run-android', + title: '@nx/react-native:run-android', path: '/packages/react-native/executors/run-android', }, { - title: '@nrwl/react-native:run-ios', + title: '@nx/react-native:run-ios', path: '/packages/react-native/executors/run-ios', }, { - title: '@nrwl/react-native:bundle', + title: '@nx/react-native:bundle', path: '/packages/react-native/executors/bundle', }, { - title: '@nrwl/react-native:build-android', + title: '@nx/react-native:build-android', path: '/packages/react-native/executors/build-android', }, { - title: '@nrwl/react-native:start', + title: '@nx/react-native:start', path: '/packages/react-native/executors/start', }, { - title: '@nrwl/react-native:sync-deps', + title: '@nx/react-native:sync-deps', path: '/packages/react-native/executors/sync-deps', }, { - title: '@nrwl/react-native:ensure-symlink', + title: '@nx/react-native:ensure-symlink', path: '/packages/react-native/executors/ensure-symlink', }, { - title: '@nrwl/react-native:storybook', + title: '@nx/react-native:storybook', path: '/packages/react-native/executors/storybook', }, - { title: '@nrwl/storybook', path: '/packages/storybook' }, + { title: '@nx/storybook', path: '/packages/storybook' }, { - title: '@nrwl/storybook:init', + title: '@nx/storybook:init', path: '/packages/storybook/generators/init', }, { - title: '@nrwl/storybook:configuration', + title: '@nx/storybook:configuration', path: '/packages/storybook/generators/configuration', }, { - title: '@nrwl/storybook:cypress-project', + title: '@nx/storybook:cypress-project', path: '/packages/storybook/generators/cypress-project', }, { - title: '@nrwl/storybook:storybook', + title: '@nx/storybook:storybook', path: '/packages/storybook/executors/storybook', }, { - title: '@nrwl/storybook:build', + title: '@nx/storybook:build', path: '/packages/storybook/executors/build', }, - { title: '@nrwl/tao', path: '/packages/tao' }, - { title: '@nrwl/web', path: '/packages/web' }, - { title: '@nrwl/web:init', path: '/packages/web/generators/init' }, + { title: '@nx/web', path: '/packages/web' }, + { title: '@nx/web:init', path: '/packages/web/generators/init' }, { - title: '@nrwl/web:application', + title: '@nx/web:application', path: '/packages/web/generators/application', }, { - title: '@nrwl/web:file-server', + title: '@nx/webpack:webpack', + path: '/packages/webpack/executors/webpack', + }, + { title: '@nx/rollup:rollup', path: '/packages/rollup/executors/rollup' }, + { + title: '@nx/webpack:dev-server', + path: '/packages/webpack/executors/dev-server', + }, + { + title: '@nx/web:file-server', path: '/packages/web/executors/file-server', }, { - title: '@nrwl/workspace:preset', + title: '@nx/workspace:preset', path: '/packages/workspace/generators/preset', }, { - title: '@nrwl/workspace:move', + title: '@nx/workspace:move', path: '/packages/workspace/generators/move', }, { - title: '@nrwl/workspace:remove', + title: '@nx/workspace:remove', path: '/packages/workspace/generators/remove', }, { - title: '@nrwl/workspace:new', + title: '@nx/workspace:new', path: '/packages/workspace/generators/new', }, { - title: '@nrwl/workspace:workspace-generator', + title: '@nx/workspace:workspace-generator', path: '/packages/workspace/generators/workspace-generator', }, { - title: '@nrwl/workspace:run-command', + title: '@nx/workspace:run-command', path: '/packages/workspace/generators/run-commands', }, { - title: '@nrwl/workspace:fix-configuration', + title: '@nx/workspace:fix-configuration', path: '/packages/workspace/generators/fix-configuration', }, { - title: '@nrwl/workspace:npm-package', + title: '@nx/workspace:npm-package', path: '/packages/workspace/generators/npm-package', }, { - title: '@nrwl/workspace:ci-workflow', + title: '@nx/workspace:ci-workflow', path: '/packages/workspace/generators/ci-workflow', }, { - title: '@nrwl/workspace:counter', + title: '@nx/workspace:counter', path: '/packages/workspace/executors/counter', }, ]).forEach((page) => assertTextOnPage(page.path, page.title)); diff --git a/nx-dev/nx-dev/pages/packages/index.tsx b/nx-dev/nx-dev/pages/packages/index.tsx index 7b19ba22927b4..7acc24a582544 100644 --- a/nx-dev/nx-dev/pages/packages/index.tsx +++ b/nx-dev/nx-dev/pages/packages/index.tsx @@ -106,6 +106,15 @@ export default function Packages({
+
+

+ In version 16, we have rescoped our packages to{' '} + @nx/* from @nrwl/*.{' '} + + Read more about the rescope ≫ + +

+
); diff --git a/nx-dev/ui-markdoc/src/lib/nodes/fences/codeOutput.component.tsx b/nx-dev/ui-markdoc/src/lib/nodes/fences/codeOutput.component.tsx index 8cd61b25dabec..f99de0cc35c7e 100644 --- a/nx-dev/ui-markdoc/src/lib/nodes/fences/codeOutput.component.tsx +++ b/nx-dev/ui-markdoc/src/lib/nodes/fences/codeOutput.component.tsx @@ -3,12 +3,19 @@ import { ReactNode } from 'react'; export function CodeOutput({ content, fileName, + isMessageBelow, }: { content: ReactNode; fileName: string; + isMessageBelow: boolean; }): JSX.Element { return ( -
+
{!!fileName && (
{fileName} diff --git a/nx-dev/ui-markdoc/src/lib/nodes/fences/terminal-output.component.tsx b/nx-dev/ui-markdoc/src/lib/nodes/fences/terminal-output.component.tsx index be960b8016407..12ad78761f6b5 100644 --- a/nx-dev/ui-markdoc/src/lib/nodes/fences/terminal-output.component.tsx +++ b/nx-dev/ui-markdoc/src/lib/nodes/fences/terminal-output.component.tsx @@ -3,14 +3,21 @@ import { ReactNode } from 'react'; export function TerminalOutput({ content, command, + isMessageBelow, path, }: { content: ReactNode; command: string; + isMessageBelow: boolean; path: string; }): JSX.Element { return ( -
+
diff --git a/packages-legacy/angular/README.md b/packages-legacy/angular/README.md index e26a77d7e4358..e83d980d4837a 100644 --- a/packages-legacy/angular/README.md +++ b/packages-legacy/angular/README.md @@ -1,8 +1,8 @@ -## @nrwl/angular has been deprecated! +## @nx/angular has been deprecated! -@nrwl/angular has been deprecated in favor of [@nx/angular](https://www.npmjs.com/package/@nx/angular). Please use that instead. +@nx/angular has been deprecated in favor of [@nx/angular](https://www.npmjs.com/package/@nx/angular). Please use that instead. -@nrwl/angular will no longer be published in Nx v17. +@nx/angular will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/cypress/README.md b/packages-legacy/cypress/README.md index dc0547750ad48..475fd188795f0 100644 --- a/packages-legacy/cypress/README.md +++ b/packages-legacy/cypress/README.md @@ -1,8 +1,8 @@ -## @nrwl/cypress has been deprecated! +## @nx/cypress has been deprecated! -@nrwl/cypress has been deprecated in favor of [@nx/cypress](https://www.npmjs.com/package/@nx/cypress). Please use that instead. +@nx/cypress has been deprecated in favor of [@nx/cypress](https://www.npmjs.com/package/@nx/cypress). Please use that instead. -@nrwl/cypress will no longer be published in Nx v17. +@nx/cypress will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/detox/README.md b/packages-legacy/detox/README.md index cb8212aec6f65..2fd4a0cb1d5d3 100644 --- a/packages-legacy/detox/README.md +++ b/packages-legacy/detox/README.md @@ -1,8 +1,8 @@ -## @nrwl/detox has been deprecated! +## @nx/detox has been deprecated! -@nrwl/detox has been deprecated in favor of [@nx/detox](https://www.npmjs.com/package/@nx/detox). Please use that instead. +@nx/detox has been deprecated in favor of [@nx/detox](https://www.npmjs.com/package/@nx/detox). Please use that instead. -@nrwl/detox will no longer be published in Nx v17. +@nx/detox will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/devkit/README.md b/packages-legacy/devkit/README.md index 3bf2729601264..be608bc9edb7f 100644 --- a/packages-legacy/devkit/README.md +++ b/packages-legacy/devkit/README.md @@ -1,8 +1,8 @@ -## @nrwl/devkit has been deprecated! +## @nx/devkit has been deprecated! -@nrwl/devkit has been deprecated in favor of [@nx/devkit](https://www.npmjs.com/package/@nx/devkit). Please use that instead. +@nx/devkit has been deprecated in favor of [@nx/devkit](https://www.npmjs.com/package/@nx/devkit). Please use that instead. -@nrwl/devkit will no longer be published in Nx v17. +@nx/devkit will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/esbuild/README.md b/packages-legacy/esbuild/README.md index 051007d6d736f..a4b986590bf07 100644 --- a/packages-legacy/esbuild/README.md +++ b/packages-legacy/esbuild/README.md @@ -1,8 +1,8 @@ -## @nrwl/esbuild has been deprecated! +## @nx/esbuild has been deprecated! -@nrwl/esbuild has been deprecated in favor of [@nx/esbuild](https://www.npmjs.com/package/@nx/esbuild). Please use that instead. +@nx/esbuild has been deprecated in favor of [@nx/esbuild](https://www.npmjs.com/package/@nx/esbuild). Please use that instead. -@nrwl/esbuild will no longer be published in Nx v17. +@nx/esbuild will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/eslint-plugin-nx/README.md b/packages-legacy/eslint-plugin-nx/README.md index f4a4f16bd0ddd..b336b5cf2492c 100644 --- a/packages-legacy/eslint-plugin-nx/README.md +++ b/packages-legacy/eslint-plugin-nx/README.md @@ -1,4 +1,4 @@ -## @nrwl/eslint-plugin-nx has been deprecated! +## @nx/eslint-plugin-nx has been deprecated! @nrwl/eslint-plugin-nx has been deprecated in favor of [@nx/eslint-plugin](https://www.npmjs.com/package/@nx/eslint-plugin). Please use that instead. diff --git a/packages-legacy/expo/README.md b/packages-legacy/expo/README.md index ede96f496cc17..ffd08cfee9cbc 100644 --- a/packages-legacy/expo/README.md +++ b/packages-legacy/expo/README.md @@ -1,8 +1,8 @@ -## @nrwl/expo has been deprecated! +## @nx/expo has been deprecated! -@nrwl/expo has been deprecated in favor of [@nx/expo](https://www.npmjs.com/package/@nx/expo). Please use that instead. +@nx/expo has been deprecated in favor of [@nx/expo](https://www.npmjs.com/package/@nx/expo). Please use that instead. -@nrwl/expo will no longer be published in Nx v17. +@nx/expo will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/express/README.md b/packages-legacy/express/README.md index 54021dce091e5..c1409b9058881 100644 --- a/packages-legacy/express/README.md +++ b/packages-legacy/express/README.md @@ -1,8 +1,8 @@ -## @nrwl/express has been deprecated! +## @nx/express has been deprecated! -@nrwl/express has been deprecated in favor of [@nx/express](https://www.npmjs.com/package/@nx/express). Please use that instead. +@nx/express has been deprecated in favor of [@nx/express](https://www.npmjs.com/package/@nx/express). Please use that instead. -@nrwl/express will no longer be published in Nx v17. +@nx/express will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/jest/README.md b/packages-legacy/jest/README.md index 6689da1424069..1cf3be9406b44 100644 --- a/packages-legacy/jest/README.md +++ b/packages-legacy/jest/README.md @@ -1,8 +1,8 @@ -## @nrwl/jest has been deprecated! +## @nx/jest has been deprecated! -@nrwl/jest has been deprecated in favor of [@nx/jest](https://www.npmjs.com/package/@nx/jest). Please use that instead. +@nx/jest has been deprecated in favor of [@nx/jest](https://www.npmjs.com/package/@nx/jest). Please use that instead. -@nrwl/jest will no longer be published in Nx v17. +@nx/jest will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/js/README.md b/packages-legacy/js/README.md index 951cb7af04b36..1d4cafff89619 100644 --- a/packages-legacy/js/README.md +++ b/packages-legacy/js/README.md @@ -1,8 +1,8 @@ -## @nrwl/js has been deprecated! +## @nx/js has been deprecated! -@nrwl/js has been deprecated in favor of [@nx/js](https://www.npmjs.com/package/@nx/js). Please use that instead. +@nx/js has been deprecated in favor of [@nx/js](https://www.npmjs.com/package/@nx/js). Please use that instead. -@nrwl/js will no longer be published in Nx v17. +@nx/js will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/linter/README.md b/packages-legacy/linter/README.md index fda35110cd18c..142ec6468a06f 100644 --- a/packages-legacy/linter/README.md +++ b/packages-legacy/linter/README.md @@ -1,8 +1,8 @@ -## @nrwl/linter has been deprecated! +## @nx/linter has been deprecated! -@nrwl/linter has been deprecated in favor of [@nx/linter](https://www.npmjs.com/package/@nx/linter). Please use that instead. +@nx/linter has been deprecated in favor of [@nx/linter](https://www.npmjs.com/package/@nx/linter). Please use that instead. -@nrwl/linter will no longer be published in Nx v17. +@nx/linter will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/nest/README.md b/packages-legacy/nest/README.md index 7fc2191fe9504..54decc12ce7a3 100644 --- a/packages-legacy/nest/README.md +++ b/packages-legacy/nest/README.md @@ -1,8 +1,8 @@ -## @nrwl/nest has been deprecated! +## @nx/nest has been deprecated! -@nrwl/nest has been deprecated in favor of [@nx/nest](https://www.npmjs.com/package/@nx/nest). Please use that instead. +@nx/nest has been deprecated in favor of [@nx/nest](https://www.npmjs.com/package/@nx/nest). Please use that instead. -@nrwl/nest will no longer be published in Nx v17. +@nx/nest will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/next/README.md b/packages-legacy/next/README.md index 8f4088eafa5a7..799662597785f 100644 --- a/packages-legacy/next/README.md +++ b/packages-legacy/next/README.md @@ -1,8 +1,8 @@ -## @nrwl/next has been deprecated! +## @nx/next has been deprecated! -@nrwl/next has been deprecated in favor of [@nx/next](https://www.npmjs.com/package/@nx/next). Please use that instead. +@nx/next has been deprecated in favor of [@nx/next](https://www.npmjs.com/package/@nx/next). Please use that instead. -@nrwl/next will no longer be published in Nx v17. +@nx/next will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/node/README.md b/packages-legacy/node/README.md index 6aeb4b59fb4a1..7713f4b53cbd5 100644 --- a/packages-legacy/node/README.md +++ b/packages-legacy/node/README.md @@ -1,8 +1,8 @@ -## @nrwl/node has been deprecated! +## @nx/node has been deprecated! -@nrwl/node has been deprecated in favor of [@nx/node](https://www.npmjs.com/package/@nx/node). Please use that instead. +@nx/node has been deprecated in favor of [@nx/node](https://www.npmjs.com/package/@nx/node). Please use that instead. -@nrwl/node will no longer be published in Nx v17. +@nx/node will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/nx-plugin/README.md b/packages-legacy/nx-plugin/README.md index cd1ceceda8acf..9f09667792dff 100644 --- a/packages-legacy/nx-plugin/README.md +++ b/packages-legacy/nx-plugin/README.md @@ -2,7 +2,7 @@ @nrwl/nx-plugin has been deprecated in favor of [@nx/plugin](https://www.npmjs.com/package/@nx/plugin). Please use that instead. -@nrwl/nx-plugin will no longer be published in Nx v17. +@nx/nx-plugin will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/react-native/README.md b/packages-legacy/react-native/README.md index 80ba779bbca80..d0d694a263296 100644 --- a/packages-legacy/react-native/README.md +++ b/packages-legacy/react-native/README.md @@ -1,8 +1,8 @@ -## @nrwl/react-native has been deprecated! +## @nx/react-native has been deprecated! -@nrwl/react-native has been deprecated in favor of [@nx/react-native](https://www.npmjs.com/package/@nx/react-native). Please use that instead. +@nx/react-native has been deprecated in favor of [@nx/react-native](https://www.npmjs.com/package/@nx/react-native). Please use that instead. -@nrwl/react-native will no longer be published in Nx v17. +@nx/react-native will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/react/README.md b/packages-legacy/react/README.md index 5ee6433b57faa..d8c220c07a310 100644 --- a/packages-legacy/react/README.md +++ b/packages-legacy/react/README.md @@ -1,8 +1,8 @@ -## @nrwl/react has been deprecated! +## @nx/react has been deprecated! -@nrwl/react has been deprecated in favor of [@nx/react](https://www.npmjs.com/package/@nx/react). Please use that instead. +@nx/react has been deprecated in favor of [@nx/react](https://www.npmjs.com/package/@nx/react). Please use that instead. -@nrwl/react will no longer be published in Nx v17. +@nx/react will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/rollup/README.md b/packages-legacy/rollup/README.md index 6930bdbcea8b7..a43cb4aeab387 100644 --- a/packages-legacy/rollup/README.md +++ b/packages-legacy/rollup/README.md @@ -1,8 +1,8 @@ -## @nrwl/rollup has been deprecated! +## @nx/rollup has been deprecated! -@nrwl/rollup has been deprecated in favor of [@nx/rollup](https://www.npmjs.com/package/@nx/rollup). Please use that instead. +@nx/rollup has been deprecated in favor of [@nx/rollup](https://www.npmjs.com/package/@nx/rollup). Please use that instead. -@nrwl/rollup will no longer be published in Nx v17. +@nx/rollup will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/storybook/README.md b/packages-legacy/storybook/README.md index 9ced6aace810c..e6a20df25774e 100644 --- a/packages-legacy/storybook/README.md +++ b/packages-legacy/storybook/README.md @@ -1,8 +1,8 @@ -## @nrwl/storybook has been deprecated! +## @nx/storybook has been deprecated! -@nrwl/storybook has been deprecated in favor of [@nx/storybook](https://www.npmjs.com/package/@nx/storybook). Please use that instead. +@nx/storybook has been deprecated in favor of [@nx/storybook](https://www.npmjs.com/package/@nx/storybook). Please use that instead. -@nrwl/storybook will no longer be published in Nx v17. +@nx/storybook will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/vite/README.md b/packages-legacy/vite/README.md index a921611d1f480..598f8903e3e47 100644 --- a/packages-legacy/vite/README.md +++ b/packages-legacy/vite/README.md @@ -1,8 +1,8 @@ -## @nrwl/vite has been deprecated! +## @nx/vite has been deprecated! -@nrwl/vite has been deprecated in favor of [@nx/vite](https://www.npmjs.com/package/@nx/vite). Please use that instead. +@nx/vite has been deprecated in favor of [@nx/vite](https://www.npmjs.com/package/@nx/vite). Please use that instead. -@nrwl/vite will no longer be published in Nx v17. +@nx/vite will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/web/README.md b/packages-legacy/web/README.md index 9c10378f0e234..90aa57aee1d75 100644 --- a/packages-legacy/web/README.md +++ b/packages-legacy/web/README.md @@ -1,8 +1,8 @@ -## @nrwl/web has been deprecated! +## @nx/web has been deprecated! -@nrwl/web has been deprecated in favor of [@nx/web](https://www.npmjs.com/package/@nx/web). Please use that instead. +@nx/web has been deprecated in favor of [@nx/web](https://www.npmjs.com/package/@nx/web). Please use that instead. -@nrwl/web will no longer be published in Nx v17. +@nx/web will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/webpack/README.md b/packages-legacy/webpack/README.md index 05f255597f1fc..2d096308725a5 100644 --- a/packages-legacy/webpack/README.md +++ b/packages-legacy/webpack/README.md @@ -1,8 +1,8 @@ -## @nrwl/webpack has been deprecated! +## @nx/webpack has been deprecated! -@nrwl/webpack has been deprecated in favor of [@nx/webpack](https://www.npmjs.com/package/@nx/webpack). Please use that instead. +@nx/webpack has been deprecated in favor of [@nx/webpack](https://www.npmjs.com/package/@nx/webpack). Please use that instead. -@nrwl/webpack will no longer be published in Nx v17. +@nx/webpack will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages-legacy/workspace/README.md b/packages-legacy/workspace/README.md index 66651f9508d46..cff3e74fc6654 100644 --- a/packages-legacy/workspace/README.md +++ b/packages-legacy/workspace/README.md @@ -1,8 +1,8 @@ -## @nrwl/workspace has been deprecated! +## @nx/workspace has been deprecated! -@nrwl/workspace has been deprecated in favor of [@nx/workspace](https://www.npmjs.com/package/@nx/workspace). Please use that instead. +@nx/workspace has been deprecated in favor of [@nx/workspace](https://www.npmjs.com/package/@nx/workspace). Please use that instead. -@nrwl/workspace will no longer be published in Nx v17. +@nx/workspace will no longer be published in Nx v17.

Nx - Smart, Fast and Extensible Build System

diff --git a/packages/angular/docs/application-examples.md b/packages/angular/docs/application-examples.md index 3ff5015e2524c..c5a4fc34fa93e 100644 --- a/packages/angular/docs/application-examples.md +++ b/packages/angular/docs/application-examples.md @@ -6,7 +6,7 @@ Create an application named `my-app`: ```bash -nx g @nrwl/angular:application my-app +nx g @nx/angular:application my-app ``` {% /tab %} @@ -16,7 +16,7 @@ nx g @nrwl/angular:application my-app Create an application named `my-app` in the `my-dir` directory and use `scss` for styles: ```bash -nx g @nrwl/angular:app my-app --directory=my-dir --style=scss +nx g @nx/angular:app my-app --directory=my-dir --style=scss ``` {% /tab %} @@ -26,7 +26,7 @@ nx g @nrwl/angular:app my-app --directory=my-dir --style=scss Create an application with Single File Components (inline styles and inline templates): ```bash -nx g @nrwl/angular:app my-app --inlineStyle --inlineTemplate +nx g @nx/angular:app my-app --inlineStyle --inlineTemplate ``` {% /tab %} @@ -36,7 +36,7 @@ nx g @nrwl/angular:app my-app --inlineStyle --inlineTemplate Create an application that is setup to use standalone components: ```bash -nx g @nrwl/angular:app my-app --standalone +nx g @nx/angular:app my-app --standalone ``` {% /tab %} @@ -46,7 +46,7 @@ nx g @nrwl/angular:app my-app --standalone Set the prefix to apply to generated selectors and add tags to the application (used for linting). ```bash -nx g @nrwl/angular:app my-app --prefix=admin --tags=scope:admin,type:ui +nx g @nx/angular:app my-app --prefix=admin --tags=scope:admin,type:ui ``` {% /tab %} diff --git a/packages/angular/docs/component-cypress-spec-examples.md b/packages/angular/docs/component-cypress-spec-examples.md index ab66bbd3865a5..db47393b613b5 100644 --- a/packages/angular/docs/component-cypress-spec-examples.md +++ b/packages/angular/docs/component-cypress-spec-examples.md @@ -7,7 +7,7 @@ Create a cypress spec for a component that is set up with Storybook. ```bash -nx g @nrwl/angular:component-cypress-spec --componentName=MyButtonComponent --componentPath=libs/ui/src/lib/button/button.component.ts --componentFileName=button.component --projectName=ui --projectPath=libs/ui +nx g @nx/angular:component-cypress-spec --componentName=MyButtonComponent --componentPath=libs/ui/src/lib/button/button.component.ts --componentFileName=button.component --projectName=ui --projectPath=libs/ui ``` {% /tab %} diff --git a/packages/angular/docs/component-examples.md b/packages/angular/docs/component-examples.md index d46cf380af723..775d6888821a3 100644 --- a/packages/angular/docs/component-examples.md +++ b/packages/angular/docs/component-examples.md @@ -6,7 +6,7 @@ Create a component named `my-component`: ```bash -nx g @nrwl/angular:component my-component +nx g @nx/angular:component my-component ``` {% /tab %} @@ -16,7 +16,7 @@ nx g @nrwl/angular:component my-component Create a standalone component named `my-component`: ```bash -nx g @nrwl/angular:component my-component --standalone +nx g @nx/angular:component my-component --standalone ``` {% /tab %} @@ -26,7 +26,7 @@ nx g @nrwl/angular:component my-component --standalone Create a component named `my-component` with inline styles and inline template: ```bash -nx g @nrwl/angular:component my-component --inlineStyle --inlineTemplate +nx g @nx/angular:component my-component --inlineStyle --inlineTemplate ``` {% /tab %} @@ -36,7 +36,7 @@ nx g @nrwl/angular:component my-component --inlineStyle --inlineTemplate Create a component named `my-component` with OnPush Change Detection Strategy: ```bash -nx g @nrwl/angular:component my-component --changeDetection=OnPush +nx g @nx/angular:component my-component --changeDetection=OnPush ``` {% /tab %} diff --git a/packages/angular/docs/component-test-examples.md b/packages/angular/docs/component-test-examples.md index 1bd6196767e5c..934f1002033cd 100644 --- a/packages/angular/docs/component-test-examples.md +++ b/packages/angular/docs/component-test-examples.md @@ -13,7 +13,7 @@ If you're wanting to create Storybook stories for a component, then check out th This generator is used to create a Cypress component test file for a given Angular component. ```shell -nx g @nrwl/angular:component-test --project=my-cool-angular-project --componentName=CoolBtnComponent --componentDir=src/cool-btn --componentFileName=cool-btn.component +nx g @nx/angular:component-test --project=my-cool-angular-project --componentName=CoolBtnComponent --componentDir=src/cool-btn --componentFileName=cool-btn.component ``` Test file are generated with the `.cy.ts` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project. diff --git a/packages/angular/docs/cypress-component-configuration-examples.md b/packages/angular/docs/cypress-component-configuration-examples.md index 140d8c1bd7f23..e4d9420492271 100644 --- a/packages/angular/docs/cypress-component-configuration-examples.md +++ b/packages/angular/docs/cypress-component-configuration-examples.md @@ -11,14 +11,14 @@ If you want to test components via Storybook with Cypress, then check out the [s This generator is designed to get your Angular project up and running with Cypress Component Testing. ```shell -nx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project +nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project ``` Running this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces. ```ts {% fileName="cypress.config.ts" %} import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/angular/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing'; export default defineConfig({ component: nxComponentTestingPreset(__filename), @@ -29,7 +29,7 @@ Here is an example on how to add custom options to the configuration ```ts {% fileName="cypress.config.ts" %} import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/angular/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing'; export default defineConfig({ component: { @@ -43,20 +43,20 @@ export default defineConfig({ Component testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-angular-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided. -For Angular projects, the build target needs to be using the `@nrwl/angular:webpack-browser` or +For Angular projects, the build target needs to be using the `@nx/angular:webpack-browser` or `@angular-devkit/build-angular:browser` executor. The generator will throw an error if a build target can't be found and suggest passing one in manually. Letting Nx infer the build target by default ```shell -nx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project +nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project ``` Manually specifying the build target ```shell -nx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project --build-target:some-angular-app:build --generate-tests +nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --build-target:some-angular-app:build --generate-tests ``` {% callout type="note" title="Build Target with Configuration" %} @@ -69,7 +69,7 @@ then manually providing `--build-target=my-app:build:production` is the best way You can optionally use the `--generate-tests` flag to generate a test file for each component in your project. ```shell -nx g @nrwl/angular:cypress-component-configuration --project=my-cool-angular-project --generate-tests +nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --generate-tests ``` ## Running Component Tests @@ -86,7 +86,7 @@ Here is an example of the project configuration that is generated. The `--build- { "targets" { "component-test": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "/cypress.config.ts", "testingType": "component", diff --git a/packages/angular/docs/delegate-build-examples.md b/packages/angular/docs/delegate-build-examples.md index 23c2057e1fa96..83086d8cde547 100644 --- a/packages/angular/docs/delegate-build-examples.md +++ b/packages/angular/docs/delegate-build-examples.md @@ -8,7 +8,7 @@ Delegate the build of the project to a different target. ```json { "prod-build": { - "executor": "@nrwl/angular:delegate-build", + "executor": "@nx/angular:delegate-build", "options": { "buildTarget": "app:build:production", "outputPath": "dist/apps/app/production", @@ -27,7 +27,7 @@ Delegate the build of the project to a different target. ```json { "prod-build": { - "executor": "@nrwl/angular:delegate-build", + "executor": "@nx/angular:delegate-build", "options": { "buildTarget": "app:build:production", "outputPath": "dist/apps/app/production", diff --git a/packages/angular/docs/downgrade-module-examples.md b/packages/angular/docs/downgrade-module-examples.md index 9bf81e20b174c..5d304e576de1e 100644 --- a/packages/angular/docs/downgrade-module-examples.md +++ b/packages/angular/docs/downgrade-module-examples.md @@ -7,7 +7,7 @@ Below are some examples of how to generate configuration and setup for using `ng {% tab label="Basic Usage" %} ```bash -nx g @nrwl/angular:downgrade-module --name=myAngularJsModule --project=myapp +nx g @nx/angular:downgrade-module --name=myAngularJsModule --project=myapp ``` {% /tab %} @@ -17,7 +17,7 @@ nx g @nrwl/angular:downgrade-module --name=myAngularJsModule --project=myapp Allow a setup that configures routing for `DowngradeModule`. ```bash -nx g @nrwl/angular:downgrade-module --name=myAngularJsModule --project=myapp --router=true +nx g @nx/angular:downgrade-module --name=myAngularJsModule --project=myapp --router=true ``` {% /tab %} diff --git a/packages/angular/docs/karma-project-examples.md b/packages/angular/docs/karma-project-examples.md index e68f2b2c13e15..8396363fc0597 100644 --- a/packages/angular/docs/karma-project-examples.md +++ b/packages/angular/docs/karma-project-examples.md @@ -7,7 +7,7 @@ To add karma to project, run the following command. ```bash -nx g @nrwl/angular:karma-project --project=myapp +nx g @nx/angular:karma-project --project=myapp ``` {% /tab %} diff --git a/packages/angular/docs/library-examples.md b/packages/angular/docs/library-examples.md index 794b3636704cd..f6d1637723043 100644 --- a/packages/angular/docs/library-examples.md +++ b/packages/angular/docs/library-examples.md @@ -6,7 +6,7 @@ Creates the `my-ui-lib` library with an `ui` tag: ```bash -nx g @nrwl/angular:library my-ui-lib --tags=ui +nx g @nx/angular:library my-ui-lib --tags=ui ``` {% /tab %} @@ -16,7 +16,7 @@ nx g @nrwl/angular:library my-ui-lib --tags=ui Creates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package: ```bash -nx g @nrwl/angular:library my-lib --publishable --import-path=@my-org/my-lib +nx g @nx/angular:library my-lib --publishable --import-path=@my-org/my-lib ``` {% /tab %} @@ -26,7 +26,7 @@ nx g @nrwl/angular:library my-lib --publishable --import-path=@my-org/my-lib Creates the `my-lib` library with support for incremental builds: ```bash -nx g @nrwl/angular:library my-lib --buildable +nx g @nx/angular:library my-lib --buildable ``` {% /tab %} @@ -35,7 +35,7 @@ nx g @nrwl/angular:library my-lib --buildable Creates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`: ```bash -nx g @nrwl/angular:library --directory=nested --importPath=@myorg/nested/my-lib my-lib +nx g @nx/angular:library --directory=nested --importPath=@myorg/nested/my-lib my-lib ``` {% /tab %} @@ -44,7 +44,7 @@ nx g @nrwl/angular:library --directory=nested --importPath=@myorg/nested/my-lib Creates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector. ```bash -nx g @nrwl/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib +nx g @nx/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib ``` {% /tab %} diff --git a/packages/angular/docs/library-secondary-entry-point-examples.md b/packages/angular/docs/library-secondary-entry-point-examples.md index 5d731fa290567..dd078277be2fc 100644 --- a/packages/angular/docs/library-secondary-entry-point-examples.md +++ b/packages/angular/docs/library-secondary-entry-point-examples.md @@ -6,7 +6,7 @@ Create a secondary entrypoint named `button` in the `ui` library. ```bash -nx g @nrwl/angular:library-secondary-entry-point --library=ui --name=button +nx g @nx/angular:library-secondary-entry-point --library=ui --name=button ``` {% /tab %} @@ -15,7 +15,7 @@ nx g @nrwl/angular:library-secondary-entry-point --library=ui --name=button Create a secondary entrypoint named `button` in the `ui` library but skip creating an NgModule. ```bash -nx g @nrwl/angular:library-secondary-entry-point --library=ui --name=button --skipModule +nx g @nx/angular:library-secondary-entry-point --library=ui --name=button --skipModule ``` {% /tab %} diff --git a/packages/angular/docs/module-federation-dev-server-examples.md b/packages/angular/docs/module-federation-dev-server-examples.md index 3f92cba6b3539..5bf3991d96b3b 100644 --- a/packages/angular/docs/module-federation-dev-server-examples.md +++ b/packages/angular/docs/module-federation-dev-server-examples.md @@ -9,7 +9,7 @@ See an example set up of it below: ```json { "serve": { - "executor": "@nrwl/angular:module-federation-dev-server", + "executor": "@nx/angular:module-federation-dev-server", "configurations": { "production": { "browserTarget": "host:build:production" @@ -36,7 +36,7 @@ See an example set up of it below: ```json { "serve-with-hmr-remotes": { - "executor": "@nrwl/angular:module-federation-dev-server", + "executor": "@nx/angular:module-federation-dev-server", "configurations": { "production": { "browserTarget": "host:build:production" diff --git a/packages/angular/docs/ng-add-examples.md b/packages/angular/docs/ng-add-examples.md index ec7326478cb9f..56a54fd5511a7 100644 --- a/packages/angular/docs/ng-add-examples.md +++ b/packages/angular/docs/ng-add-examples.md @@ -1,5 +1,5 @@ ## Information -This generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nrwl/angular`. +This generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nx/angular`. You can read more about [migrating from Angular CLI to Nx here](https://nx.dev/recipes/adopting-nx/migration-angular). diff --git a/packages/angular/docs/scam-to-standalone-examples.md b/packages/angular/docs/scam-to-standalone-examples.md index 48e91582526ee..0054c7ae806d4 100644 --- a/packages/angular/docs/scam-to-standalone-examples.md +++ b/packages/angular/docs/scam-to-standalone-examples.md @@ -8,7 +8,7 @@ This generator allows you to convert an Inline SCAM to a Standalone Component. I ```bash -nx g @nrwl/angular:scam-to-standalone --component=libs/mylib/src/lib/myscam/myscam.component.ts --project=mylib +nx g @nx/angular:scam-to-standalone --component=libs/mylib/src/lib/myscam/myscam.component.ts --project=mylib ``` diff --git a/packages/angular/docs/setup-tailwind-examples.md b/packages/angular/docs/setup-tailwind-examples.md index 81e06e8b25c95..67ab6cc40d8a2 100644 --- a/packages/angular/docs/setup-tailwind-examples.md +++ b/packages/angular/docs/setup-tailwind-examples.md @@ -9,7 +9,7 @@ The `setup-tailwind` generator can be used to add [Tailwind](https://tailwindcss To generate a standard Tailwind setup, just run the following command. ```bash -nx g @nrwl/angular:setup-tailwind myapp +nx g @nx/angular:setup-tailwind myapp ``` {% /tab %} @@ -19,7 +19,7 @@ nx g @nrwl/angular:setup-tailwind myapp To specify the styles file that should be used as the entrypoint for Tailwind, simply pass the `--stylesEntryPoint` flag, relative to workspace root. ```bash -nx g @nrwl/angular:setup-tailwind myapp --stylesEntryPoint=apps/myapp/src/styles.css +nx g @nx/angular:setup-tailwind myapp --stylesEntryPoint=apps/myapp/src/styles.css ``` {% /tab %} diff --git a/packages/angular/docs/stories-examples.md b/packages/angular/docs/stories-examples.md index cb8d5f2b13a25..ba441dc29df3d 100644 --- a/packages/angular/docs/stories-examples.md +++ b/packages/angular/docs/stories-examples.md @@ -1,7 +1,7 @@ This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```bash -nx g @nrwl/angular:stories project-name +nx g @nx/angular:stories project-name ``` You can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#auto-generate-stories). @@ -20,7 +20,7 @@ There are a number of other options available. Let's take a look at some example ### Ignore certain paths when generating stories ```bash -nx g @nrwl/angular:stories ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.* +nx g @nx/angular:stories ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.* ``` This will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`. diff --git a/packages/angular/docs/storybook-configuration-examples.md b/packages/angular/docs/storybook-configuration-examples.md index f406bf0ac9fdc..da7373570845f 100644 --- a/packages/angular/docs/storybook-configuration-examples.md +++ b/packages/angular/docs/storybook-configuration-examples.md @@ -1,7 +1,7 @@ This generator will set up Storybook for your Angular project. ```bash -nx g @nrwl/angular:storybook-configuration project-name +nx g @nx/angular:storybook-configuration project-name ``` You can read more about how this generator works, in the [Storybook for Angular overview page](/packages/storybook/documents/overview-angular#generate-storybook-configuration-for-an-angular-project). @@ -23,7 +23,7 @@ There are a number of other options available. Let's take a look at some example ### Generate Storybook configuration using TypeScript ```bash -nx g @nrwl/angular:storybook-configuration ui --tsConfiguration=true +nx g @nx/angular:storybook-configuration ui --tsConfiguration=true ``` This will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory). @@ -31,7 +31,7 @@ This will generate a Storybook configuration for the `ui` project using TypeScri ### Ignore certain paths when generating stories ```bash -nx g @nrwl/angular:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts +nx g @nx/angular:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts ``` This will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`. @@ -41,7 +41,7 @@ This is useful if you have a project that contains components that are not meant ### Generate Storybook configuration for Storybook version 7 ```bash -nx g @nrwl/angular:storybook-configuration ui --storybook7Configuration=true +nx g @nx/angular:storybook-configuration ui --storybook7Configuration=true ``` {% callout type="info" title="For Nx versions <15.9" %} diff --git a/packages/angular/docs/upgrade-module-examples.md b/packages/angular/docs/upgrade-module-examples.md index 021b052aa246e..1887cae6395c9 100644 --- a/packages/angular/docs/upgrade-module-examples.md +++ b/packages/angular/docs/upgrade-module-examples.md @@ -7,7 +7,7 @@ Below are some examples of how to generate configuration and setup for using `ng {% tab label="Basic Usage" %} ```bash -nx g @nrwl/angular:upgrade-module --name=myAngularJsModule --project=myapp +nx g @nx/angular:upgrade-module --name=myAngularJsModule --project=myapp ``` {% /tab %} @@ -17,7 +17,7 @@ nx g @nrwl/angular:upgrade-module --name=myAngularJsModule --project=myapp Allow a setup that configures routing for `UpgradeModule`. ```bash -nx g @nrwl/angular:upgrade-module --name=myAngularJsModule --project=myapp --router=true +nx g @nx/angular:upgrade-module --name=myAngularJsModule --project=myapp --router=true ``` {% /tab %} diff --git a/packages/angular/docs/web-worker-examples.md b/packages/angular/docs/web-worker-examples.md index 824cb15d04a65..33ddf7d037c3d 100644 --- a/packages/angular/docs/web-worker-examples.md +++ b/packages/angular/docs/web-worker-examples.md @@ -7,7 +7,7 @@ The basic usage of the `web-worker` generator is defined below. You must provide a name for the web worker and the project to assign it to. ```bash -nx g @nrwl/angular:web-worker myWebWorker --project=myapp +nx g @nx/angular:web-worker myWebWorker --project=myapp ``` {% /tab %} diff --git a/packages/angular/docs/webpack-browser-examples.md b/packages/angular/docs/webpack-browser-examples.md index b9832c8082315..94a1a6f961901 100644 --- a/packages/angular/docs/webpack-browser-examples.md +++ b/packages/angular/docs/webpack-browser-examples.md @@ -15,7 +15,7 @@ To use a custom webpack configuration when building your Angular application, ch ```typescript "build": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "options": { ... "customWebpackConfig": { @@ -38,7 +38,7 @@ To allow your Angular application to take advantage of incremental building, cha ```typescript "build": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "options": { ... "buildLibsFromSource": false diff --git a/packages/angular/docs/webpack-dev-server-examples.md b/packages/angular/docs/webpack-dev-server-examples.md index d7b762150ccac..4c37556c81f1e 100644 --- a/packages/angular/docs/webpack-dev-server-examples.md +++ b/packages/angular/docs/webpack-dev-server-examples.md @@ -1,12 +1,12 @@ ##### Seving an application with a custom webpack configuration -This executor should be used along with `@nrwl/angular:webpack-browser` to serve an application using a custom webpack configuration. +This executor should be used along with `@nx/angular:webpack-browser` to serve an application using a custom webpack configuration. Your `project.json` file should contain a `build` and `serve` target that matches the following: ```json "build": { - "executor": "@nrwl/angular:webpack-browser", + "executor": "@nx/angular:webpack-browser", "options": { ... "customWebpackConfig": { @@ -15,7 +15,7 @@ Your `project.json` file should contain a `build` and `serve` target that matche } }, "serve": { - "executor": "@nrwl/angular:webpack-dev-server", + "executor": "@nx/angular:webpack-dev-server", "configurations": { "production": { "browserTarget": "appName:build:production" diff --git a/packages/cypress/docs/cypress-e2e-config-examples.md b/packages/cypress/docs/cypress-e2e-config-examples.md index fa90d5f4d58dc..4472ebaf40512 100644 --- a/packages/cypress/docs/cypress-e2e-config-examples.md +++ b/packages/cypress/docs/cypress-e2e-config-examples.md @@ -17,7 +17,7 @@ nx g cypress-e2e-configuration --project=my-cool-project --devServerTarget=some- ``` Providing a `--devServerTarget` is optional if you provide a `--baseUrl` or the project you're adding the configuration to has a `serve` target already. -Otherwise, a `--devServerTarget` is recommend for the `@nrwl/cypress:cypress` executor to spin up the dev server for you automatically when needed. +Otherwise, a `--devServerTarget` is recommend for the `@nx/cypress:cypress` executor to spin up the dev server for you automatically when needed. ## Feature Based Testing @@ -126,4 +126,4 @@ nx g cypress-e2e-configuration --project=feature-dashboard --devServerTarget=fan Each project will now get their own `e2e` target, where the feature project is only concerned with itself. This allows for more focused tests without worrying about forcing unrelated tests to also run. -It's important to remember that these feature tests are still going to be leveraging the same app to run the tests against so if you plan to run in parallel, you can leverage using a file server and the ability for `@nrwl/cypress:cypress` executor to pass through a port or find a free port to allow running tests in parallel. Read more [about the --port flag](/packages/cypress/executors/cypress#port) +It's important to remember that these feature tests are still going to be leveraging the same app to run the tests against so if you plan to run in parallel, you can leverage using a file server and the ability for `@nx/cypress:cypress` executor to pass through a port or find a free port to allow running tests in parallel. Read more [about the --port flag](/packages/cypress/executors/cypress#port) diff --git a/packages/cypress/docs/cypress-examples.md b/packages/cypress/docs/cypress-examples.md index 095268b213f10..4abd9e537309c 100644 --- a/packages/cypress/docs/cypress-examples.md +++ b/packages/cypress/docs/cypress-examples.md @@ -6,7 +6,7 @@ Depending on your testing type, the Cypress executor is configured in different ```json "targets": { "e2e": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/app-e2e/cypres.config.ts", "devServerTarget": "my-react-app:serve", @@ -32,13 +32,13 @@ The `baseUrl` defined in the Cypress config file is the last value used if no ur When running in CI it doesn't make sense to start up a dev server since there aren't changes to watch for. -You can use [`@nrwl/web:file-server`](/packages/web/executors/file-server) to serve the pre-built static files of your frontend project. +You can use [`@nx/web:file-server`](/packages/web/executors/file-server) to serve the pre-built static files of your frontend project. In some _frontend_ application, add a 'static-serve' target. ```json "serve-static": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options":{ "buildTarget": "frontend:build" } @@ -59,7 +59,7 @@ In the _e2e_ application add a configuration to change `devServerTarget` to poin ``` {% callout type="note" title="What about Node projects?" %} -The same can be done for backend node apps with [`@nrwl/js:node` executor](/packages/js/executors/node) +The same can be done for backend node apps with [`@nx/js:node` executor](/packages/js/executors/node) {% /callout %} ```bash @@ -80,7 +80,7 @@ When adding component testing to a project, it's best to use the framework speci ```json "targets": { "component-test": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/app/cypres.config.ts", "devServerTarget": "my-react-app:build", @@ -104,7 +104,7 @@ Using [executor configurations](/recipe/use-executor-configurations#use-executor ```json "targets": { "e2e": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/app-e2e/cypres.config.ts", "devServerTarget": "my-react-app:serve", diff --git a/packages/cypress/docs/cypress-project-examples.md b/packages/cypress/docs/cypress-project-examples.md index f35fff802c9b4..9daaedaff4949 100644 --- a/packages/cypress/docs/cypress-project-examples.md +++ b/packages/cypress/docs/cypress-project-examples.md @@ -13,7 +13,7 @@ nx g cypress-project --name=my-app-e2e --base-url=http://localhost:1234 ``` {% callout type="note" title="What about API Projects?" %} -You can also run the `cypress-project` generator against API projects like a [Nest API](/packages/nest/generators/application#@nrwl/nest:application). +You can also run the `cypress-project` generator against API projects like a [Nest API](/packages/nest/generators/application#@nx/nest:application). If there is a URL to visit then you can test it with Cypress! {% /callout %} @@ -33,7 +33,7 @@ The `nxE2EPreset` will then use the `bundler` information to generate the correc ```ts import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; const config = nxE2EPreset(__filename, { bundler: 'vite' }); export default defineConfig({ diff --git a/packages/devkit/index.d.ts b/packages/devkit/index.d.ts index 49962bfbc39da..56dd794870fd9 100644 --- a/packages/devkit/index.d.ts +++ b/packages/devkit/index.d.ts @@ -8,7 +8,7 @@ * It only uses language primitives and immutable objects * (the tree being the only exception). * - * @module @nrwl/devkit + * @module @nx/devkit */ // TODO(v17): remove this file, we can use the normally generated index.d.ts from index.ts diff --git a/packages/devkit/index.js b/packages/devkit/index.js index 3d35c59299583..605517a6888bf 100644 --- a/packages/devkit/index.js +++ b/packages/devkit/index.js @@ -8,7 +8,7 @@ * It only uses language primitives and immutable objects * (the tree being the only exception). * - * @module @nrwl/devkit + * @module @nx/devkit */ try { diff --git a/packages/devkit/src/utils/package-json.ts b/packages/devkit/src/utils/package-json.ts index b2726a34f9609..3c7fc8711d61a 100644 --- a/packages/devkit/src/utils/package-json.ts +++ b/packages/devkit/src/utils/package-json.ts @@ -384,13 +384,13 @@ const packageMapCache = new Map(); * * For example: * ```typescript - * ensurePackage(tree, '@nrwl/jest', nxVersion) + * ensurePackage(tree, '@nx/jest', nxVersion) * ``` - * This install the @nrwl/jest@ and return the module + * This install the @nx/jest@ and return the module * When running with --dryRun, the function will throw when dependencies are missing. * * @param tree the file system tree - * @param pkg the package to check (e.g. @nrwl/jest) + * @param pkg the package to check (e.g. @nx/jest) * @param requiredVersion the version or semver range to check (e.g. ~1.0.0, >=1.0.0 <2.0.0) * @param {EnsurePackageOptions} options? */ @@ -406,7 +406,7 @@ export function ensurePackage( * * For example: * ```typescript - * ensurePackage(tree, '@nrwl/jest', nxVersion) + * ensurePackage(tree, '@nx/jest', nxVersion) * ``` * @param pkg the package to install and require * @param version the version to install if the package doesn't exist already diff --git a/packages/esbuild/docs/esbuild-examples.md b/packages/esbuild/docs/esbuild-examples.md index 0d488d6361ade..ffbc549d640db 100644 --- a/packages/esbuild/docs/esbuild-examples.md +++ b/packages/esbuild/docs/esbuild-examples.md @@ -6,7 +6,7 @@ "targets": { //... "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { "main": "", "tsConfig": "/tsconfig.app.json", @@ -36,7 +36,7 @@ nx build # defaults to es# defaults to esm ```json "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { "main": "", "tsConfig": "/tsconfig.app.json", @@ -54,7 +54,7 @@ You can also use `*` wildcard to match assets. ```json "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { "main": "", "tsConfig": "/tsconfig.app.json", @@ -70,7 +70,7 @@ Type checking is the slowest part of the build. You may want to skip type checki ```json "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { "main": "", "tsConfig": "/tsconfig.app.json", @@ -86,7 +86,7 @@ Additional [esbuild options](https://esbuild.github.io/api/) can be passed using ```json "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { "main": "", "tsConfig": "/tsconfig.app.json", diff --git a/packages/esbuild/docs/esbuild-project-examples.md b/packages/esbuild/docs/esbuild-project-examples.md index a0a23380f6e12..213a6ee233ccf 100644 --- a/packages/esbuild/docs/esbuild-project-examples.md +++ b/packages/esbuild/docs/esbuild-project-examples.md @@ -1,5 +1,5 @@ ```bash -nx g @nrwl/esbuild:esbuild-project my-package +nx g @nx/esbuild:esbuild-project my-package ``` {% callout type="note" title="Overwriting existing build option" %} @@ -9,7 +9,7 @@ The `esbuild-projet` generator validates that an existing `build` target isn't a You may also provide a custom main entry file, or a custom tsconfig file if the defaults don't work. By default, the generator will look for a main file matching `src/index.ts` or `src/main.ts`, and a tsconfig file matching `tsconfig.app.json` or `tsconfig.lib.json`. ```bash -nx g @nrwl/esbuild:esbuild-project my-package \ +nx g @nx/esbuild:esbuild-project my-package \ --main=packages/my-package/src/entry.ts \ --tsConfig=packages/my-package/tsconfig.custom.json ``` diff --git a/packages/expo/docs/build-list-examples.md b/packages/expo/docs/build-list-examples.md index b7905cbae5527..01f8068c85988 100644 --- a/packages/expo/docs/build-list-examples.md +++ b/packages/expo/docs/build-list-examples.md @@ -9,7 +9,7 @@ The `build-list` command allows to check the details of your Expo Application Se "targets": { //... "build-list": { - "executor": "@nrwl/expo:build-list", + "executor": "@nx/expo:build-list", "options": {} } //... @@ -29,7 +29,7 @@ The `platform` option allows you to check build status of different platform (e. ```json "build-list": { - "executor": "@nrwl/expo:build-list", + "executor": "@nx/expo:build-list", "options": { "platform": "ios" } @@ -43,7 +43,7 @@ The `interactive` option allows you to specify whether to use interactive mode: ```json "build-list": { - "executor": "@nrwl/expo:build-list", + "executor": "@nx/expo:build-list", "options": { "interactive": true } @@ -57,7 +57,7 @@ The `json` option allows you to print the output in JSON format: ```json "build-list": { - "executor": "@nrwl/expo:build-list", + "executor": "@nx/expo:build-list", "options": { "interactive": false, "json": true diff --git a/packages/expo/docs/prebuild-examples.md b/packages/expo/docs/prebuild-examples.md index f300bf18ae15b..78f775b16d03f 100644 --- a/packages/expo/docs/prebuild-examples.md +++ b/packages/expo/docs/prebuild-examples.md @@ -9,7 +9,7 @@ The `prebuild` command generates native code before a native app can compile. "targets": { //... "prebuild": { - "executor": "@nrwl/expo:prebuild", + "executor": "@nx/expo:prebuild", "options": {} } //... @@ -29,7 +29,7 @@ The `platform` option allows you to specify the platform to generate native code ```json "prebuild": { - "executor": "@nrwl/expo:prebuild", + "executor": "@nx/expo:prebuild", "options": { "platform": "android" } @@ -43,7 +43,7 @@ The `clean` option allows you to delete the native folders and regenerate them b ```json "prebuild": { - "executor": "@nrwl/expo:prebuild", + "executor": "@nx/expo:prebuild", "options": { "clean": true } @@ -57,7 +57,7 @@ The `install` option allows you to install NPM Packages and CocoaPods. ```json "prebuild": { - "executor": "@nrwl/expo:prebuild", + "executor": "@nx/expo:prebuild", "options": { "install": true } diff --git a/packages/expo/docs/run-examples.md b/packages/expo/docs/run-examples.md index 2f985cff832ee..7e2e37f3a3949 100644 --- a/packages/expo/docs/run-examples.md +++ b/packages/expo/docs/run-examples.md @@ -9,13 +9,13 @@ The `run` command allows you to compile your app locally. "targets": { //... "run-ios": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "ios" } }, "run-android": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "android" } @@ -38,7 +38,7 @@ The `variant` option allows you to specify the compile Android app with variants ```json "run-android": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "android", "variant": "release" @@ -53,7 +53,7 @@ The `xcodeConfiguration` option allows you to specify Xcode configuration to use ```json "run-ios": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "ios", "xcodeConfiguration": "Release" @@ -70,14 +70,14 @@ To see all your Android emulators, run: `emulator -list-avds`. ```json "run-ios": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "ios", "device": "iPhone 14" } }, "run-android": { - "executor": "@nrwl/expo:run", + "executor": "@nx/expo:run", "options": { "platform": "android", "device": "Pixel_XL_API_Tiramisu" diff --git a/packages/expo/docs/start-examples.md b/packages/expo/docs/start-examples.md index 246f502b11ec6..1d2114f9976c9 100644 --- a/packages/expo/docs/start-examples.md +++ b/packages/expo/docs/start-examples.md @@ -7,7 +7,7 @@ "targets": { //... "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081 } @@ -31,7 +31,7 @@ Opens your app in Expo Go in a currently running iOS simulator on your computer: ```json "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081, "ios": true @@ -43,7 +43,7 @@ Opens your app in Expo Go on a connected Android device ```json "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081, "android": true @@ -55,7 +55,7 @@ Opens your app in a web browser: ```json "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081, "web": true @@ -69,7 +69,7 @@ The `host` option allows you to specify the type of host to use. `lan` uses the ```json "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081, "host": "localhost" @@ -84,7 +84,7 @@ The `clear` option allows you to remove Metro bundler cache. ```json "start": { - "executor": "@nrwl/expo:start", + "executor": "@nx/expo:start", "options": { "port": 8081, "clear": true diff --git a/packages/jest/docs/jest-examples.md b/packages/jest/docs/jest-examples.md index beadd633652d4..05ecb030625e7 100644 --- a/packages/jest/docs/jest-examples.md +++ b/packages/jest/docs/jest-examples.md @@ -2,7 +2,7 @@ Jest can be configured in many ways, but primarily you'll need to at least have ```json "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { "jestConfig": "libs/my-lib/jest.config.ts" } @@ -13,7 +13,7 @@ It is also helpful to have `passWithNoTests: true` set so your project doesn't f ```json "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { "jestConfig": "libs/my-lib/jest.config.ts", "passWithNoTests": true @@ -34,7 +34,7 @@ Adding a _ci_ configuration is helpful for adding this behavior. ```json "test": { - "executor": "@nrwl/jest:jest", + "executor": "@nx/jest:jest", "options": { "jestConfig": "libs/my-lib/jest.config.ts", "passWithNoTests": true diff --git a/packages/js/docs/library-examples.md b/packages/js/docs/library-examples.md index 8776292073cc7..e8da2be14661b 100644 --- a/packages/js/docs/library-examples.md +++ b/packages/js/docs/library-examples.md @@ -1,15 +1,15 @@ --- title: JS library generator examples -description: This page contains examples for the @nrwl/js:lib generator. +description: This page contains examples for the @nx/js:lib generator. --- -The `@nrwl/js:lib` generator will generate a library for you, and it will configure it according to the options you provide. +The `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide. ```bash -npx nx g @nrwl/js:lib mylib +npx nx g @nx/js:lib mylib ``` -By default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nrwl/js:tsc` executor as a builder. +By default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder. You may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not. @@ -19,47 +19,47 @@ You may configure the tools you want to use to build your library, or bundle it {% tab label="Buildable with default compiler (tsc)" %} -Generate a buildable library using the `@nrwl/js:tsc` executor. This uses `tsc` as the compiler. +Generate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler. ```bash -npx nx g @nrwl/js:lib mylib +npx nx g @nx/js:lib mylib ``` {% /tab %} {% tab label="Buildable with SWC compiler" %} -Generate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nrwl/js:swc` executor. +Generate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor. ```bash -npx nx g @nrwl/js:lib mylib --bundler=swc +npx nx g @nx/js:lib mylib --bundler=swc ``` {% /tab %} {% tab label="Buildable with tsc" %} -Generate a buildable library using tsc as the compiler. This will use the `@nrwl/js:tsc` executor. +Generate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor. ```bash -npx nx g @nrwl/js:lib mylib --bundler=tsc +npx nx g @nx/js:lib mylib --bundler=tsc ``` {% /tab %} {% tab label="Buildable, with Rollup as a bundler" %} -Generate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nrwl/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler. +Generate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler. ```bash -npx nx g @nrwl/js:lib mylib --bundler=rollup +npx nx g @nx/js:lib mylib --bundler=rollup ``` If you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](https://nx.dev/packages/rollup/executors/rollup#compiler): ```jsonc {% fileName="libs/mylib/project.json" %} "build": { - "executor": "@nrwl/rollup:rollup", + "executor": "@nx/rollup:rollup", "options": { //... "compiler": "babel" @@ -71,27 +71,27 @@ If you do not want to use `swc` as the compiler, and want to use the default `ba {% tab label="Buildable, with Vite as a bundler" %} -Generate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nrwl/vite:build` executor. +Generate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor. ```bash -npx nx g @nrwl/js:lib mylib --bundler=vite +npx nx g @nx/js:lib mylib --bundler=vite ``` {% /tab %} {% tab label="Using ESBuild" %} -Generate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nrwl/esbuild:esbuild` executor. +Generate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor. ```bash -npx nx g @nrwl/js:lib mylib --bundler=esbuild +npx nx g @nx/js:lib mylib --bundler=esbuild ``` If you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/): ```jsonc {% fileName="libs/mylib/project.json" %} "build": { - "executor": "@nrwl/esbuild:esbuild", + "executor": "@nx/esbuild:esbuild", "options": { //... "esbuildOptions": { @@ -105,7 +105,7 @@ If you want to specify whether you want to bundle your library or not, you can d {% tab label="Minimal publishing target" %} -Generate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nrwl/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag. +Generate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag. ```bash npx nx g lib mylib --publishable @@ -128,7 +128,7 @@ npx nx g lib mylib --directory=myapp Generate a non-buildable library. ```bash -npx nx g @nrwl/js:lib mylib --bundler=none +npx nx g @nx/js:lib mylib --bundler=none ``` {% /tab %} diff --git a/packages/js/docs/swc-examples.md b/packages/js/docs/swc-examples.md index 6e21ddb921dd0..35bb26b1be824 100644 --- a/packages/js/docs/swc-examples.md +++ b/packages/js/docs/swc-examples.md @@ -3,12 +3,12 @@ {% tabs %} {% tab label="Inline libraries" %} -`@nrwl/js:swc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option. +`@nx/js:swc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option. ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:swc", + "executor": "@nx/js:swc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", @@ -24,12 +24,12 @@ npx nx build ts-lib --external=all ``` -`@nrwl/js:swc` can also inline buildable libraries by setting `external: 'none'` +`@nx/js:swc` can also inline buildable libraries by setting `external: 'none'` ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:swc", + "executor": "@nx/js:swc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", @@ -48,12 +48,12 @@ npx nx build ts-lib --external=none {% /tab %} {% tab label="Custom swcrc" %} -`@nrwl/js:swc` can compile your code with a custom `.swcrc` +`@nx/js:swc` can compile your code with a custom `.swcrc` ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:swc", + "executor": "@nx/js:swc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", diff --git a/packages/js/docs/tsc-examples.md b/packages/js/docs/tsc-examples.md index e1a1eaafcc42f..824e4a890d82c 100644 --- a/packages/js/docs/tsc-examples.md +++ b/packages/js/docs/tsc-examples.md @@ -3,12 +3,12 @@ {% tabs %} {% tab label="Using TypeScript Transformer Plugins" %} -`@nrwl/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option. +`@nx/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option. ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", @@ -29,12 +29,12 @@ {% /tab %} {% tab label="Inline libraries" %} -`@nrwl/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option. +`@nx/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option. ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", @@ -50,12 +50,12 @@ npx nx build ts-lib --external=all ``` -`@nrwl/js:tsc` can also inline buildable libraries by setting `external: 'none'` +`@nx/js:tsc` can also inline buildable libraries by setting `external: 'none'` ```json {% fileName="libs/ts-lib/project.json" %} { "build": { - "executor": "@nrwl/js:tsc", + "executor": "@nx/js:tsc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", diff --git a/packages/linter/docs/eslint-examples.md b/packages/linter/docs/eslint-examples.md index 13190d5b2c6aa..a58b245824e6a 100644 --- a/packages/linter/docs/eslint-examples.md +++ b/packages/linter/docs/eslint-examples.md @@ -4,7 +4,7 @@ Linter can be configured in multiple ways. The basic way is to provide only `lin ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"] } @@ -20,7 +20,7 @@ Linter provides an automated way of fixing known issues. To ensure that those ch ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"] @@ -38,7 +38,7 @@ We can also set this flag via project configuration to always fix files when run ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -54,7 +54,7 @@ ESLint executor uses the `stylish` output format by default. You can change this ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -76,7 +76,7 @@ We can also set this via project configuration as a default option. ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -92,7 +92,7 @@ We can also set this via project configuration as a default option. ```json "lint": { - "executor": "@nrwl/linter:eslint", + "executor": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], diff --git a/packages/linter/docs/workspace-rule-examples.md b/packages/linter/docs/workspace-rule-examples.md index 98aa55eaaaad1..0446b7e102b85 100644 --- a/packages/linter/docs/workspace-rule-examples.md +++ b/packages/linter/docs/workspace-rule-examples.md @@ -4,7 +4,7 @@ This command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder: ```shell -nx g @nrwl/linter:workspace-rule my-custom-rule +nx g @nx/linter:workspace-rule my-custom-rule ``` {% /tab %} @@ -13,7 +13,7 @@ nx g @nrwl/linter:workspace-rule my-custom-rule We can change the default sub-folder from `rules` and specify a custom one: ```shell -nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path +nx g @nx/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path ``` The command above will generate the rule in `tools/eslint-rules/my/custom/path` folder. diff --git a/packages/nx/src/adapter/ngcli-adapter.ts b/packages/nx/src/adapter/ngcli-adapter.ts index f201713bbccd0..e5576433262fd 100644 --- a/packages/nx/src/adapter/ngcli-adapter.ts +++ b/packages/nx/src/adapter/ngcli-adapter.ts @@ -816,9 +816,9 @@ let mockedSchematics = null; * * ```typescript * overrideCollectionResolutionForTesting({ - * '@nrwl/workspace': path.join(__dirname, '../../../../workspace/generators.json'), - * '@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'), - * '@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json') + * '@nx/workspace': path.join(__dirname, '../../../../workspace/generators.json'), + * '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), + * '@nx/linter': path.join(__dirname, '../../../../linter/generators.json') * }); * * ``` diff --git a/packages/nx/src/command-line/examples.ts b/packages/nx/src/command-line/examples.ts index 17135231f5262..ad84e327c6c84 100644 --- a/packages/nx/src/command-line/examples.ts +++ b/packages/nx/src/command-line/examples.ts @@ -248,9 +248,9 @@ export const examples: Record = { description: 'List the plugins installed in the current workspace', }, { - command: 'list @nrwl/web', + command: 'list @nx/web', description: - 'List the generators and executors available in the `@nrwl/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace)', + 'List the generators and executors available in the `@nx/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace)', }, ], 'run-many': [ @@ -299,15 +299,15 @@ export const examples: Record = { }, { command: - 'migrate @nrwl/workspace@9.0.0 --from="@nrwl/workspace@8.0.0,@nrwl/node@8.0.0"', + 'migrate @nx/workspace@9.0.0 --from="@nx/workspace@8.0.0,@nx/node@8.0.0"', description: - 'Update @nrwl/workspace and generate the list of migrations starting with version 8.0.0 of @nrwl/workspace and @nrwl/node, regardless of what is installed locally', + 'Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node, regardless of what is installed locally', }, { command: - 'migrate @nrwl/workspace@9.0.0 --to="@nrwl/react@9.0.1,@nrwl/angular@9.0.1"', + 'migrate @nx/workspace@9.0.0 --to="@nx/react@9.0.1,@nx/angular@9.0.1"', description: - 'Update @nrwl/workspace to "9.0.0". If it tries to update @nrwl/react or @nrwl/angular, use version "9.0.1"', + 'Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"', }, { command: 'migrate another-package@12.0.0', diff --git a/packages/nx/src/command-line/nx-commands.ts b/packages/nx/src/command-line/nx-commands.ts index 59899891f4d7d..508524b1ad551 100644 --- a/packages/nx/src/command-line/nx-commands.ts +++ b/packages/nx/src/command-line/nx-commands.ts @@ -30,7 +30,7 @@ export const commandsObject = yargs .command({ command: 'generate [_..]', describe: - 'Generate or update source code (e.g., nx generate @nrwl/js:lib mylib).', + 'Generate or update source code (e.g., nx generate @nx/js:lib mylib).', aliases: ['g'], builder: (yargs) => withGenerateOptions(yargs), handler: async (args) => { @@ -250,7 +250,7 @@ export const commandsObject = yargs .command({ command: 'migrate [packageAndVersion]', describe: `Creates a migrations file or runs migrations from the migrations file. - - Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest) + - Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest) - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.`, builder: (yargs) => linkToNxDevAndExamples(withMigrationOptions(yargs), 'migrate'), @@ -698,7 +698,7 @@ function withGenerateOptions(yargs: yargs.Argv) { process.argv[3] && !process.argv[3].startsWith('-'); const res = yargs .positional('generator', { - describe: 'Name of the generator (e.g., @nrwl/js:library, library)', + describe: 'Name of the generator (e.g., @nx/js:library, library)', type: 'string', required: true, }) @@ -800,7 +800,7 @@ function withMigrationOptions(yargs: yargs.Argv) { return yargs .positional('packageAndVersion', { - describe: `The target package and version (e.g, @nrwl/workspace@13.0.0)`, + describe: `The target package and version (e.g, @nx/workspace@13.0.0)`, type: 'string', }) .option('runMigrations', { @@ -814,12 +814,12 @@ function withMigrationOptions(yargs: yargs.Argv) { }) .option('from', { describe: - 'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nrwl/react@12.0.0,@nrwl/js@12.0.0")', + 'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@12.0.0,@nx/js@12.0.0")', type: 'string', }) .option('to', { describe: - 'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nrwl/react@12.0.0,@nrwl/js@12.0.0")', + 'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@12.0.0,@nx/js@12.0.0")', type: 'string', }) .option('createCommits', { diff --git a/packages/react-native/docs/build-android-examples.md b/packages/react-native/docs/build-android-examples.md index 4607fa70f1cce..93a509ae2cd91 100644 --- a/packages/react-native/docs/build-android-examples.md +++ b/packages/react-native/docs/build-android-examples.md @@ -7,7 +7,7 @@ "targets": { //... "build-android": { - "executor": "@nrwl/react-native:build-android", + "executor": "@nx/react-native:build-android", "outputs": [ "{projectRoot}/build/outputs/bundle", "{projectRoot}/build/outputs/apk" @@ -33,7 +33,7 @@ Pass in `installDebug` or `installRelease` to tasks, it will create a build with ```json "build-android": { - "executor": "@nrwl/react-native:build-android", + "executor": "@nx/react-native:build-android", "outputs": [ "{projectRoot}/build/outputs/bundle", "{projectRoot}/build/outputs/apk" @@ -51,7 +51,7 @@ The `mode` option allows you determine whether to build for debug/release apk. ```json "build-android": { - "executor": "@nrwl/react-native:build-android", + "executor": "@nx/react-native:build-android", "outputs": [ "{projectRoot}/build/outputs/bundle", "{projectRoot}/build/outputs/apk" @@ -69,7 +69,7 @@ The `activeArchOnly` option allows you to build native libraries only for the cu ```json "build-android": { - "executor": "@nrwl/react-native:build-android", + "executor": "@nx/react-native:build-android", "outputs": [ "{projectRoot}/build/outputs/bundle", "{projectRoot}/build/outputs/apk" diff --git a/packages/react-native/docs/build-ios-examples.md b/packages/react-native/docs/build-ios-examples.md index 1e3cd2bdcd256..a165a89dad362 100644 --- a/packages/react-native/docs/build-ios-examples.md +++ b/packages/react-native/docs/build-ios-examples.md @@ -7,7 +7,7 @@ "targets": { //... "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": {} } } @@ -26,7 +26,7 @@ The `buildFolder` option allows to specify the location for ios build artifacts. ```json "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": { "buildFolder": "dist/ios/build" } @@ -43,7 +43,7 @@ The `mode` option allows to specify the xcode configuartion, such as `Debug` or ```json "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": { "mode": "Release" } @@ -67,7 +67,7 @@ xcrun simctl list devices available ```json "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": { "simulator": "iPhone 14 Pro" } @@ -90,7 +90,7 @@ xcrun simctl list devices available ```json "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": { "device": "deviceName" } @@ -113,7 +113,7 @@ xcrun simctl list devices available ```json "build-ios": { - "executor": "@nrwl/react-native:build-ios", + "executor": "@nx/react-native:build-ios", "options": { "udid": "device udid" } diff --git a/packages/react-native/docs/bundle-examples.md b/packages/react-native/docs/bundle-examples.md index 5372b59dd8dbc..0933ebbff4741 100644 --- a/packages/react-native/docs/bundle-examples.md +++ b/packages/react-native/docs/bundle-examples.md @@ -7,7 +7,7 @@ "targets": { //... "bundle-ios": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "outputs": ["{projectRoot}/build"], "options": { "entryFile": "src/main.tsx", @@ -16,7 +16,7 @@ } }, "bundle-android": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "android", @@ -40,7 +40,7 @@ The `sourcemapOutput` option allows you to specify the path of the source map re ```json "bundle-ios": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "ios", @@ -49,7 +49,7 @@ The `sourcemapOutput` option allows you to specify the path of the source map re } }, "bundle-android": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "android", @@ -66,7 +66,7 @@ The `dev` option determines whether to create a dev or release bundle. The defau ```json "bundle-ios": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "ios", @@ -75,7 +75,7 @@ The `dev` option determines whether to create a dev or release bundle. The defau } }, "bundle-android": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "android", @@ -92,7 +92,7 @@ The `minify` option allows you to create a minified bundle: ```json "bundle-ios": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "ios", @@ -101,7 +101,7 @@ The `minify` option allows you to create a minified bundle: } }, "bundle-android": { - "executor": "@nrwl/react-native:bundle", + "executor": "@nx/react-native:bundle", "options": { "entryFile": "src/main.tsx", "platform": "android", diff --git a/packages/react-native/docs/run-android-examples.md b/packages/react-native/docs/run-android-examples.md index c963ee13196ee..6bb61a5e61e91 100644 --- a/packages/react-native/docs/run-android-examples.md +++ b/packages/react-native/docs/run-android-examples.md @@ -7,7 +7,7 @@ "targets": { //... "run-android": { - "executor": "@nrwl/react-native:run-android", + "executor": "@nx/react-native:run-android", "options": {} } } @@ -32,7 +32,7 @@ The `deviceId` option allows you to launch your android app in a specific device ```json "run-android": { - "executor": "@nrwl/react-native:run-android", + "executor": "@nx/react-native:run-android", "options": { "deviceId": "Pixel_5_API_30" } @@ -45,7 +45,7 @@ The `mode` option allows to specify the build variant, such as `debug` or `relea ```json "run-android": { - "executor": "@nrwl/react-native:run-android", + "executor": "@nx/react-native:run-android", "options": { "mode": "release" } diff --git a/packages/react-native/docs/run-ios-examples.md b/packages/react-native/docs/run-ios-examples.md index 0798e882981be..3dda0f3630c39 100644 --- a/packages/react-native/docs/run-ios-examples.md +++ b/packages/react-native/docs/run-ios-examples.md @@ -7,7 +7,7 @@ "targets": { //... "run-ios": { - "executor": "@nrwl/react-native:run-ios", + "executor": "@nx/react-native:run-ios", "options": {} } } @@ -26,7 +26,7 @@ The `mode` option allows to specify the xcode configuartion schema, such as `Deb ```json "run-ios": { - "executor": "@nrwl/react-native:run-ios", + "executor": "@nx/react-native:run-ios", "options": { "mode": "Release" } @@ -49,7 +49,7 @@ xcrun simctl list devices available ```json "run-ios": { - "executor": "@nrwl/react-native:run-ios", + "executor": "@nx/react-native:run-ios", "options": { "simulator": "iPhone 14 Pro (16.2)" } @@ -72,7 +72,7 @@ xcrun simctl list devices available ```json "run-ios": { - "executor": "@nrwl/react-native:run-ios", + "executor": "@nx/react-native:run-ios", "options": { "device": "deviceName" } @@ -95,7 +95,7 @@ xcrun simctl list devices available ```json "run-ios": { - "executor": "@nrwl/react-native:run-ios", + "executor": "@nx/react-native:run-ios", "options": { "udid": "device udid" } diff --git a/packages/react-native/docs/start-examples.md b/packages/react-native/docs/start-examples.md index 09b7f1a61097a..b89cf5b800ff5 100644 --- a/packages/react-native/docs/start-examples.md +++ b/packages/react-native/docs/start-examples.md @@ -7,7 +7,7 @@ "targets": { //... "start": { - "executor": "@nrwl/react-native:start", + "executor": "@nx/react-native:start", "options": { "port": 8081 } @@ -28,7 +28,7 @@ The `interactive` option allows you to specify whether to use interactive mode: ```json "start": { - "executor": "@nrwl/react-native:start", + "executor": "@nx/react-native:start", "options": { "port": 8081, "interactive": false @@ -43,7 +43,7 @@ The `resetCache` option allows you to remove cached files. ```json "start": { - "executor": "@nrwl/react-native:start", + "executor": "@nx/react-native:start", "options": { "port": 8081, "resetCache": true diff --git a/packages/react/docs/application-examples.md b/packages/react/docs/application-examples.md index b3314804eadd6..249dae784f7a8 100644 --- a/packages/react/docs/application-examples.md +++ b/packages/react/docs/application-examples.md @@ -6,7 +6,7 @@ Create an application named `my-app`: ```bash -nx g @nrwl/react:application my-app +nx g @nx/react:application my-app ``` {% /tab %} @@ -16,7 +16,7 @@ nx g @nrwl/react:application my-app Create an application named `my-app`: ```bash -nx g @nrwl/react:app my-app --bundler=vite +nx g @nx/react:app my-app --bundler=vite ``` {% /tab %} @@ -26,7 +26,7 @@ nx g @nrwl/react:app my-app --bundler=vite Create an application named `my-app` in the `my-dir` directory and use `scss` for styles: ```bash -nx g @nrwl/react:app my-app --directory=my-dir --style=scss +nx g @nx/react:app my-app --directory=my-dir --style=scss ``` {% /tab %} @@ -36,7 +36,7 @@ nx g @nrwl/react:app my-app --directory=my-dir --style=scss Add tags to the application (used for linting). ```bash -nx g @nrwl/react:app my-app --tags=scope:admin,type:ui +nx g @nx/react:app my-app --tags=scope:admin,type:ui ``` {% /tab %} diff --git a/packages/react/docs/component-test-examples.md b/packages/react/docs/component-test-examples.md index e775d3d48648d..acd83a07956e4 100644 --- a/packages/react/docs/component-test-examples.md +++ b/packages/react/docs/component-test-examples.md @@ -14,7 +14,7 @@ If you're wanting to create Storybook stories for a component, then check out th This generator is used to create a Cypress component test file for a given React component. ```shell -nx g @nrwl/react:component-test --project=my-cool-react-project --componentPath=src/my-fancy-button.tsx +nx g @nx/react:component-test --project=my-cool-react-project --componentPath=src/my-fancy-button.tsx ``` Test file are generated with the `.cy.` suffix. this is to prevent colliding with any existing `.spec.` files contained in the project. diff --git a/packages/react/docs/cypress-component-configuration-examples.md b/packages/react/docs/cypress-component-configuration-examples.md index bfca5fec7d733..2837823cdcee9 100644 --- a/packages/react/docs/cypress-component-configuration-examples.md +++ b/packages/react/docs/cypress-component-configuration-examples.md @@ -11,7 +11,7 @@ If you want to test components via Storybook with Cypress, then check out the [s This generator is designed to get your React project up and running with Cypress Component Testing. ```shell -nx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project +nx g @nx/react:cypress-component-configuration --project=my-cool-react-project ``` Running this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces. @@ -20,7 +20,7 @@ The following file will be added to projects where the Component Testing build t ```ts {% fileName="cypress.config.ts" %} import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/react/plugins/component-testing'; export default defineConfig({ component: nxComponentTestingPreset(__filename, { @@ -33,7 +33,7 @@ The following file will be added to projects where the Component Testing build t ```ts {% fileName="cypress.config.ts" %} import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/react/plugins/component-testing'; export default defineConfig({ component: nxComponentTestingPreset(__filename, { @@ -46,7 +46,7 @@ Here is an example on how to add custom options to the configuration ```ts {% fileName="cypress.config.ts" %} import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/react/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/react/plugins/component-testing'; export default defineConfig({ component: { @@ -60,7 +60,7 @@ export default defineConfig({ ## The `bundler` option -Component testing supports two different bundlers: `webpack` and `vite`. The Nx generator will pick up the bundler used in the specified project's build target. If the build target is using `@nrwl/webpack:webpack`, then the generator will use `webpack` as the bundler. If the build target is using `@nrwl/vite:build`, then the generator will use `vite` as the bundler. +Component testing supports two different bundlers: `webpack` and `vite`. The Nx generator will pick up the bundler used in the specified project's build target. If the build target is using `@nx/webpack:webpack`, then the generator will use `webpack` as the bundler. If the build target is using `@nx/vite:build`, then the generator will use `vite` as the bundler. You can manually set the bundler by passing `--bundler=webpack` or `--bundler=vite` to the generator, but that is not needed since the generator will pick up the correct bundler for you. However, if you want to use a different bundler than the one that is used in the build target, then you can manually set it using that flag. @@ -68,19 +68,19 @@ You can manually set the bundler by passing `--bundler=webpack` or `--bundler=vi Component testing requires a _build target_ to correctly run the component test dev server. This option can be manually specified with `--build-target=some-react-app:build`, but Nx will infer this usage from the [project graph](/concepts/mental-model#the-project-graph) if one isn't provided. -For React projects, the build target needs to be using the `@nrwl/webpack:webpack` executor. +For React projects, the build target needs to be using the `@nx/webpack:webpack` executor. The generator will throw an error if a build target can't be found and suggest passing one in manually. Letting Nx infer the build target by default ```shell -nx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project +nx g @nx/react:cypress-component-configuration --project=my-cool-react-project ``` Manually specifying the build target ```shell -nx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project --build-target:some-react-app:build --generate-tests +nx g @nx/react:cypress-component-configuration --project=my-cool-react-project --build-target:some-react-app:build --generate-tests ``` {% callout type="note" title="Build Target with Configuration" %} @@ -93,7 +93,7 @@ then manually providing `--build-target=my-app:build:production` is the best way You can optionally use the `--generate-tests` flag to generate a test file for each component in your project. ```shell -nx g @nrwl/react:cypress-component-configuration --project=my-cool-react-project --generate-tests +nx g @nx/react:cypress-component-configuration --project=my-cool-react-project --generate-tests ``` ## Running Component Tests @@ -110,7 +110,7 @@ Here is an example of the project configuration that is generated. The `--build- { "targets" { "component-test": { - "executor": "@nrwl/cypress:cypress", + "executor": "@nx/cypress:cypress", "options": { "cypressConfig": "/cypress.config.ts", "testingType": "component", diff --git a/packages/react/docs/stories-examples.md b/packages/react/docs/stories-examples.md index 2edae580a9b65..2767e07ac44a8 100644 --- a/packages/react/docs/stories-examples.md +++ b/packages/react/docs/stories-examples.md @@ -1,7 +1,7 @@ This generator will generate stories for all your components in your project. The stories will be generated using [Component Story Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). ```bash -nx g @nrwl/react:stories project-name +nx g @nx/react:stories project-name ``` You can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#auto-generate-stories). @@ -20,7 +20,7 @@ There are a number of other options available. Let's take a look at some example ### Ignore certain paths when generating stories ```bash -nx g @nrwl/react:stories --name=ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.* +nx g @nx/react:stories --name=ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.* ``` This will generate stories for all the components in the `ui` project, except for the ones in the `libs/ui/src/not-stories` directory, and also for components that their file name is of the pattern `*.other.*`. @@ -30,7 +30,7 @@ This is useful if you have a project that contains components that are not meant ### Generate stories using JavaScript instead of TypeScript ```bash -nx g @nrwl/react:stories --name=ui --js=true +nx g @nx/react:stories --name=ui --js=true ``` This will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components. diff --git a/packages/react/docs/storybook-configuration-examples.md b/packages/react/docs/storybook-configuration-examples.md index 620fc6a9c6dbf..5f97a75cab0f0 100644 --- a/packages/react/docs/storybook-configuration-examples.md +++ b/packages/react/docs/storybook-configuration-examples.md @@ -1,7 +1,7 @@ This generator will set up Storybook for your **React** project. You can also use this generator to generate Storybook configuration for your **Next.js** project. ```bash -nx g @nrwl/react:storybook-configuration project-name +nx g @nx/react:storybook-configuration project-name ``` You can read more about how this generator works, in the [Storybook for React overview page](/packages/storybook/documents/overview-react#generate-storybook-configuration-for-an-react-project). @@ -23,7 +23,7 @@ There are a number of other options available. Let's take a look at some example ### Generate Storybook configuration using TypeScript ```bash -nx g @nrwl/react:storybook-configuration ui --tsConfiguration=true +nx g @nx/react:storybook-configuration ui --tsConfiguration=true ``` This will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory). @@ -31,7 +31,7 @@ This will generate a Storybook configuration for the `ui` project using TypeScri ### Ignore certain paths when generating stories ```bash -nx g @nrwl/react:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts +nx g @nx/react:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts ``` This will generate a Storybook configuration for the `ui` project and generate stories for all components in the `libs/ui/src/lib` directory, except for the ones in the `libs/ui/src/not-stories` directory, and the ones in the `apps/my-app` directory that end with `.something.ts`, and also for components that their file name is of the pattern `*.other.*`. @@ -41,7 +41,7 @@ This is useful if you have a project that contains components that are not meant ### Generate stories using JavaScript instead of TypeScript ```bash -nx g @nrwl/react:storybook-configuration ui --generateStories=true --js=true +nx g @nx/react:storybook-configuration ui --generateStories=true --js=true ``` This will generate stories for all the components in the `ui` project using JavaScript instead of TypeScript. So, you will have `.stories.js` files next to your components. @@ -49,7 +49,7 @@ This will generate stories for all the components in the `ui` project using Java ### Generate Storybook configuration for Storybook version 7 ```bash -nx g @nrwl/react:storybook-configuration ui --storybook7Configuration=true +nx g @nx/react:storybook-configuration ui --storybook7Configuration=true ``` {% callout type="info" title="For Nx versions <15.9" %} diff --git a/packages/rollup/src/docs/rollup-examples.md b/packages/rollup/src/docs/rollup-examples.md index 6e27eb8671b2a..04c96a82d05aa 100644 --- a/packages/rollup/src/docs/rollup-examples.md +++ b/packages/rollup/src/docs/rollup-examples.md @@ -16,7 +16,7 @@ To have dependencies in the be listed in the final `package.json` of your projec { "targets": { "build": { - "executor": "@nrwl/rollup:rollup", + "executor": "@nx/rollup:rollup", "options": { "buildableProjectDepsInPackageJsonType": "dependencies", "updateBuildableProjectDepsInPackageJson": true diff --git a/packages/storybook/docs/build-storybook-executor-examples.md b/packages/storybook/docs/build-storybook-executor-examples.md index 1b873baff34c8..b8f2219f7eb88 100644 --- a/packages/storybook/docs/build-storybook-executor-examples.md +++ b/packages/storybook/docs/build-storybook-executor-examples.md @@ -1,6 +1,6 @@ --- title: Storybook builder executor examples -description: This page contains examples for the @nrwl/storybook:build executor. +description: This page contains examples for the @nx/storybook:build executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the @nrwl/storybook:build executor. "targets": { //... "build-storybook": { - "executor": "@nrwl/storybook:build", + "executor": "@nx/storybook:build", "outputs": ["{options.outputDir}"], "options": { "outputDir": "dist/storybook/ui", @@ -43,7 +43,7 @@ Read more on the [Storybook documentation page for `addon-docs`](https://storybo ```json "storybook": { - "executor": "@nrwl/storybook:build", + "executor": "@nx/storybook:build", "options": { "port": 4400, "configDir": "libs/ui/.storybook", diff --git a/packages/storybook/docs/configuration-generator-examples.md b/packages/storybook/docs/configuration-generator-examples.md index 150bfa5337847..635f4b415a8fc 100644 --- a/packages/storybook/docs/configuration-generator-examples.md +++ b/packages/storybook/docs/configuration-generator-examples.md @@ -1,12 +1,12 @@ --- title: Storybook configuration generator examples -description: This page contains examples for the @nrwl/storybook:configuration generator. +description: This page contains examples for the @nx/storybook:configuration generator. --- This is a framework-agnostic generator for setting up Storybook configuration for a project. ```bash -nx g @nrwl/storybook:configuration +nx g @nx/storybook:configuration ``` Nx will understand if you're using Storybook v7 or Storybook v6 and configure your project accordingly. By default, it will try to use Storybook v7. @@ -51,7 +51,7 @@ If you are using Angular, React, React Native or Next.js in your project, it's b ### Generate Storybook configuration using TypeScript ```bash -nx g @nrwl/storybook:configuration ui --storybook7UiFramework=@storybook/web-components-vite --tsConfiguration=true +nx g @nx/storybook:configuration ui --storybook7UiFramework=@storybook/web-components-vite --tsConfiguration=true ``` This will generate a Storybook configuration for the `ui` project using TypeScript for the Storybook configuration files (the files inside the `.storybook` directory). @@ -61,7 +61,7 @@ This will generate a Storybook configuration for the `ui` project using TypeScri If, for somem reason, you want to force Nx to generate Storybook version 6 configuration, you can do so by passing false to the `storybook7Configuration` flag: ```bash -nx g @nrwl/storybook:configuration ui --uiFramework=@storybook/react --storybook7Configuration=false +nx g @nx/storybook:configuration ui --uiFramework=@storybook/react --storybook7Configuration=false ``` However, this is **NOT recommended**. diff --git a/packages/storybook/docs/migrate-7-generator-examples.md b/packages/storybook/docs/migrate-7-generator-examples.md index c5cad4e4195c9..5e3f253772df0 100644 --- a/packages/storybook/docs/migrate-7-generator-examples.md +++ b/packages/storybook/docs/migrate-7-generator-examples.md @@ -1,6 +1,6 @@ --- title: Storybook 7 Migration Generator Examples -description: This page contains examples for the @nrwl/storybook:migrate-7 generator. +description: This page contains examples for the @nx/storybook:migrate-7 generator. --- {% callout type="info" title="Available on Nx v15.9" %} @@ -13,14 +13,14 @@ For setting up Storybook version 7 in a new Nx workspace, or a workspace that do Storybook 7 is a major release that brings a lot of new features and improvements. You can read more about it in the [Storybook 7.0.0 release article](https://storybook.js.org/blog/storybook-7-0/). Apart from the new features and improvements it introduces, it also brings some breaking changes. You can read more about them in the [Storybook 7 migration docs](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700) and the [Storybook 7.0.0 migration guide](https://storybook.js.org/docs/react/migration-guide). -You can now migrate your existing Nx workspace with Storybook configuration to use Storybook version 7. To help you, Nx offers the `@nrwl/storybook:migrate-7` generator. This generator will help you migrate your existing Storybook setup to version 7. +You can now migrate your existing Nx workspace with Storybook configuration to use Storybook version 7. To help you, Nx offers the `@nx/storybook:migrate-7` generator. This generator will help you migrate your existing Storybook setup to version 7. ## How to use it Just call: ```bash -npx nx g @nrwl/storybook:migrate-7 +npx nx g @nx/storybook:migrate-7 ``` {% callout type="warning" title="Commit your changes" %} @@ -104,7 +104,7 @@ npx nx storybook PROJECT_NAME You can run the generator with the `--autoAcceptAllPrompts` flag, which will automatically accept all the Storybook CLI prompts. This is useful if you want to run the generator in a CI environment, or if you want to run the generator in a script. Or if you are sure that you want to accept all the prompts! ```bash -npx nx g @nrwl/storybook:migrate-7 --autoAcceptAllPrompts +npx nx g @nx/storybook:migrate-7 --autoAcceptAllPrompts ``` The Storybook CLI may still ask you about some things, but mostly it should just run the whole migration suite uninterrupted. @@ -114,24 +114,24 @@ The Storybook CLI may still ask you about some things, but mostly it should just Nx gives you the ability to run all the migration steps one by one, manually, but still with the help of our migrator. To help you out with the commands that you need to run, Nx will print out the instructions if you run the generator with the `--onlyShowListOfCommands` flag, like this: ```bash -npx nx g @nrwl/storybook:migrate-7 --onlyShowListOfCommands +npx nx g @nx/storybook:migrate-7 --onlyShowListOfCommands ``` Essentially, the way to run the migration manually is the following: 1. Call the Nx generator to show you the list of commands: - `npx nx g @nrwl/storybook:migrate-7 --onlyShowListOfCommands` + `npx nx g @nx/storybook:migrate-7 --onlyShowListOfCommands` 2. Call the Storybook upgrade script: `npx storybook@latest upgrade` 3. Call the Nx generator to prepare your files for migration. The steps are explained in [Step 02](#step-02) above. - `nx g @nrwl/storybook:migrate-7 --onlyPrepare` -4. Call the Storybook automigrate scripts for each one of the projects using Storybook (the `@nrwl/storybook:migrate-7` will give you the list of all the commands) + `nx g @nx/storybook:migrate-7 --onlyPrepare` +4. Call the Storybook automigrate scripts for each one of the projects using Storybook (the `@nx/storybook:migrate-7` will give you the list of all the commands) 5. Call the Nx generator to finish the migration. The steps are explained in [Step 04](#step-04) above. - `nx g @nrwl/storybook:migrate-7 --afterMigration` + `nx g @nx/storybook:migrate-7 --afterMigration` ## How the generator works under the hood -Now let's see how the `@nrwl/storybook:migrate-7` generator works under the hood. It essentially does the following things: +Now let's see how the `@nx/storybook:migrate-7` generator works under the hood. It essentially does the following things: ### Step 01 @@ -179,7 +179,7 @@ You can migrate to Storybook 7 by just using the [Storybook `upgrade` and `autom First, you would have to run the `npx storybook@latest upgrade` to get the latest versions of all the `@storybook/*` packages. Then, for each one of your projects that use Storybook, you would have to run `npx storybook@latest automigrate --config-dir /.storybook --renderer @storybook/`. -The `@nrwl/storybook:migrate-7` generator helps you by figuring out all the project paths and the renderers that need to be passed in the `automigrate` script, and also by performing a number of adjustments to your code to make sure the migration scripts run smoothly, so it is recommended to use the generator instead of running the scripts manually. +The `@nx/storybook:migrate-7` generator helps you by figuring out all the project paths and the renderers that need to be passed in the `automigrate` script, and also by performing a number of adjustments to your code to make sure the migration scripts run smoothly, so it is recommended to use the generator instead of running the scripts manually. ## Report any issues and bugs diff --git a/packages/storybook/docs/storybook-executor-examples.md b/packages/storybook/docs/storybook-executor-examples.md index 1c343ecef8f60..289b6c17ad6ea 100644 --- a/packages/storybook/docs/storybook-executor-examples.md +++ b/packages/storybook/docs/storybook-executor-examples.md @@ -1,6 +1,6 @@ --- title: Storybook dev server executor examples -description: This page contains examples for the @nrwl/storybook:storybook executor. +description: This page contains examples for the @nx/storybook:storybook executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the @nrwl/storybook:storybook execu "targets": { //... "storybook": { - "executor": "@nrwl/storybook:storybook", + "executor": "@nx/storybook:storybook", "options": { "port": 4400, "configDir": "libs/ui/.storybook" @@ -43,7 +43,7 @@ Read more on the [Storybook documentation page for `addon-docs`](https://storybo ```json "storybook": { - "executor": "@nrwl/storybook:storybook", + "executor": "@nx/storybook:storybook", "options": { "port": 4400, "configDir": "libs/ui/.storybook", diff --git a/packages/vite/docs/build-examples.md b/packages/vite/docs/build-examples.md index 5aa083ec10437..234885748336f 100644 --- a/packages/vite/docs/build-examples.md +++ b/packages/vite/docs/build-examples.md @@ -1,6 +1,6 @@ --- title: Examples for the Vite builder executor -description: This page contains examples for the Vite @nrwl/vite:build executor. +description: This page contains examples for the Vite @nx/vite:build executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the Vite @nrwl/vite:build executor. "targets": { //... "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", //... //... "options": { @@ -41,7 +41,7 @@ Nx will automatically look in the root of your application for a `vite.config.ts "targets": { //... "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", //... "options": { "outputPath": "dist/apps/my-app", @@ -63,7 +63,7 @@ or even "targets": { //... "build": { - "executor": "@nrwl/vite:build", + "executor": "@nx/vite:build", //... "options": { "outputPath": "dist/apps/my-app", diff --git a/packages/vite/docs/configuration-examples.md b/packages/vite/docs/configuration-examples.md index 9b858d27bca0e..896d1fd5a4163 100644 --- a/packages/vite/docs/configuration-examples.md +++ b/packages/vite/docs/configuration-examples.md @@ -1,18 +1,18 @@ --- title: Examples for the Vite configuration generator -description: This page contains examples for the Vite @nrwl/vite:configuration generator, which helps you set up Vite on your Nx workspace, or convert an existing project to use Vite. +description: This page contains examples for the Vite @nx/vite:configuration generator, which helps you set up Vite on your Nx workspace, or convert an existing project to use Vite. --- -This generator is used for converting an existing React or Web project to use [Vite.js](https://vitejs.dev/) and the [@nrwl/vite executors](/packages/vite#executors). +This generator is used for converting an existing React or Web project to use [Vite.js](https://vitejs.dev/) and the [@nx/vite executors](/packages/vite#executors). -It will change the `build` and `serve` targets to use the `@nrwl/vite` executors for serving and building the application. If you choose so, it will also change your `test` target to use the `@nrwl/vite:test` executor. It will create a `vite.config.ts` file at the root of your project with the correct settings, or if there's already a `vite.config.ts` file, it will modify it to include the correct settings. +It will change the `build` and `serve` targets to use the `@nx/vite` executors for serving and building the application. If you choose so, it will also change your `test` target to use the `@nx/vite:test` executor. It will create a `vite.config.ts` file at the root of your project with the correct settings, or if there's already a `vite.config.ts` file, it will modify it to include the correct settings. {% callout type="caution" title="Your code will be modified!" %} This generator will modify your code, so make sure to commit your changes before running it. {% /callout %} ```bash -nx g @nrwl/vite:configuration +nx g @nx/vite:configuration ``` When running this generator, you will be prompted to provide the following: @@ -22,59 +22,59 @@ When running this generator, you will be prompted to provide the following: You must provide a `project` and a `uiFramework` for the generator to work. -You may also pass the `includeVitest` flag. This will also change your `test` target to use the `@nrwl/vite:test` executor, and configure your project for testing with [Vitest](https://vitest.dev/), by adding the `test` configuration in your `vite.config.ts` file. +You may also pass the `includeVitest` flag. This will also change your `test` target to use the `@nx/vite:test` executor, and configure your project for testing with [Vitest](https://vitest.dev/), by adding the `test` configuration in your `vite.config.ts` file. ## Converting custom (specific) targets -By default, the `@nrwl/vite:configuration` generator will search your project's configuration to find the targets for serving, building, and testing your project, and it will attempt to convert these targets to use the `@nrwl/vite` executors. +By default, the `@nx/vite:configuration` generator will search your project's configuration to find the targets for serving, building, and testing your project, and it will attempt to convert these targets to use the `@nx/vite` executors. Your targets for building, serving and testing may not be named `build`, `serve` and `test`. Nx will try to infer the correct targets to convert, and it will attempt to convert the first one it finds for each of these actions if you have more than one. If you have more than one target for serving, building, or testing your project, you can pass the `--serveTarget`, `--buildTarget`, and `--testTarget` flags to the generator, to tell Nx specifically which targets to convert. -Nx will determine if the targets you provided (or the ones it inferred) are valid and can be converted to use the `@nrwl/vite` executors. If the targets are not valid, the generator will fail. If no targets are found - or recognized to be either supported or unsupported - Nx will ask you whether you want to convert your project anyway. If you choose to do so, Nx will configure your project to use Vite.js, creating new targets for you, and creating or modifying your `vite.config.ts` file. You can then test on your own if the result works or not, and modify the configuration as needed. It's suggested that if Nx does not recognize your targets automatically, you commit your changes before running the generator, so you can revert the changes if needed. +Nx will determine if the targets you provided (or the ones it inferred) are valid and can be converted to use the `@nx/vite` executors. If the targets are not valid, the generator will fail. If no targets are found - or recognized to be either supported or unsupported - Nx will ask you whether you want to convert your project anyway. If you choose to do so, Nx will configure your project to use Vite.js, creating new targets for you, and creating or modifying your `vite.config.ts` file. You can then test on your own if the result works or not, and modify the configuration as needed. It's suggested that if Nx does not recognize your targets automatically, you commit your changes before running the generator, so you can revert the changes if needed. -## Projects that can be converted to use the `@nrwl/vite` executors +## Projects that can be converted to use the `@nx/vite` executors -Usually, React and Web projects generated with the `@nrwl/react` and the `@nrwl/web` generators can be converted to use the `@nrwl/vite` executors without any issues. +Usually, React and Web projects generated with the `@nx/react` and the `@nx/web` generators can be converted to use the `@nx/vite` executors without any issues. -The list of executors for building, testing and serving that can be converted to use the `@nrwl/vite` executors is: +The list of executors for building, testing and serving that can be converted to use the `@nx/vite` executors is: ### Supported `build` executors - `@nxext/vite:build` -- `@nrwl/js:babel` -- `@nrwl/js:swc` -- `@nrwl/webpack:webpack` -- `@nrwl/rollup:rollup` -- `@nrwl/web:rollup` +- `@nx/js:babel` +- `@nx/js:swc` +- `@nx/webpack:webpack` +- `@nx/rollup:rollup` +- `@nx/web:rollup` ### Supported `serve` executors - `@nxext/vite:dev` -- `@nrwl/webpack:dev-server` +- `@nx/webpack:dev-server` ### Supported `test` executors -- `@nrwl/jest:jest` +- `@nx/jest:jest` - `@nxext/vitest:vitest` ### Unsupported executors -- `@nrwl/angular:ng-packagr-lite` -- `@nrwl/angular:package` -- `@nrwl/angular:webpack-browser` +- `@nx/angular:ng-packagr-lite` +- `@nx/angular:package` +- `@nx/angular:webpack-browser` - `@angular-devkit/build-angular:browser` - `@angular-devkit/build-angular:dev-server` -- `@nrwl/esbuild:esbuild` -- `@nrwl/react-native:start` -- `@nrwl/next:build` -- `@nrwl/next:server` -- `@nrwl/js:tsc` +- `@nx/esbuild:esbuild` +- `@nx/react-native:start` +- `@nx/next:build` +- `@nx/next:server` +- `@nx/js:tsc` - any executor _not_ listed in the lists of "supported executors" - any project that does _not_ have a target for building, serving or testing -We **cannot** guarantee that projects using unsupported executors - _or any executor that is NOT listed in the list of "supported executors"_ - for either building, testing or serving will work correctly when converted to use the `@nrwl/vite` executors. +We **cannot** guarantee that projects using unsupported executors - _or any executor that is NOT listed in the list of "supported executors"_ - for either building, testing or serving will work correctly when converted to use the `@nx/vite` executors. -If you have a project that does _not_ use one of the supported executors you can try to [configure it to use the `@nrwl/vite` executors manually](/packages/vite/documents/set-up-vite-manually), but it may not work properly. +If you have a project that does _not_ use one of the supported executors you can try to [configure it to use the `@nx/vite` executors manually](/packages/vite/documents/set-up-vite-manually), but it may not work properly. You can read more in the [Vite package overview page](/packages/vite). @@ -83,23 +83,23 @@ You can read more in the [Vite package overview page](/packages/vite). ### Change a React app to use Vite ```bash -nx g @nrwl/vite:configuration --project=my-react-app --uiFramework=react --includeVitest +nx g @nx/vite:configuration --project=my-react-app --uiFramework=react --includeVitest ``` -This will change the `my-react-app` project to use the `@nrwl/vite` executors for building, serving and testing the application. +This will change the `my-react-app` project to use the `@nx/vite` executors for building, serving and testing the application. ### Change a Web app to use Vite ```bash -nx g @nrwl/vite:configuration --project=my-web-app --uiFramework=none --includeVitest +nx g @nx/vite:configuration --project=my-web-app --uiFramework=none --includeVitest ``` -This will change the `my-web-app` project to use the `@nrwl/vite` executors for building, serving and testing the application. +This will change the `my-web-app` project to use the `@nx/vite` executors for building, serving and testing the application. ### Change only my custom provided targets to use Vite ```bash -nx g @nrwl/vite:configuration --project=my-react-app --uiFramework=react --includeVitest --buildTarget=my-build --serveTarget=my-serve --testTarget=my-test +nx g @nx/vite:configuration --project=my-react-app --uiFramework=react --includeVitest --buildTarget=my-build --serveTarget=my-serve --testTarget=my-test ``` -This will change the `my-build`, `my-serve` and `my-test` targets to use the `@nrwl/vite` executors for building, serving and testing the application, even if you have other targets for these actions as well. +This will change the `my-build`, `my-serve` and `my-test` targets to use the `@nx/vite` executors for building, serving and testing the application, even if you have other targets for these actions as well. diff --git a/packages/vite/docs/dev-server-examples.md b/packages/vite/docs/dev-server-examples.md index c6b1a0a27b803..9468502ba52f9 100644 --- a/packages/vite/docs/dev-server-examples.md +++ b/packages/vite/docs/dev-server-examples.md @@ -1,6 +1,6 @@ --- title: Examples for the Vite dev server executor -description: This page contains examples for the Vite @nrwl/vite:dev-server executor. +description: This page contains examples for the Vite @nx/vite:dev-server executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the Vite @nrwl/vite:dev-server exec "targets": { //... "serve": { - "executor": "@nrwl/vite:dev-server", + "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -41,7 +41,7 @@ You can always set the port in your `vite.config.ts` file. However, you can also "targets": { //... "serve": { - "executor": "@nrwl/vite:dev-server", + "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -66,7 +66,7 @@ You can specify a proxy config by pointing to the path of your proxy configurati "targets": { //... "serve": { - "executor": "@nrwl/vite:dev-server", + "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", diff --git a/packages/vite/docs/init-examples.md b/packages/vite/docs/init-examples.md index 27c2c9a6a728a..40aa5586be960 100644 --- a/packages/vite/docs/init-examples.md +++ b/packages/vite/docs/init-examples.md @@ -1,6 +1,6 @@ --- title: Examples for the Vite init generator -description: This page contains examples for the Vite @nrwl/vite:init generator, which helps you initialize vite in your Nx workspace, by installing the necessary dependencies. +description: This page contains examples for the Vite @nx/vite:init generator, which helps you initialize vite in your Nx workspace, by installing the necessary dependencies. --- This is a generator will initialize Vite.js in your workspace. It will install all the necessary dependencies. You can read more about how this generator works, in the [Vite package overview page](/packages/vite). @@ -9,12 +9,12 @@ This is a generator will initialize Vite.js in your workspace. It will install a You don't need to use this generator on its own. {% /callout %} -This generator will be called automatically when you are either converting an existing React or Web app to use Vite, using the [`@nrwl/vite:configuration` generator](/packages/vite/generators/configuration), or when you are creating a new React or Web app using the [`@nrwl/react:app`](/packages/react/generators/application) or [`@nrwl/web:app`](/packages/web/generators/application) generators, if you choose `vite` as the `bundler`. +This generator will be called automatically when you are either converting an existing React or Web app to use Vite, using the [`@nx/vite:configuration` generator](/packages/vite/generators/configuration), or when you are creating a new React or Web app using the [`@nx/react:app`](/packages/react/generators/application) or [`@nx/web:app`](/packages/web/generators/application) generators, if you choose `vite` as the `bundler`. If you need to for some reason, you can use it on its own like this: ```bash -nx g @nrwl/vite:init +nx g @nx/vite:init ``` ## Examples @@ -22,11 +22,11 @@ nx g @nrwl/vite:init ### Install all the necessary dependencies for Vite and the React plugin ```bash -nx g @nrwl/vite:init --uiFramework=react +nx g @nx/vite:init --uiFramework=react ``` ### Install all the necessary dependencies for Vite ```bash -nx g @nrwl/vite:init --uiFramework=none +nx g @nx/vite:init --uiFramework=none ``` diff --git a/packages/vite/docs/preview-server-examples.md b/packages/vite/docs/preview-server-examples.md index cb3975e10ec4e..b5f049fe33420 100644 --- a/packages/vite/docs/preview-server-examples.md +++ b/packages/vite/docs/preview-server-examples.md @@ -1,6 +1,6 @@ --- title: Examples for the Vite preview server executor -description: This page contains examples for the Vite @nrwl/vite:preview-server executor. +description: This page contains examples for the Vite @nx/vite:preview-server executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the Vite @nrwl/vite:preview-server "targets": { //... "preview": { - "executor": "@nrwl/vite:preview-server", + "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -41,7 +41,7 @@ You can always set the port in your `vite.config.ts` file. However, you can also "targets": { //... "preview": { - "executor": "@nrwl/vite:preview-server", + "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", @@ -66,7 +66,7 @@ You can specify a proxy config by pointing to the path of your proxy configurati "targets": { //... "preview": { - "executor": "@nrwl/vite:preview-server", + "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", diff --git a/packages/vite/docs/test-examples.md b/packages/vite/docs/test-examples.md index 256673318eb50..e624a40cbdbff 100644 --- a/packages/vite/docs/test-examples.md +++ b/packages/vite/docs/test-examples.md @@ -1,6 +1,6 @@ --- title: Examples for the Vitest executor -description: This page contains examples for the Vitest @nrwl/vite:test executor. +description: This page contains examples for the Vitest @nx/vite:test executor. --- `project.json`: @@ -11,7 +11,7 @@ description: This page contains examples for the Vitest @nrwl/vite:test executor "targets": { //... "test": { - "executor": "@nrwl/vite:test", + "executor": "@nx/vite:test", //... //... "options": { @@ -39,7 +39,7 @@ To run testing in watch mode, you can create a new configuration within your tes "targets": { //... "test": { - "executor": "@nrwl/vite:test", + "executor": "@nx/vite:test", //... //... "options": { diff --git a/packages/web/docs/application-examples.md b/packages/web/docs/application-examples.md index abc396b3a1ad5..5e8af3de91c66 100644 --- a/packages/web/docs/application-examples.md +++ b/packages/web/docs/application-examples.md @@ -6,7 +6,7 @@ Create an application named `my-app`: ```bash -nx g @nrwl/web:application my-app +nx g @nx/web:application my-app ``` {% /tab %} @@ -16,7 +16,7 @@ nx g @nrwl/web:application my-app Create an application named `my-app`: ```bash -nx g @nrwl/web:app my-app --bundler=vite +nx g @nx/web:app my-app --bundler=vite ``` {% /tab %} @@ -26,7 +26,7 @@ nx g @nrwl/web:app my-app --bundler=vite Create an application named `my-app` in the `my-dir` directory: ```bash -nx g @nrwl/web:app my-app --directory=my-dir +nx g @nx/web:app my-app --directory=my-dir ``` {% /tab %} @@ -36,7 +36,7 @@ nx g @nrwl/web:app my-app --directory=my-dir Add tags to the application (used for linting). ```bash -nx g @nrwl/web:app my-app --tags=scope:admin,type:ui +nx g @nx/web:app my-app --tags=scope:admin,type:ui ``` {% /tab %} diff --git a/packages/webpack/docs/webpack-build-executor-examples.md b/packages/webpack/docs/webpack-build-executor-examples.md index 0efb58c389b65..bdc3d21fd98a7 100644 --- a/packages/webpack/docs/webpack-build-executor-examples.md +++ b/packages/webpack/docs/webpack-build-executor-examples.md @@ -1,6 +1,6 @@ --- -title: Examples for the @nrwl/webpack:webpack build executor -description: Examples and a short guide on how to use the @nrwl/webpack:webpack build executor +title: Examples for the @nx/webpack:webpack build executor +description: Examples and a short guide on how to use the @nx/webpack:webpack build executor --- `project.json`: @@ -11,7 +11,7 @@ description: Examples and a short guide on how to use the @nrwl/webpack:webpack "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... //... "options": { @@ -48,7 +48,7 @@ Setting `babelUpwardRootMode` to `true` will cause issues in the case where you "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -74,7 +74,7 @@ If you have not set `babelUpwardRootMode` to `true` in your `project.json` file, "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -102,7 +102,7 @@ You can configure Webpack using a `webpack.config.js` file. If you do so, you ca "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... @@ -136,7 +136,7 @@ Set `isolatedConfig` to `true` in your `project.json` file in the `build` target "targets": { //... "build": { - "executor": "@nrwl/webpack:webpack", + "executor": "@nx/webpack:webpack", //... "options": { //... diff --git a/scripts/documentation/package-schemas/package-metadata.ts b/scripts/documentation/package-schemas/package-metadata.ts index 65f953944f599..4bceb845bacdf 100644 --- a/scripts/documentation/package-schemas/package-metadata.ts +++ b/scripts/documentation/package-schemas/package-metadata.ts @@ -129,11 +129,7 @@ export function getPackageMetadataList( return { githubRoot: 'https://github.com/nrwl/nx/blob/master', name: folderName, - // TODO(v16): Remove this replace - packageName: packageJson.name - .replace('@nx/', '@nrwl/') - .replace('@nrwl/eslint-plugin', '@nrwl/eslint-plugin-nx') - .replace('@nrwl/plugin', '@nrwl/nx-plugin'), + packageName: packageJson.name, description: packageJson.description, root: relativeFolderPath, source: join(relativeFolderPath, '/src'), diff --git a/scripts/readme-fragments/links.md b/scripts/readme-fragments/links.md index 96fd58b3d2a5f..9c332539b3be7 100644 --- a/scripts/readme-fragments/links.md +++ b/scripts/readme-fragments/links.md @@ -1,11 +1,11 @@
[![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx) -[![License](https://img.shields.io/npm/l/@nrwl/workspace.svg?style=flat-square)]() -[![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nrwl/workspace) +[![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]() +[![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nx/workspace) [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]() [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Join us @nrwl/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc) +[![Join us @nx/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)