diff --git a/docs/generated/packages/add-nx-to-monorepo.json b/docs/generated/packages/add-nx-to-monorepo.json index 0de1cd3f86..7e9b8a3730 100644 --- a/docs/generated/packages/add-nx-to-monorepo.json +++ b/docs/generated/packages/add-nx-to-monorepo.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "add-nx-to-monorepo", + "packageName": "add-nx-to-monorepo", "description": "Make any monorepo faster by adding Nx to it", "root": "/packages/add-nx-to-monorepo", "source": "/packages/add-nx-to-monorepo/src", diff --git a/docs/generated/packages/angular.json b/docs/generated/packages/angular.json index bfce7ca3c3..8a65db83bd 100644 --- a/docs/generated/packages/angular.json +++ b/docs/generated/packages/angular.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "angular", + "packageName": "@nrwl/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, Cypress, Karma, and Protractor. \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.", "root": "/packages/angular", "source": "/packages/angular/src", diff --git a/docs/generated/packages/cra-to-nx.json b/docs/generated/packages/cra-to-nx.json index 067d592f95..dae3cb2ed6 100644 --- a/docs/generated/packages/cra-to-nx.json +++ b/docs/generated/packages/cra-to-nx.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "cra-to-nx", + "packageName": "cra-to-nx", "root": "/packages/cra-to-nx", "source": "/packages/cra-to-nx/src", "documentation": [], diff --git a/docs/generated/packages/create-nx-plugin.json b/docs/generated/packages/create-nx-plugin.json index b9145ceae6..21716cb30b 100644 --- a/docs/generated/packages/create-nx-plugin.json +++ b/docs/generated/packages/create-nx-plugin.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "create-nx-plugin", + "packageName": "create-nx-plugin", "description": "Smart, Fast and Extensible Build System", "root": "/packages/create-nx-plugin", "source": "/packages/create-nx-plugin/src", diff --git a/docs/generated/packages/create-nx-workspace.json b/docs/generated/packages/create-nx-workspace.json index a4e2083ff9..39bd472e25 100644 --- a/docs/generated/packages/create-nx-workspace.json +++ b/docs/generated/packages/create-nx-workspace.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "create-nx-workspace", + "packageName": "create-nx-workspace", "description": "Smart, Fast and Extensible Build System", "root": "/packages/create-nx-workspace", "source": "/packages/create-nx-workspace/src", diff --git a/docs/generated/packages/cypress.json b/docs/generated/packages/cypress.json index a6a46096bd..e9d58079f9 100644 --- a/docs/generated/packages/cypress.json +++ b/docs/generated/packages/cypress.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "cypress", + "packageName": "@nrwl/cypress", "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.", "root": "/packages/cypress", "source": "/packages/cypress/src", diff --git a/docs/generated/packages/detox.json b/docs/generated/packages/detox.json index 803a4c9a70..ce10ccbd52 100644 --- a/docs/generated/packages/detox.json +++ b/docs/generated/packages/detox.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "detox", + "packageName": "@nrwl/detox", "description": "The Nx Plugin for Detox that contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.", "root": "/packages/detox", "source": "/packages/detox/src", diff --git a/docs/generated/packages/devkit.json b/docs/generated/packages/devkit.json index 52c1ee5d67..9ec3aa6bc0 100644 --- a/docs/generated/packages/devkit.json +++ b/docs/generated/packages/devkit.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "devkit", + "packageName": "@nrwl/devkit", "description": "Smart, Fast and Extensible Build System", "root": "/packages/devkit", "source": "/packages/devkit/src", diff --git a/docs/generated/packages/eslint-plugin-nx.json b/docs/generated/packages/eslint-plugin-nx.json index 639247353e..687879fc6b 100644 --- a/docs/generated/packages/eslint-plugin-nx.json +++ b/docs/generated/packages/eslint-plugin-nx.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "eslint-plugin-nx", + "packageName": "@nrwl/eslint-plugin-nx", "description": "ESLint Plugin for Nx", "root": "/packages/eslint-plugin-nx", "source": "/packages/eslint-plugin-nx/src", diff --git a/docs/generated/packages/express.json b/docs/generated/packages/express.json index 4a9cfad3de..c50decba42 100644 --- a/docs/generated/packages/express.json +++ b/docs/generated/packages/express.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "express", + "packageName": "@nrwl/express", "description": "The Nx Plugin for Express that contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.", "root": "/packages/express", "source": "/packages/express/src", diff --git a/docs/generated/packages/jest.json b/docs/generated/packages/jest.json index 6589f171ba..87b43c62c4 100644 --- a/docs/generated/packages/jest.json +++ b/docs/generated/packages/jest.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "jest", + "packageName": "@nrwl/jest", "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.", "root": "/packages/jest", "source": "/packages/jest/src", diff --git a/docs/generated/packages/js.json b/docs/generated/packages/js.json index de2bce7e24..1951eee365 100644 --- a/docs/generated/packages/js.json +++ b/docs/generated/packages/js.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "js", + "packageName": "@nrwl/js", "description": "The Nx plugin that provides the best experience for developing JavaScript and TypeScript projects.", "root": "/packages/js", "source": "/packages/js/src", diff --git a/docs/generated/packages/linter.json b/docs/generated/packages/linter.json index 41c5fc7add..5a0594f9f3 100644 --- a/docs/generated/packages/linter.json +++ b/docs/generated/packages/linter.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "linter", + "packageName": "@nrwl/linter", "description": "The Linter plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", "root": "/packages/linter", "source": "/packages/linter/src", diff --git a/docs/generated/packages/make-angular-cli-faster.json b/docs/generated/packages/make-angular-cli-faster.json index 0eb00d57e9..289a5449a3 100644 --- a/docs/generated/packages/make-angular-cli-faster.json +++ b/docs/generated/packages/make-angular-cli-faster.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "make-angular-cli-faster", + "packageName": "make-angular-cli-faster", "description": "Make Angular CLI faster by enabling distributed computation caching", "root": "/packages/make-angular-cli-faster", "source": "/packages/make-angular-cli-faster/src", diff --git a/docs/generated/packages/nest.json b/docs/generated/packages/nest.json index b8de564c33..821b22278f 100644 --- a/docs/generated/packages/nest.json +++ b/docs/generated/packages/nest.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nest", + "packageName": "@nrwl/nest", "description": "The Nx Plugin for Nest that contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.", "root": "/packages/nest", "source": "/packages/nest/src", diff --git a/docs/generated/packages/next.json b/docs/generated/packages/next.json index ae8f262fbe..c8f7bd5d05 100644 --- a/docs/generated/packages/next.json +++ b/docs/generated/packages/next.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "next", + "packageName": "@nrwl/next", "description": "When 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.\n\nThe Next.js plugin 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.", "root": "/packages/next", "source": "/packages/next/src", diff --git a/docs/generated/packages/node.json b/docs/generated/packages/node.json index aba8267776..03f12d0032 100644 --- a/docs/generated/packages/node.json +++ b/docs/generated/packages/node.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "node", + "packageName": "@nrwl/node", "description": "The Node Plugin contains generators and executors to manage Node applications within an Nx workspace.", "root": "/packages/node", "source": "/packages/node/src", diff --git a/docs/generated/packages/nx-plugin.json b/docs/generated/packages/nx-plugin.json index 32341fa560..6a6e0c05fc 100644 --- a/docs/generated/packages/nx-plugin.json +++ b/docs/generated/packages/nx-plugin.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nx-plugin", + "packageName": "@nrwl/nx-plugin", "description": "Plugin for creating plugins for Nx :)", "root": "/packages/nx-plugin", "source": "/packages/nx-plugin/src", diff --git a/docs/generated/packages/nx.json b/docs/generated/packages/nx.json index 6df1c2a412..bb65b4edf2 100644 --- a/docs/generated/packages/nx.json +++ b/docs/generated/packages/nx.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nx", + "packageName": "nx", "description": "Smart, Fast and Extensible Build System", "root": "/packages/nx", "source": "/packages/nx/src", diff --git a/docs/generated/packages/react-native.json b/docs/generated/packages/react-native.json index c535505d00..9f1ff74b1c 100644 --- a/docs/generated/packages/react-native.json +++ b/docs/generated/packages/react-native.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react-native", + "packageName": "@nrwl/react-native", "description": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.", "root": "/packages/react-native", "source": "/packages/react-native/src", diff --git a/docs/generated/packages/react.json b/docs/generated/packages/react.json index 14ab02efde..4b5afa0d98 100644 --- a/docs/generated/packages/react.json +++ b/docs/generated/packages/react.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "react", + "packageName": "@nrwl/react", "description": "The React plugin 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.", "root": "/packages/react", "source": "/packages/react/src", diff --git a/docs/generated/packages/storybook.json b/docs/generated/packages/storybook.json index f7e044c28e..d404c92625 100644 --- a/docs/generated/packages/storybook.json +++ b/docs/generated/packages/storybook.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "storybook", + "packageName": "@nrwl/storybook", "description": "The Nx Plugin for Storybook that contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.", "root": "/packages/storybook", "source": "/packages/storybook/src", diff --git a/docs/generated/packages/tao.json b/docs/generated/packages/tao.json index 5bcf2bf836..cc336fccc2 100644 --- a/docs/generated/packages/tao.json +++ b/docs/generated/packages/tao.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "tao", + "packageName": "@nrwl/tao", "description": "CLI for generating code and running commands", "root": "/packages/tao", "source": "/packages/tao/src", diff --git a/docs/generated/packages/web.json b/docs/generated/packages/web.json index 7010187a0f..227b36250c 100644 --- a/docs/generated/packages/web.json +++ b/docs/generated/packages/web.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "web", + "packageName": "@nrwl/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.", "root": "/packages/web", "source": "/packages/web/src", diff --git a/docs/generated/packages/workspace.json b/docs/generated/packages/workspace.json index 846f0945bf..8dfca80912 100644 --- a/docs/generated/packages/workspace.json +++ b/docs/generated/packages/workspace.json @@ -1,6 +1,7 @@ { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "workspace", + "packageName": "@nrwl/workspace", "description": "Smart, Fast and Extensible Build System.", "root": "/packages/workspace", "source": "/packages/workspace/src", diff --git a/docs/packages.json b/docs/packages.json index 51fbb28a49..fa368e2c8b 100644 --- a/docs/packages.json +++ b/docs/packages.json @@ -1,11 +1,13 @@ [ { "name": "add-nx-to-monorepo", + "packageName": "add-nx-to-monorepo", "path": "generated/packages/add-nx-to-monorepo.json", "schemas": { "executors": [], "generators": [] } }, { "name": "angular", + "packageName": "angular", "path": "generated/packages/angular.json", "schemas": { "executors": [ @@ -51,21 +53,25 @@ }, { "name": "cra-to-nx", + "packageName": "cra-to-nx", "path": "generated/packages/cra-to-nx.json", "schemas": { "executors": [], "generators": [] } }, { "name": "create-nx-plugin", + "packageName": "create-nx-plugin", "path": "generated/packages/create-nx-plugin.json", "schemas": { "executors": [], "generators": [] } }, { "name": "create-nx-workspace", + "packageName": "create-nx-workspace", "path": "generated/packages/create-nx-workspace.json", "schemas": { "executors": [], "generators": [] } }, { "name": "cypress", + "packageName": "cypress", "path": "generated/packages/cypress.json", "schemas": { "executors": ["cypress"], @@ -79,6 +85,7 @@ }, { "name": "detox", + "packageName": "detox", "path": "generated/packages/detox.json", "schemas": { "executors": ["build", "test"], @@ -87,26 +94,31 @@ }, { "name": "devkit", + "packageName": "devkit", "path": "generated/packages/devkit.json", "schemas": { "executors": [], "generators": [] } }, { "name": "eslint-plugin-nx", + "packageName": "eslint-plugin-nx", "path": "generated/packages/eslint-plugin-nx.json", "schemas": { "executors": [], "generators": [] } }, { "name": "express", + "packageName": "express", "path": "generated/packages/express.json", "schemas": { "executors": [], "generators": ["init", "application"] } }, { "name": "jest", + "packageName": "jest", "path": "generated/packages/jest.json", "schemas": { "executors": ["jest"], "generators": ["init", "jest-project"] } }, { "name": "js", + "packageName": "js", "path": "generated/packages/js.json", "schemas": { "executors": ["tsc", "swc", "node"], @@ -115,6 +127,7 @@ }, { "name": "linter", + "packageName": "linter", "path": "generated/packages/linter.json", "schemas": { "executors": ["lint", "eslint"], @@ -123,11 +136,13 @@ }, { "name": "make-angular-cli-faster", + "packageName": "make-angular-cli-faster", "path": "generated/packages/make-angular-cli-faster.json", "schemas": { "executors": [], "generators": [] } }, { "name": "nest", + "packageName": "nest", "path": "generated/packages/nest.json", "schemas": { "executors": [], @@ -156,6 +171,7 @@ }, { "name": "next", + "packageName": "next", "path": "generated/packages/next.json", "schemas": { "executors": ["build", "server", "export"], @@ -171,6 +187,7 @@ }, { "name": "node", + "packageName": "node", "path": "generated/packages/node.json", "schemas": { "executors": ["webpack", "node"], @@ -179,6 +196,7 @@ }, { "name": "nx", + "packageName": "nx", "path": "generated/packages/nx.json", "schemas": { "executors": ["noop", "run-commands", "run-script"], @@ -187,6 +205,7 @@ }, { "name": "nx-plugin", + "packageName": "nx-plugin", "path": "generated/packages/nx-plugin.json", "schemas": { "executors": ["e2e"], @@ -202,6 +221,7 @@ }, { "name": "react", + "packageName": "react", "path": "generated/packages/react.json", "schemas": { "executors": ["module-federation-dev-server"], @@ -226,6 +246,7 @@ }, { "name": "react-native", + "packageName": "react-native", "path": "generated/packages/react-native.json", "schemas": { "executors": [ @@ -252,6 +273,7 @@ }, { "name": "storybook", + "packageName": "storybook", "path": "generated/packages/storybook.json", "schemas": { "executors": ["storybook", "build"], @@ -265,11 +287,13 @@ }, { "name": "tao", + "packageName": "tao", "path": "generated/packages/tao.json", "schemas": { "executors": [], "generators": [] } }, { "name": "web", + "packageName": "web", "path": "generated/packages/web.json", "schemas": { "executors": ["webpack", "rollup", "dev-server", "file-server"], @@ -278,6 +302,7 @@ }, { "name": "workspace", + "packageName": "workspace", "path": "generated/packages/workspace.json", "schemas": { "executors": ["run-commands", "counter", "run-script"], diff --git a/nx-dev/data-access-packages/src/lib/packages.api.ts b/nx-dev/data-access-packages/src/lib/packages.api.ts index f486ca58da..bef7f8aa9d 100644 --- a/nx-dev/data-access-packages/src/lib/packages.api.ts +++ b/nx-dev/data-access-packages/src/lib/packages.api.ts @@ -15,6 +15,7 @@ export class PackagesApi { // packages.json content file packagesIndex: { name: string; + packageName: string; path: string; schemas: { executors: string[]; generators: string[] }; }[]; @@ -76,6 +77,7 @@ export class PackagesApi { itemList: this.options.packagesIndex.map((p) => ({ id: p.name, name: p.name.replace(/-/gi, ' '), + packageName: p.packageName, path: `/packages/${p.name}`, itemList: this.getPackage(p.name) .documentation.map((d) => ({ diff --git a/nx-dev/feature-package-schema-viewer/src/lib/get-public-package-name.ts b/nx-dev/feature-package-schema-viewer/src/lib/get-public-package-name.ts deleted file mode 100644 index 7c8bf92dfb..0000000000 --- a/nx-dev/feature-package-schema-viewer/src/lib/get-public-package-name.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Simple utility to get the public name of a package handling arbitrary use cases - * @param packageName - * @param prefix - */ -export function getPublicPackageName( - packageName: string, - prefix: string = '@nrwl/' -): string { - /** - * Core Nx package is not prefixed by "@nrwl/" on NPM - */ - const isNxCorePackage = packageName === 'nx'; - return isNxCorePackage ? packageName : prefix + packageName; -} diff --git a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts index 2b28bff8c5..ec86847566 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts @@ -10,7 +10,6 @@ import { } from '@nrwl/nx-dev/models-package'; import { ParsedUrlQuery } from 'querystring'; import { Errors, Example, generateJsonExampleFor } from './examples'; -import { getPublicPackageName } from './get-public-package-name'; import { SchemaRequest } from './schema-request.models'; function getReferenceFromQuery(query: string): string { @@ -41,7 +40,7 @@ export function getSchemaViewModel( return { schemaMetadata, - packageName: getPublicPackageName(schemaRequest.pkg.name), + packageName: schemaRequest.pkg.packageName, packageUrl: `/packages/${schemaRequest.pkg.name}`, schemaGithubUrl: schemaRequest.pkg.githubRoot + schemaMetadata.path, rootReference: '#', diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx index 1ec8769963..5c279e9b15 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-list.tsx @@ -5,7 +5,6 @@ import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import { ReactNode } from 'react'; import { Breadcrumbs } from '@nrwl/nx-dev/ui-common'; -import { getPublicPackageName } from './get-public-package-name'; import { Heading1 } from './ui/headings'; import { PackageReference } from './ui/package-reference'; @@ -28,7 +27,7 @@ export function PackageSchemaList({ markdown: ReactNode; } = { pkg: { - name: getPublicPackageName(pkg.name), + name: pkg.packageName, description: pkg.description, githubUrl: pkg.githubRoot + pkg.root, id: pkg.name, @@ -43,7 +42,7 @@ export function PackageSchemaList({ }, }, seo: { - title: `${getPublicPackageName(pkg.name)} | Nx`, + title: `${pkg.packageName} | Nx`, description: pkg.description, imageUrl: `https://nx.dev/images/open-graph/${router.asPath .replace('/', '') diff --git a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx index 9bbbbe1f8e..d8c6f97f0e 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/package-schema-viewer.tsx @@ -3,7 +3,6 @@ import cx from 'classnames'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import Content from './content'; -import { getPublicPackageName } from './get-public-package-name'; import { getSchemaViewModel, SchemaViewModel } from './get-schema-view-model'; import { SchemaRequest } from './schema-request.models'; @@ -21,9 +20,7 @@ export function PackageSchemaViewer({ // Process the request and make available the needed schema information schema: getSchemaViewModel(router.query, schemaRequest), seo: { - title: `${getPublicPackageName(schemaRequest.pkg.name)}:${ - schemaRequest.schemaName - } | Nx`, + title: `${schemaRequest.pkg.packageName}:${schemaRequest.schemaName} | Nx`, description: 'Next generation build system with first class monorepo support and powerful integrations.', imageUrl: `https://nx.dev/images/open-graph/${router.asPath diff --git a/nx-dev/models-document/src/lib/documents.models.ts b/nx-dev/models-document/src/lib/documents.models.ts index abbac80430..49bb0d6772 100644 --- a/nx-dev/models-document/src/lib/documents.models.ts +++ b/nx-dev/models-document/src/lib/documents.models.ts @@ -7,6 +7,7 @@ export interface DocumentData { export interface DocumentMetadata { id: string; name?: string; + packageName?: string; file?: string; path?: string; itemList?: DocumentMetadata[]; diff --git a/nx-dev/models-package/src/lib/package.models.ts b/nx-dev/models-package/src/lib/package.models.ts index 156d293b25..ab5844dd75 100644 --- a/nx-dev/models-package/src/lib/package.models.ts +++ b/nx-dev/models-package/src/lib/package.models.ts @@ -7,6 +7,7 @@ import { JsonSchema1 } from './json-schema.models'; export interface PackageMetadata { githubRoot: string; name: string; + packageName: string; description: string; documentation: { id: string; diff --git a/nx-dev/nx-dev-e2e/src/integration/packages.spec.ts b/nx-dev/nx-dev-e2e/src/integration/packages.spec.ts index e92f9749a4..b57e7a4f06 100644 --- a/nx-dev/nx-dev-e2e/src/integration/packages.spec.ts +++ b/nx-dev/nx-dev-e2e/src/integration/packages.spec.ts @@ -128,10 +128,10 @@ describe('nx-dev: Packages Section', () => { title: '@nrwl/angular:file-server', path: '/packages/angular/executors/file-server', }, - { title: '@nrwl/cra-to-nx', path: '/packages/cra-to-nx' }, - { title: '@nrwl/create-nx-plugin', path: '/packages/create-nx-plugin' }, + { title: 'cra-to-nx', path: '/packages/cra-to-nx' }, + { title: 'create-nx-plugin', path: '/packages/create-nx-plugin' }, { - title: '@nrwl/create-nx-workspace', + title: 'create-nx-workspace', path: '/packages/create-nx-workspace', }, { title: '@nrwl/cypress', path: '/packages/cypress' }, @@ -188,7 +188,7 @@ describe('nx-dev: Packages Section', () => { { title: '@nrwl/linter', path: '/packages/linter/executors/lint' }, { title: '@nrwl/linter', path: '/packages/linter/executors/eslint' }, { - title: '@nrwl/make-angular-cli-faster', + title: 'make-angular-cli-faster', path: '/packages/make-angular-cli-faster', }, { title: '@nrwl/nest', path: '/packages/nest' }, diff --git a/scripts/documentation/open-graph/generate-images.ts b/scripts/documentation/open-graph/generate-images.ts index eb9ccc3bde..4154d57719 100644 --- a/scripts/documentation/open-graph/generate-images.ts +++ b/scripts/documentation/open-graph/generate-images.ts @@ -11,6 +11,7 @@ const documents: any[] = [ const packages: { name: string; + packageName: string; path: string; schemas: { executors: string[]; generators: string[] }; }[] = readJSONSync('./docs/packages.json'); @@ -33,20 +34,20 @@ documents.map((category) => { packages.map((pkg) => { data.push({ title: 'Package details', - content: getPublicPackageName(pkg.name), + content: pkg.packageName, filename: ['packages', pkg.name].join('-'), }); pkg.schemas.executors.map((schema) => { data.push({ title: 'Executor details', - content: `${getPublicPackageName(pkg.name)}:${schema}`, + content: `${pkg.packageName}:${schema}`, filename: ['packages', pkg.name, 'executors', schema].join('-'), }); }); pkg.schemas.generators.map((schema) => { data.push({ title: 'Generator details', - content: `${getPublicPackageName(pkg.name)}:${schema}`, + content: `${pkg.packageName}:${schema}`, filename: ['packages', pkg.name, 'generators', schema].join('-'), }); }); @@ -137,14 +138,3 @@ ensureDir(targetFolder).then(() => ) ) ); - -export function getPublicPackageName( - packageName: string, - prefix: string = '@nrwl/' -): string { - /** - * Core Nx package is not prefixed by "@nrwl/" on NPM - */ - const isNxCorePackage = packageName === 'nx'; - return isNxCorePackage ? packageName : prefix + packageName; -} diff --git a/scripts/documentation/package-schemas/generatePackageSchemas.ts b/scripts/documentation/package-schemas/generatePackageSchemas.ts index 3635f1ba6d..a3cba7ede2 100644 --- a/scripts/documentation/package-schemas/generatePackageSchemas.ts +++ b/scripts/documentation/package-schemas/generatePackageSchemas.ts @@ -69,6 +69,7 @@ export function generatePackageSchemas(): Promise[] { */ const packageList = packages.map((p) => ({ name: p.name, + packageName: p.name, path: join('generated', 'packages', p.name + '.json'), schemas: { executors: p.executors.map((s) => s.name), diff --git a/scripts/documentation/package-schemas/package-metadata.ts b/scripts/documentation/package-schemas/package-metadata.ts index 84d9e6f1a9..ab06d0653a 100644 --- a/scripts/documentation/package-schemas/package-metadata.ts +++ b/scripts/documentation/package-schemas/package-metadata.ts @@ -105,6 +105,7 @@ export function getPackageMetadataList( return { githubRoot: 'https://github.com/nrwl/nx/blob/master', name: folderName, + packageName: packageJson.name, description: packageJson.description, root: relativeFolderPath, source: join(relativeFolderPath, '/src'),