diff --git a/nx.json b/nx.json index 621bd1f05ca8..0746427cdd9d 100644 --- a/nx.json +++ b/nx.json @@ -20,21 +20,6 @@ ], "cache": true }, - "angular:copy-metadata": { - "dependsOn": [ - "tools:discover-metadata" - ] - }, - "react:copy-metadata": { - "dependsOn": [ - "tools:discover-metadata" - ] - }, - "vue:copy-metadata": { - "dependsOn": [ - "tools:discover-metadata" - ] - }, "lint": { "cache": true }, diff --git a/package.json b/package.json index d4b688e227e1..33c897d6dafc 100644 --- a/package.json +++ b/package.json @@ -4,22 +4,10 @@ "license": "MIT", "author": "Developer Express Inc.", "scripts": { - "devextreme:inject-descriptions-to-bundle": "dx-tools inject-descriptions --target-path ./packages/devextreme/ts/dx.all.d.ts --artifacts ./artifacts/internal-tools", - "devextreme:inject-descriptions-to-modules": "dx-tools inject-descriptions --collapse-tags --sources ./packages/devextreme/js --artifacts ./artifacts/internal-tools", + "devextreme:inject-descriptions-to-bundle": "dx-tools inject-descriptions --target-path ./packages/devextreme/ts/dx.all.d.ts --artifacts ./packages/devextreme-metadata/dist", + "devextreme:inject-descriptions-to-modules": "dx-tools inject-descriptions --collapse-tags --sources ./packages/devextreme/js --artifacts ./packages/devextreme-metadata/dist", "devextreme:inject-descriptions": "npm run devextreme:inject-descriptions-to-bundle && npm run devextreme:inject-descriptions-to-modules", - "angular:copy-metadata": "shx mkdir -p ./packages/devextreme-angular/metadata/ && shx cp ./artifacts/internal-tools/NGMetaData.json ./packages/devextreme-angular/metadata/", - "angular:regenerate": "nx regenerate devextreme-angular", - "angular:inject-descriptions": "dx-tools inject-descriptions --sources ./packages/devextreme-angular/npm/dist --artifacts ./artifacts/internal-tools", - "react:copy-metadata": "shx mkdir -p ./packages/devextreme-react/metadata/ && shx cp ./artifacts/internal-tools/integration-data.json ./packages/devextreme-react/metadata/", - "react:regenerate": "nx regenerate devextreme-react", - "react-storybook:start": "nx start devextreme-react-storybook", - "tools": "dx-tools", - "tools:discover-declarations": "dx-tools discover-declarations --sources ./packages/devextreme/js --exclude \"js/(renovation|__internal|.eslintrc.js)\" --compiler-options \"{ \\\"typeRoots\\\": [] }\" --artifacts ./artifacts/internal-tools", - "tools:generate-imd": "dx-tools make-integration-metadata --artifacts ./artifacts/internal-tools", - "tools:generate-ng-smd": "dx-tools make-angular-metadata --artifacts ./artifacts/internal-tools", - "tools:discover-metadata": "npm run tools:discover-declarations && npm run tools:generate-imd && npm run tools:generate-ng-smd", - "vue:copy-metadata": "shx mkdir -p ./packages/devextreme-vue/metadata/ && shx cp ./artifacts/internal-tools/integration-data.json ./packages/devextreme-vue/metadata/", - "vue:regenerate": "nx regenerate devextreme-vue", + "angular:inject-descriptions": "dx-tools inject-descriptions --sources ./packages/devextreme-angular/npm/dist --artifacts ./packages/devextreme-metadata/dist", "regenerate-all": "nx run-many -t regenerate", "lint-staged": "lint-staged", "prepare": "husky install", diff --git a/packages/devextreme-angular/build.config.js b/packages/devextreme-angular/build.config.js index fa51728674bc..3c9677f7edb2 100644 --- a/packages/devextreme-angular/build.config.js +++ b/packages/devextreme-angular/build.config.js @@ -1,7 +1,7 @@ module.exports = { tools: { metadataGenerator: { - sourceMetadataFilePath: './metadata/NGMetaData.json', + sourceMetadataFilePath: require.resolve('devextreme-metadata/NGMetaData.json'), deprecatedMetadataFilePath: './metadata/DeprecatedComponentsMetadata.json', outputFolderPath: './metadata/generated', nestedPathPart: 'nested', @@ -55,7 +55,7 @@ module.exports = { outputFileName: 'tests/src/server/component-names.ts' }, commonReexportsGenerator: { - metadataPath: './metadata/NGMetaData.json', + metadataPath: require.resolve('devextreme-metadata/NGMetaData.json'), outputPath: './src/' }, diff --git a/packages/devextreme-angular/package.json b/packages/devextreme-angular/package.json index 262f01db4494..301ccb2c3469 100644 --- a/packages/devextreme-angular/package.json +++ b/packages/devextreme-angular/package.json @@ -64,7 +64,8 @@ "typescript": "^4.9.3", "webpack": "^5.88.2", "yargs": "^17.7.2", - "zone.js": "0.13.3" + "zone.js": "0.13.3", + "devextreme-metadata": "*" }, "main": "./src/index.ts", "keywords": [ diff --git a/packages/devextreme-angular/project.json b/packages/devextreme-angular/project.json index 55768d10b40b..c445f92d3b83 100644 --- a/packages/devextreme-angular/project.json +++ b/packages/devextreme-angular/project.json @@ -40,7 +40,7 @@ "options": { "script": "regenerate" }, - "dependsOn": ["devextreme-monorepo:\"angular:copy-metadata\""] + "dependsOn": ["devextreme-metadata:build"] }, "test:dev": { "executor": "nx:run-script", diff --git a/packages/devextreme-metadata/package.json b/packages/devextreme-metadata/package.json new file mode 100644 index 000000000000..b69a3d1a4bb2 --- /dev/null +++ b/packages/devextreme-metadata/package.json @@ -0,0 +1,7 @@ +{ + "name": "devextreme-metadata", + "publishConfig": { + "directory": "./dist", + "linkDirectory": true + } +} \ No newline at end of file diff --git a/packages/devextreme-metadata/project.json b/packages/devextreme-metadata/project.json new file mode 100644 index 000000000000..eeb0cec511f2 --- /dev/null +++ b/packages/devextreme-metadata/project.json @@ -0,0 +1,22 @@ +{ + "name": "devextreme-metadata", + "targets": { + "build": { + "executor": "nx:run-commands", + "outputs": [ + "{projectRoot}/dist" + ], + "options": { + "parallel": false, + "commands": [ + "dx-tools discover-declarations --sources ./packages/devextreme/js --exclude \"js/(renovation|__internal|.eslintrc.js)\" --compiler-options \"{ \\\"typeRoots\\\": [] }\" --artifacts ./packages/devextreme-metadata/dist", + "dx-tools make-integration-metadata --artifacts ./packages/devextreme-metadata/dist", + "dx-tools make-angular-metadata --artifacts ./packages/devextreme-metadata/dist", + "dx-tools make-aspnet-metadata --artifacts ./packages/devextreme-metadata/dist --version 24_1" + ] + }, + "dependsOn": [] + } + }, + "implicitDependencies": ["devextreme-main"] +} \ No newline at end of file diff --git a/packages/devextreme-react/build.config.js b/packages/devextreme-react/build.config.js index f46a5765e583..95273e7500f8 100644 --- a/packages/devextreme-react/build.config.js +++ b/packages/devextreme-react/build.config.js @@ -8,7 +8,7 @@ module.exports = { license: 'LICENSE', readme: 'README.md' }, - metadataPath: './metadata/integration-data.json', + metadataPath: require.resolve('devextreme-metadata/integration-data.json'), generatedComponentsDir: './src', coreComponentsDir: './src/core', indexFileName: './src/index.ts', diff --git a/packages/devextreme-react/package.json b/packages/devextreme-react/package.json index 2e6908529af4..7ee27fdf0704 100644 --- a/packages/devextreme-react/package.json +++ b/packages/devextreme-react/package.json @@ -49,7 +49,8 @@ "react": "~18.0.0", "react-dom": "~18.0.0", "ts-jest": "^29.1.2", - "typescript": "~4.9" + "typescript": "~4.9", + "devextreme-metadata": "*" }, "publishConfig": { "directory": "npm", diff --git a/packages/devextreme-react/project.json b/packages/devextreme-react/project.json index 5db51b4b1c92..f37f3fe7fd86 100644 --- a/packages/devextreme-react/project.json +++ b/packages/devextreme-react/project.json @@ -25,7 +25,7 @@ "options": { "script": "regenerate" }, - "dependsOn": ["devextreme-monorepo:\"react:copy-metadata\""] + "dependsOn": ["devextreme-metadata:build"] }, "test": { "executor": "nx:run-script", diff --git a/packages/devextreme-vue/build.config.js b/packages/devextreme-vue/build.config.js index 05c471bf6c6b..e7fd4c48f502 100644 --- a/packages/devextreme-vue/build.config.js +++ b/packages/devextreme-vue/build.config.js @@ -8,7 +8,7 @@ module.exports = { license: './LICENSE', readme: './README.md' }, - metadataPath: './metadata/integration-data.json', + metadataPath: require.resolve('devextreme-metadata/integration-data.json'), generatedComponentsDir: './src', coreComponentsDir: './src/core', indexFileName: './src/index.ts', diff --git a/packages/devextreme-vue/package.json b/packages/devextreme-vue/package.json index 87b39394d34c..5d10b98411f6 100644 --- a/packages/devextreme-vue/package.json +++ b/packages/devextreme-vue/package.json @@ -45,7 +45,8 @@ "typescript": "^4.9.5", "vue": "3.2.47", "@vue/shared": "^3.2.47", - "vue-router": "^4.0.16" + "vue-router": "^4.0.16", + "devextreme-metadata": "*" }, "publishConfig": { "directory": "npm", diff --git a/packages/devextreme-vue/project.json b/packages/devextreme-vue/project.json index 04e86a7f6cfe..6c180a51c5d6 100644 --- a/packages/devextreme-vue/project.json +++ b/packages/devextreme-vue/project.json @@ -25,7 +25,7 @@ "options": { "script": "regenerate" }, - "dependsOn": ["devextreme-monorepo:\"vue:copy-metadata\""] + "dependsOn": ["devextreme-metadata:build"] }, "test": { "executor": "nx:run-script", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdb5125af26b..63e9132d270d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1317,6 +1317,9 @@ importers: del: specifier: ^2.2.2 version: 2.2.2 + devextreme-metadata: + specifier: '*' + version: link:../devextreme-metadata/dist eslint: specifier: 8.56.0 version: 8.56.0 @@ -1385,6 +1388,9 @@ importers: version: 0.13.3 publishDirectory: npm/dist + packages/devextreme-metadata: + publishDirectory: ./dist + packages/devextreme-monorepo-tools: devDependencies: '@types/jest': @@ -1418,6 +1424,9 @@ importers: del: specifier: ^3.0.0 version: 3.0.0 + devextreme-metadata: + specifier: '*' + version: link:../devextreme-metadata/dist eslint: specifier: 8.56.0 version: 8.56.0 @@ -1559,6 +1568,9 @@ importers: del: specifier: ^3.0.0 version: 3.0.0 + devextreme-metadata: + specifier: '*' + version: link:../devextreme-metadata/dist eslint: specifier: 8.56.0 version: 8.56.0 diff --git a/tools/scripts/build-all.ts b/tools/scripts/build-all.ts index b4a3b159a44c..e4b7370ed0c3 100644 --- a/tools/scripts/build-all.ts +++ b/tools/scripts/build-all.ts @@ -45,8 +45,7 @@ const MAJOR_VERSION = monorepoVersion.split('.').slice(0, 2).join('_'); // Prepare metadata sh.cd(ROOT_DIR); -sh.exec('pnpm run tools:discover-declarations'); -sh.exec(`pnpm run tools make-aspnet-metadata --version ${MAJOR_VERSION}`); +sh.exec('pnpx nx build devextreme-metadata'); if (!devMode) { injectDescriptions(); diff --git a/tools/scripts/common/paths.ts b/tools/scripts/common/paths.ts index 002d398d02a8..b252c1ff96b2 100644 --- a/tools/scripts/common/paths.ts +++ b/tools/scripts/common/paths.ts @@ -2,7 +2,7 @@ import path from 'path'; export const ROOT_DIR = path.join(__dirname, '../../..'); export const ARTIFACTS_DIR = path.join(ROOT_DIR, 'artifacts'); -export const INTERNAL_TOOLS_ARTIFACTS = path.join(ARTIFACTS_DIR, 'internal-tools'); +export const INTERNAL_TOOLS_ARTIFACTS = require.resolve('devextreme-metadata'); export const TS_ARTIFACTS = path.join(ARTIFACTS_DIR, 'ts'); export const JS_ARTIFACTS = path.join(ARTIFACTS_DIR, 'js'); export const CSS_ARTIFACTS = path.join(ARTIFACTS_DIR, 'css');