Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

refactor: drop XDS_ prefix from internal library-pattern constants (#3040)

EJ Hammond16b2dcd7be8f
diff --git a/internal/vibe-tests/src/generate-a11y-manifest.ts b/internal/vibe-tests/src/generate-a11y-manifest.ts
index 443941da9e..ecf0111f2b 100644
--- a/internal/vibe-tests/src/generate-a11y-manifest.ts
+++ b/internal/vibe-tests/src/generate-a11y-manifest.ts
@@ -19,7 +19,7 @@ import path from 'path';
const VIBE_TESTS_DIR = path.join(import.meta.dirname, '..');
const MANIFESTS_DIR = path.join(VIBE_TESTS_DIR, 'a11y-manifests');
-const XDS_CORE_DIR = path.join(
+const CORE_DIR = path.join(
VIBE_TESTS_DIR,
'..',
'..',
@@ -198,7 +198,7 @@ function generateXDSManifest(): A11yManifest {
return readmes;
};
- const readmePaths = findReadmes(XDS_CORE_DIR);
+ const readmePaths = findReadmes(CORE_DIR);
console.log(`Found ${readmePaths.length} XDS component README files`);
for (const readmePath of readmePaths) {
diff --git a/packages/build/src/babel.js b/packages/build/src/babel.js
index 8b4774f09e..b9d29cbbe6 100644
--- a/packages/build/src/babel.js
+++ b/packages/build/src/babel.js
@@ -11,7 +11,7 @@
* Library files get 'astryx' prefix (.astryx78zum5), product files get 'x' (.x78zum5).
*/
-const XDS_LIBRARY_PATTERNS = [
+const LIBRARY_PATTERNS = [
'packages/core/',
'packages/themes/',
'packages/lab/',
@@ -22,7 +22,7 @@ module.exports = function xdsBabelPlugin(api, options) {
const stylexPlugin = require('@stylexjs/babel-plugin');
const {
- libraryPatterns = XDS_LIBRARY_PATTERNS,
+ libraryPatterns = LIBRARY_PATTERNS,
libraryPrefix = 'astryx',
classNamePrefix = 'x',
...stylexOptions
diff --git a/packages/build/src/index.js b/packages/build/src/index.js
index 11158848a6..b81629c9c7 100644
--- a/packages/build/src/index.js
+++ b/packages/build/src/index.js
@@ -26,8 +26,8 @@ const globParent = require('glob-parent');
const PLUGIN_NAME = '@astryxdesign/postcss-plugin';
-const XDS_LIBRARY_GLOB = 'node_modules/@astryxdesign/**/*.{ts,tsx}';
-const XDS_LIBRARY_PATTERNS = ['node_modules/@astryxdesign/', 'packages/core/', 'packages/themes/'];
+const LIBRARY_GLOB = 'node_modules/@astryxdesign/**/*.{ts,tsx}';
+const LIBRARY_PATTERNS = ['node_modules/@astryxdesign/', 'packages/core/', 'packages/themes/'];
const STYLEX_IMPORT_SOURCE = '@stylexjs/stylex';
function parseDependency(fileOrGlob, cwd) {
@@ -84,12 +84,12 @@ function createPlugin() {
// Class name prefix for library styles (product keeps default 'x')
libraryPrefix = 'astryx',
extraInclude = [],
- libraryPatterns = XDS_LIBRARY_PATTERNS,
+ libraryPatterns = LIBRARY_PATTERNS,
exclude = [],
}) => {
const include = [
`${appDir}/**/*.{js,jsx,ts,tsx}`,
- XDS_LIBRARY_GLOB,
+ LIBRARY_GLOB,
...extraInclude,
];
diff --git a/packages/build/src/vite.ts b/packages/build/src/vite.ts
index fb69e820b4..26046d04d3 100644
--- a/packages/build/src/vite.ts
+++ b/packages/build/src/vite.ts
@@ -8,7 +8,7 @@ import {fileURLToPath} from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
-const XDS_LIBRARY_PATTERN = 'node_modules/@astryxdesign/';
+const LIBRARY_PATTERN = 'node_modules/@astryxdesign/';
const STYLEX_CSS_PATH = '/virtual:stylex.css';
/**
@@ -121,7 +121,7 @@ export function xdsStylex(
const {
dev = process.env.NODE_ENV !== 'production',
rootDir = process.cwd(),
- libraryPattern = XDS_LIBRARY_PATTERN,
+ libraryPattern = LIBRARY_PATTERN,
layers = {},
lightningcssTargets,
stylexPrefix = 'astryx',
@@ -305,7 +305,7 @@ export function xdsStylex(
function xdsStylexLegacy(options: XDSVitePluginLegacyOptions): Plugin[] {
const {
stylexOptions,
- libraryPattern = XDS_LIBRARY_PATTERN,
+ libraryPattern = LIBRARY_PATTERN,
stylexPrefix = 'astryx',
layers = {},
} = options;