Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions core-web/libs/edit-content-bridge/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@
"tags": ["type:feature", "scope:dotcms-ui", "portlet:edit-content"],
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/edit-content-bridge",
"main": "libs/edit-content-bridge/src/index.ts",
"tsConfig": "libs/edit-content-bridge/tsconfig.lib.json",
"assets": ["libs/edit-content-bridge/*.md"],
"buildLibsFromSource": true,
"viteConfig": "libs/edit-content-bridge/vite.config.ts"
}
"outputs": ["{workspaceRoot}/dist/libs/edit-content-bridge"]
},
"test": {
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
13 changes: 12 additions & 1 deletion core-web/libs/edit-content-bridge/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import { defineConfig } from 'vite';

import { resolve } from 'path';

// These options were migrated by @nx/vite:convert-to-inferred from the project.json file.
const configValues = { default: { buildLibsFromSource: true } };

// Determine the correct configValue to use based on the configuration
const nxConfiguration = process.env.NX_TASK_TARGET_CONFIGURATION ?? 'default';

const options = {
...configValues.default,
...(configValues[nxConfiguration] ?? {})
};

export default defineConfig(() => {
// Explicitly resolve outDir relative to this config file's location
// This ensures output always goes to core-web/dist/libs/edit-content-bridge
Expand All @@ -13,7 +24,7 @@ export default defineConfig(() => {

return {
root: __dirname,
plugins: [nxViteTsPaths()],
plugins: [nxViteTsPaths({ buildLibsFromSource: options.buildLibsFromSource })],
build: {
// Explicitly set outDir to prevent Vite from resolving paths incorrectly
// This is critical for reproducible builds, especially when dist folders
Expand Down
30 changes: 8 additions & 22 deletions core-web/libs/sdk/ai/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,15 @@
}
},
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"dependsOn": ["generate-spec"],
"options": {
"format": ["esm", "cjs"],
"compiler": "tsc",
"generateExportsField": true,
"additionalEntryPoints": [
"libs/sdk/ai/src/sandbox/index.ts",
"libs/sdk/ai/src/adapter/index.ts",
"libs/sdk/ai/src/spec/index.ts"
],
"outputPath": "dist/libs/sdk/ai",
"assets": [
{
"input": "libs/sdk/ai",
"output": ".",
"glob": "*.md"
}
],
"main": "libs/sdk/ai/src/runtime.ts",
"tsConfig": "libs/sdk/ai/tsconfig.lib.json"
}
"cache": true,
"inputs": [
"production",
"^production",
{
"externalDependencies": ["rollup"]
}
]
},
"publish": {
"executor": "nx:run-commands",
Expand Down
31 changes: 31 additions & 0 deletions core-web/libs/sdk/ai/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { withNx } = require('@nx/rollup/with-nx');

// These options were migrated by @nx/rollup:convert-to-inferred from project.json
const options = {
format: ['esm', 'cjs'],
compiler: 'tsc',
generateExportsField: true,
additionalEntryPoints: [
'./src/sandbox/index.ts',
'./src/adapter/index.ts',
'./src/spec/index.ts'
],
outputPath: '../../../dist/libs/sdk/ai',
assets: [
{
input: 'libs/sdk/ai',
output: '.',
glob: '*.md'
}
],
main: './src/runtime.ts',
tsConfig: './tsconfig.lib.json'
};

const config = withNx(options, {
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
// e.g.
// output: { sourcemap: true },
});

module.exports = config;
10 changes: 4 additions & 6 deletions core-web/libs/sdk/analytics/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
}
},
"build:standalone": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"dependsOn": ["^build"],
"outputs": ["{workspaceRoot}/dist/libs/sdk/analytics-standalone"],
"options": {
"main": "libs/sdk/analytics/src/lib/standalone.ts",
"outputPath": "dist/libs/sdk/analytics-standalone",
"tsConfig": "libs/sdk/analytics/tsconfig.lib.json",
"configFile": "libs/sdk/analytics/vite.standalone.config.mts"
"config": "./vite.standalone.config.mts",
"outDir": "../../../dist/libs/sdk/analytics-standalone"
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions core-web/libs/sdk/analytics/vite.standalone.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { defineConfig } from 'vite';

import { resolve } from 'path';

// These options were migrated by @nx/vite:convert-to-inferred from the project.json file.
const configValues = { default: {} };

// Determine the correct configValue to use based on the configuration
const nxConfiguration = process.env.NX_TASK_TARGET_CONFIGURATION ?? 'default';

const options = {
...configValues.default,
...(configValues[nxConfiguration] ?? {})
};

export default defineConfig({
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/sdk/analytics',
Expand Down
3 changes: 0 additions & 3 deletions core-web/libs/sdk/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"devDependencies": {
"@dotcms/types": "latest"
},
"scripts": {
"build": "nx run sdk-client:build:js; cd ../../../../dotCMS/src/main/webapp/html/js/editor-js; rm -rf src package.json *.esm.d.ts"
},
"keywords": [
"dotCMS",
"CMS",
Expand Down
27 changes: 9 additions & 18 deletions core-web/libs/sdk/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,15 @@
"tags": [],
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"format": ["esm", "cjs"],
"compiler": "tsc",
"additionalEntryPoints": ["libs/sdk/client/src/internal.ts"],
"generateExportsField": true,
"outputPath": "dist/libs/sdk/client",
"assets": [
{
"input": "libs/sdk/client",
"output": ".",
"glob": "*.md"
}
],
"main": "libs/sdk/client/src/index.ts",
"tsConfig": "libs/sdk/client/tsconfig.lib.json"
}
"cache": true,
"dependsOn": ["^build"],
"inputs": [
"production",
"^production",
{
"externalDependencies": ["rollup"]
}
]
},
"build:js": {
"executor": "@nx/esbuild:esbuild",
Expand Down
27 changes: 27 additions & 0 deletions core-web/libs/sdk/client/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { withNx } = require('@nx/rollup/with-nx');

// These options were migrated by @nx/rollup:convert-to-inferred from project.json
const options = {
format: ['esm', 'cjs'],
compiler: 'tsc',
additionalEntryPoints: ['./src/internal.ts'],
generateExportsField: true,
outputPath: '../../../dist/libs/sdk/client',
assets: [
{
input: 'libs/sdk/client',
output: '.',
glob: '*.md'
}
],
main: './src/index.ts',
tsConfig: './tsconfig.lib.json'
};

const config = withNx(options, {
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
// e.g.
// output: { sourcemap: true },
});

module.exports = config;
41 changes: 12 additions & 29 deletions core-web/libs/sdk/experiments/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,21 @@
"tags": [],
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/sdk/experiments",
"tsConfig": "libs/sdk/experiments/tsconfig.lib.json",
"project": "libs/sdk/experiments/package.json",
"entryFile": "libs/sdk/experiments/src/index.ts",
"external": [
"react/jsx-runtime",
"@dotcms/client",
"@dotcms/react",
"@dotcms/uve",
"@dotcms/types"
],
"rollupConfig": "@nx/react/plugins/bundle-rollup",
"compiler": "babel",
"assets": [
{
"glob": "libs/sdk/experiments/README.md",
"input": ".",
"output": "."
}
]
}
"cache": true,
"dependsOn": ["^build"],
"inputs": [
"production",
"^production",
{
"externalDependencies": ["rollup"]
}
]
},
"build:iife": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"dependsOn": ["^build"],
"outputs": ["{workspaceRoot}/dist/libs/sdk/experiments/iife"],
"options": {
"outputPath": "dist/libs/sdk/experiments/iife",
"main": "libs/sdk/experiments/src/lib/standalone.ts",
"tsConfig": "libs/sdk/experiments/tsconfig.lib.json"
"outDir": "../../../dist/libs/sdk/experiments/iife"
}
},
"publish": {
Expand Down
34 changes: 34 additions & 0 deletions core-web/libs/sdk/experiments/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { withNx } = require('@nx/rollup/with-nx');

// These options were migrated by @nx/rollup:convert-to-inferred from project.json
const options = {
outputPath: '../../../dist/libs/sdk/experiments',
tsConfig: './tsconfig.lib.json',
project: './package.json',
main: 'libs/sdk/experiments/src/index.ts',
external: [
'react/jsx-runtime',
'@dotcms/client',
'@dotcms/react',
'@dotcms/uve',
'@dotcms/types'
],
compiler: 'babel',
assets: [
{
glob: 'libs/sdk/experiments/README.md',
input: '.',
output: '.'
}
]
};

let config = withNx(options, {
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
// e.g.
// output: { sourcemap: true },
});

config = require('@nx/react/plugins/bundle-rollup')(config, options);

module.exports = config;
11 changes: 11 additions & 0 deletions core-web/libs/sdk/experiments/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import dts from 'vite-plugin-dts';

import * as path from 'path';

// These options were migrated by @nx/vite:convert-to-inferred from the project.json file.
const configValues = { default: {} };

// Determine the correct configValue to use based on the configuration
const nxConfiguration = process.env.NX_TASK_TARGET_CONFIGURATION ?? 'default';

const options = {
...configValues.default,
...(configValues[nxConfiguration] ?? {})
};

export default defineConfig({
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/sdk/experiments',
Expand Down
31 changes: 9 additions & 22 deletions core-web/libs/sdk/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,15 @@
"tags": [],
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"main": "libs/sdk/react/src/index.ts",
"generateExportsField": true,
"outputPath": "dist/libs/sdk/react",
"tsConfig": "libs/sdk/react/tsconfig.lib.json",
"project": "libs/sdk/react/package.json",
"entryFile": "libs/sdk/react/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "libs/sdk/react/rollup.config.js",
"compiler": "babel",
"format": ["esm"],
"extractCss": false,
"assets": [
{
"glob": "libs/sdk/react/README.md",
"input": ".",
"output": "."
}
]
}
"cache": true,
"dependsOn": ["^build"],
"inputs": [
"production",
"^production",
{
"externalDependencies": ["rollup"]
}
]
},
"test": {
"options": {
Expand Down
31 changes: 31 additions & 0 deletions core-web/libs/sdk/react/rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { withNx } = require('@nx/rollup/with-nx');

// These options were migrated by @nx/rollup:convert-to-inferred from project.json
const options = {
main: 'libs/sdk/react/src/index.ts',
generateExportsField: true,
outputPath: '../../../dist/libs/sdk/react',
tsConfig: './tsconfig.lib.json',
project: './package.json',
external: ['react/jsx-runtime'],
compiler: 'babel',
format: ['esm'],
extractCss: false,
assets: [
{
glob: 'libs/sdk/react/README.md',
input: '.',
output: '.'
}
]
};

let config = withNx(options, {
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
// e.g.
// output: { sourcemap: true },
});

config = require('./rollup.migrated.config.js')(config, options);

module.exports = config;
Loading
Loading