Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5b4e895
fix(nx): replace deprecated Nx Vite plugins with their standalone equ…
nicobytes Jul 14, 2026
aabb10d
style(sdk-vue): apply eslint --fix formatting to Vue templates
nicobytes Jul 14, 2026
4b6b7fd
Merge branch 'main' into 36540-nx-replace-deprecated-nxvitetspaths-pl…
nicobytes Jul 14, 2026
6854275
fix(nx): address PR review feedback on vite-tsconfig-paths migration
nicobytes Jul 14, 2026
a834876
revert: drop accidental examples/nextjs-analytics-experiments/.gitignore
nicobytes Jul 14, 2026
74b7d8d
Merge branch 'main' into 36540-nx-replace-deprecated-nxvitetspaths-pl…
nicobytes Jul 14, 2026
b745e31
chore: fix lint
nicobytes Jul 14, 2026
d571950
fix error
nicobytes Jul 14, 2026
356431d
Merge branch 'main' into 36540-nx-replace-deprecated-nxvitetspaths-pl…
nicobytes Jul 14, 2026
51ae080
diag(nx): enable verbose logging on lint-test to surface CI-only proj…
nicobytes Jul 14, 2026
42ff017
fix(nx): rename vite.config.ts to .mts for edit-content-bridge and sd…
nicobytes Jul 14, 2026
894f4e6
fix error
nicobytes Jul 14, 2026
82a5770
fix error
nicobytes Jul 14, 2026
4501f03
refactor(vite): update tsconfigPaths plugin configuration to prevent …
nicobytes Jul 14, 2026
46b4480
Merge branch 'main' into 36540-nx-replace-deprecated-nxvitetspaths-pl…
nicobytes Jul 14, 2026
3b7f5aa
Merge branch 'main' into 36540-nx-replace-deprecated-nxvitetspaths-pl…
nicobytes Jul 15, 2026
5ff11bb
fix(vite): add loose option to tsconfigPaths for Vue SFC compatibility
nicobytes Jul 15, 2026
d5b7752
Merge branch '36540-nx-replace-deprecated-nxvitetspaths-plugin-with-v…
nicobytes Jul 15, 2026
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
2 changes: 1 addition & 1 deletion core-web/libs/edit-content-bridge/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default [
'@angular/forms',
'vite',
'primeng',
'@nx/vite'
'vite-tsconfig-paths'
]
}
]
Expand Down
3 changes: 1 addition & 2 deletions core-web/libs/edit-content-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"@angular/core": "21.2.1",
"@angular/forms": "21.2.1",
"vite": "7.2.7",
"primeng": "21.1.3",
"@nx/vite": "22.5.4"
"primeng": "21.1.3"
},
"type": "module",
"main": "./index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

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
// regardless of current working directory or presence of external dist folders
// __dirname points to core-web/libs/edit-content-bridge
// import.meta.dirname points to core-web/libs/edit-content-bridge
// So ../../dist/libs/edit-content-bridge resolves to core-web/dist/libs/edit-content-bridge
const outDir = resolve(__dirname, '../../dist/libs/edit-content-bridge');
const outDir = resolve(import.meta.dirname, '../../dist/libs/edit-content-bridge');

return {
root: __dirname,
plugins: [nxViteTsPaths({ buildLibsFromSource: options.buildLibsFromSource })],
root: import.meta.dirname,
// `root` points to the core-web workspace root so tsconfig path aliases
// (e.g. @dotcms/dotcms-models, @dotcms/ui) resolve consistently with the
// other SDK vite configs, even though today's bundle graph doesn't need it.
// `projects` pins resolution to the base tsconfig (which holds every
// @dotcms/* alias) so the plugin does NOT crawl every tsconfig in the
// monorepo. That crawl runs inside @nx/vite's project-graph inference
// (resolveConfig) and segfaults the native resolver on CI.
plugins: [
tsconfigPaths({
root: resolve(import.meta.dirname, '../../'),
projects: ['tsconfig.base.json']
})
],
build: {
// Explicitly set outDir to prevent Vite from resolving paths incorrectly
// This is critical for reproducible builds, especially when dist folders
// exist outside the repository root (e.g., at repo root level)
outDir: outDir,
lib: {
entry: resolve(__dirname, 'src/iife.ts'),
entry: resolve(import.meta.dirname, 'src/iife.ts'),
name: 'DotCustomFieldApi',
formats: ['iife'],
fileName: () => 'edit-content-bridge.js'
Expand Down
14 changes: 12 additions & 2 deletions core-web/libs/sdk/analytics/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import react from '@vitejs/plugin-react';
import fs from 'fs';
import * as path from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';

// Plugin simple para copiar README.md
const copyReadme = {
Expand All @@ -23,7 +23,17 @@ export default defineConfig({

plugins: [
react(),
nxViteTsPaths(),
// `root` points to the core-web workspace root so tsconfig path aliases
// (e.g. @dotcms/types) resolve in bundled sibling sources like @dotcms/uve,
// which are compiled from source into this build.
// `projects` pins resolution to the base tsconfig (which holds every
// @dotcms/* alias) so the plugin does NOT crawl every tsconfig in the
// monorepo. That crawl runs inside @nx/vite's project-graph inference
// (resolveConfig) and segfaults the native resolver on CI.
tsconfigPaths({
root: path.resolve(__dirname, '../../../'),
projects: ['tsconfig.base.json']
}),
dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') }),
copyReadme,
// Ensure the React entry is tagged as a Client Component in the emitted bundle
Expand Down
27 changes: 14 additions & 13 deletions core-web/libs/sdk/analytics/vite.standalone.config.mts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

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',
plugins: [nxViteTsPaths()],
// `root` points to the core-web workspace root so tsconfig path aliases
// (e.g. @dotcms/types) resolve in bundled sibling sources like @dotcms/uve,
// which are compiled from source into this build.
// `projects` pins resolution to the base tsconfig (which holds every
// @dotcms/* alias) so the plugin does NOT crawl every tsconfig in the
// monorepo. That crawl runs inside @nx/vite's project-graph inference
// (resolveConfig) and segfaults the native resolver on CI.
plugins: [
tsconfigPaths({
root: resolve(__dirname, '../../../'),
projects: ['tsconfig.base.json']
})
],
build: {
// Explicitly resolve outDir to prevent output from going to external dist folders
// This ensures reproducible builds regardless of current working directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';

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,
root: import.meta.dirname,
cacheDir: '../../../node_modules/.vite/libs/sdk/experiments',

plugins: [
nxViteTsPaths(),
// `root` points to the core-web workspace root so tsconfig path aliases
// (e.g. @dotcms/types) resolve in bundled sibling sources like @dotcms/uve,
// which are compiled from source into this build.
// `projects` pins resolution to the base tsconfig (which holds every
// @dotcms/* alias) so the plugin does NOT crawl every tsconfig in the
// monorepo. That crawl runs inside @nx/vite's project-graph inference
// (resolveConfig) and segfaults the native resolver on CI.
tsconfigPaths({
root: path.resolve(import.meta.dirname, '../../../'),
projects: ['tsconfig.base.json']
}),
dts({
entryRoot: 'src',
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
tsConfigFilePath: path.join(import.meta.dirname, 'tsconfig.lib.json'),
skipDiagnostics: true
})
],
Expand All @@ -33,7 +32,7 @@ export default defineConfig({
build: {
// Explicitly resolve outDir to prevent output from going to external dist folders
// This ensures reproducible builds regardless of current working directory
outDir: path.resolve(__dirname, '../../../dist/libs/sdk/experiments'),
outDir: path.resolve(import.meta.dirname, '../../../dist/libs/sdk/experiments'),
reportCompressedSize: true,
emptyOutDir: true,
commonjsOptions: {
Expand Down
25 changes: 20 additions & 5 deletions core-web/libs/sdk/vue/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,31 @@ import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import dts from 'vite-plugin-dts';
import * as path from 'path';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig(() => ({
root: import.meta.dirname,
cacheDir: '../../../node_modules/.vite/libs/sdk/vue',
plugins: [
vue(),
nxViteTsPaths(),
nxCopyAssetsPlugin(['*.md']),
// `root` points to the core-web workspace root so tsconfig path aliases
// (e.g. @dotcms/types) resolve in bundled sibling sources like @dotcms/uve,
// which are compiled from source into this build/test run.
// `projects` pins resolution to the base tsconfig (which holds every
// @dotcms/* alias) so the plugin does NOT crawl every tsconfig in the
// monorepo. That crawl runs inside @nx/vite's project-graph inference
// (resolveConfig) and segfaults the native resolver on CI.
// `loose: true` is required for Vue SFCs: vite-tsconfig-paths only
// resolves aliases from .ts/.tsx importers unless allowJs is set on the
// loaded tsconfig (tsconfig.base.json has neither), so .vue imports of
// @dotcms/* would fail without it.
tsconfigPaths({
root: path.resolve(import.meta.dirname, '../../../'),
projects: ['tsconfig.base.json'],
loose: true
}),
viteStaticCopy({ targets: [{ src: '*.md', dest: '.' }] }),
dts({
entryRoot: 'src',
tsconfigPath: path.join(import.meta.dirname, 'tsconfig.lib.json'),
Expand All @@ -21,7 +36,7 @@ export default defineConfig(() => ({
],
// Uncomment this if you are using workers.
// worker: {
// plugins: () => [ nxViteTsPaths() ],
// plugins: () => [ tsconfigPaths() ],
// },
// Configuration for building your library.
// See: https://vite.dev/guide/build.html#library-mode
Expand Down
2 changes: 2 additions & 0 deletions core-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@
"typescript-eslint": "8.62.0",
"vite": "7.3.2",
"vite-plugin-dts": "4.5.4",
"vite-plugin-static-copy": "4.1.1",
"vite-tsconfig-paths": "5.1.4",
"vitest": "4.0.18",
"vue-tsc": "^2.2.8",
"webpack": "5.64.0",
Expand Down
Loading
Loading