From 4cc4f2d225954bbe74597d6b6cef8b2b49138419 Mon Sep 17 00:00:00 2001 From: Andrew Ghostuhin Date: Tue, 23 Jun 2026 19:31:38 +0300 Subject: [PATCH 1/2] fix(theme): resolve global css ESM import --- ui-admin/theme/src/theme.css.ts | 2 +- ui-parts/theme/src/theme.css.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-admin/theme/src/theme.css.ts b/ui-admin/theme/src/theme.css.ts index 298294d89..8e6ea4970 100644 --- a/ui-admin/theme/src/theme.css.ts +++ b/ui-admin/theme/src/theme.css.ts @@ -1,4 +1,4 @@ -import './global.css' +import './global.css.js' import { createTheme } from '@vanilla-extract/css' import { createThemeContract } from '@vanilla-extract/css' diff --git a/ui-parts/theme/src/theme.css.ts b/ui-parts/theme/src/theme.css.ts index 177f65d56..ffaa6215e 100644 --- a/ui-parts/theme/src/theme.css.ts +++ b/ui-parts/theme/src/theme.css.ts @@ -1,4 +1,4 @@ -import './global.css' +import './global.css.js' import { createGlobalTheme } from '@vanilla-extract/css' From 2997629c9840e40b54968b223d4b47db9ad7f72a Mon Sep 17 00:00:00 2001 From: Andrew Ghostuhin Date: Tue, 23 Jun 2026 19:51:34 +0300 Subject: [PATCH 2/2] test(theme): guard global css ESM import --- ui-admin/theme/src/theme-css-import.test.ts | 20 ++++++++++++++++++++ ui-parts/theme/src/theme-css-import.test.ts | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 ui-admin/theme/src/theme-css-import.test.ts create mode 100644 ui-parts/theme/src/theme-css-import.test.ts diff --git a/ui-admin/theme/src/theme-css-import.test.ts b/ui-admin/theme/src/theme-css-import.test.ts new file mode 100644 index 000000000..d235b676b --- /dev/null +++ b/ui-admin/theme/src/theme-css-import.test.ts @@ -0,0 +1,20 @@ +/* eslint-disable n/no-sync */ + +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { dirname } from 'node:path' +import { join } from 'node:path' +import { describe } from 'node:test' +import { it } from 'node:test' +import { fileURLToPath } from 'node:url' + +const currentDir = dirname(fileURLToPath(import.meta.url)) + +describe('admin theme css import', () => { + it('should reference published global css module', () => { + const source = readFileSync(join(currentDir, 'theme.css.ts'), 'utf-8') + + assert.match(source, /import ['"]\.\/global\.css\.js['"]/) + assert.doesNotMatch(source, /import ['"]\.\/global\.css['"]/) + }) +}) diff --git a/ui-parts/theme/src/theme-css-import.test.ts b/ui-parts/theme/src/theme-css-import.test.ts new file mode 100644 index 000000000..eab93269a --- /dev/null +++ b/ui-parts/theme/src/theme-css-import.test.ts @@ -0,0 +1,20 @@ +/* eslint-disable n/no-sync */ + +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { dirname } from 'node:path' +import { join } from 'node:path' +import { describe } from 'node:test' +import { it } from 'node:test' +import { fileURLToPath } from 'node:url' + +const currentDir = dirname(fileURLToPath(import.meta.url)) + +describe('parts theme css import', () => { + it('should reference published global css module', () => { + const source = readFileSync(join(currentDir, 'theme.css.ts'), 'utf-8') + + assert.match(source, /import ['"]\.\/global\.css\.js['"]/) + assert.doesNotMatch(source, /import ['"]\.\/global\.css['"]/) + }) +})