@master/create-css 2.0.0-rc.84 → 2.0.0-rc.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
1
  //#region src/constants.d.ts
2
2
  declare const MASTER_CSS_VERSION = "rc";
3
3
  declare const MASTER_CSS_PACKAGES: {
4
- readonly css: "@master/css";
5
- readonly runtime: "@master/css-runtime";
6
- readonly preset: "@master/css-preset";
7
- readonly cli: "@master/css-cli";
8
- readonly vite: "@master/css.vite";
9
- readonly next: "@master/css.next";
10
- readonly nuxt: "@master/css.nuxt";
11
- readonly astro: "@master/css.astro";
12
- readonly svelte: "@master/css.svelte";
13
- readonly svelteAddon: "@master/css-sv";
14
- readonly webpack: "@master/css.webpack";
15
- readonly eslintConfig: "@master/eslint-config-css";
16
- readonly mcp: "@master/css-mcp";
4
+ readonly css: '@master/css';
5
+ readonly runtime: '@master/css-runtime';
6
+ readonly preset: '@master/css-preset';
7
+ readonly cli: '@master/css-cli';
8
+ readonly vite: '@master/css.vite';
9
+ readonly next: '@master/css.next';
10
+ readonly nuxt: '@master/css.nuxt';
11
+ readonly astro: '@master/css.astro';
12
+ readonly svelte: '@master/css.svelte';
13
+ readonly svelteAddon: '@master/css-sv';
14
+ readonly webpack: '@master/css.webpack';
15
+ readonly eslintConfig: '@master/eslint-config-css';
16
+ readonly mcp: '@master/css-mcp';
17
17
  };
18
- declare const CANONICAL_ESLINT_CONFIG = "import { defineConfig } from 'eslint/config'\nimport css from '@master/eslint-config-css'\n\nexport default defineConfig([\n ...css\n])\n";
18
+ declare const CANONICAL_ESLINT_CONFIG = "import { defineConfig } from 'eslint/config'\nimport css from '@master/eslint-config-css'\n\nexport default defineConfig([\n ...css\n])\n";
19
19
  declare const AGENT_RULES_BLOCK = "## Master CSS\n\n- Use https://rc.css.master.co as the source of truth.\n- Inspect the framework, package manager, CSS entry, rendering mode, theme tokens, component classes, utilities, custom variants, and validation commands before editing styles.\n- Prefer existing @theme tokens, @components, @utilities, and @custom-variant definitions.\n- Use the Master CSS MCP server when available.\n- Use ESLint for class policy diagnostics and the Master CSS Language Service for completion, hover, colors, highlighting, and directive formatting.\n- Do not invent Master CSS APIs, directives, package names, or Tailwind-style syntax.\n- Preserve semantic HTML, accessibility attributes, and behavior.\n";
20
20
  //#endregion
21
21
  export { AGENT_RULES_BLOCK, CANONICAL_ESLINT_CONFIG, MASTER_CSS_PACKAGES, MASTER_CSS_VERSION };
package/dist/constants.js CHANGED
@@ -19,7 +19,7 @@ const CANONICAL_ESLINT_CONFIG = `import { defineConfig } from 'eslint/config'
19
19
  import css from '@master/eslint-config-css'
20
20
 
21
21
  export default defineConfig([
22
- ...css
22
+ ...css
23
23
  ])
24
24
  `;
25
25
  const AGENT_RULES_BLOCK = `## Master CSS
package/dist/core.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { RenderingMode } from "./modes.js";
2
-
3
2
  //#region src/core.d.ts
4
3
  type CommandFramework = 'none' | 'vite' | 'react' | 'react-router' | 'tanstack-start' | 'vue' | 'nextjs' | 'svelte' | 'nuxt' | 'astro' | 'webpack' | 'rspack' | 'rsbuild' | 'laravel' | 'lit' | 'angular';
5
4
  type CommandFrameworkOption = CommandFramework | 'auto';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { RenderingMode } from "./modes.js";
2
-
3
2
  //#region src/index.d.ts
4
3
  type Framework = 'none' | 'vite' | 'react' | 'react-router' | 'tanstack-start' | 'vue' | 'nextjs' | 'svelte' | 'nuxt' | 'astro' | 'webpack' | 'rspack' | 'rsbuild' | 'laravel' | 'lit' | 'angular';
5
4
  type FrameworkOption = Framework | 'auto';
package/dist/index.js CHANGED
@@ -294,7 +294,7 @@ function applyDependencyChanges(root, dependencies) {
294
294
  if ((dependency.dev ? packageJSON.dependencies : packageJSON.devDependencies)?.[dependency.name]) continue;
295
295
  if (!target?.[dependency.name]) target[dependency.name] = dependency.version;
296
296
  }
297
- writeFileSync(packageJSONPath, `${JSON.stringify(packageJSON, null, 4)}\n`, "utf8");
297
+ writeFileSync(packageJSONPath, `${JSON.stringify(packageJSON, null, 2)}\n`, "utf8");
298
298
  }
299
299
  function pushDependency(dependencies, name, dev, version) {
300
300
  if (dependencies.some((dependency) => dependency.name === name)) return;
package/dist/modes.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/modes.d.ts
2
- declare const renderingModes: readonly ["runtime", "static", "progressive", "pre-render"];
2
+ declare const renderingModes: readonly ['runtime', 'static', 'progressive', 'pre-render'];
3
3
  type RenderingMode = typeof renderingModes[number];
4
4
  declare function isRenderingMode(value: unknown): value is RenderingMode;
5
5
  declare function formatRenderingModes(): string;
@@ -1,5 +1,4 @@
1
1
  import { RenderingMode } from "./modes.js";
2
-
3
2
  //#region src/transforms.d.ts
4
3
  declare function addMasterCSSImportToStylesheet(content: string): string;
5
4
  declare function createMasterCSSStylesheet(): string;
@@ -79,23 +79,23 @@ function addMasterCSSRsbuildPlugin(content, mode) {
79
79
  if (content.includes("@master/css.webpack")) return content;
80
80
  let next = addImport(content, "import MasterCSSPlugin from '@master/css.webpack'");
81
81
  const rspackSetupBody = ` config.plugins ||= []
82
- config.plugins.push(${formatWebpackPluginCall(mode)})
83
- return config`;
82
+ config.plugins.push(${formatWebpackPluginCall(mode)})
83
+ return config`;
84
84
  const rspackSetup = `rspack(config) {
85
85
  ${rspackSetupBody}
86
- }`;
86
+ }`;
87
87
  if (/rspack\s*\(\s*config\s*\)\s*\{/.test(next)) return replaceFirst(next, /rspack\s*\(\s*config\s*\)\s*\{/, `rspack(config) {
88
88
  ${rspackSetupBody}`);
89
89
  if (/tools\s*:\s*\{/.test(next)) return replaceFirst(next, /tools\s*:\s*\{/, `tools: {
90
- ${rspackSetup},`);
90
+ ${rspackSetup},`);
91
91
  if (/defineConfig\(\s*\{/.test(next)) return replaceFirst(next, /defineConfig\(\s*\{/, `defineConfig({
92
- tools: {
93
- ${rspackSetup}
94
- },`);
92
+ tools: {
93
+ ${rspackSetup}
94
+ },`);
95
95
  if (/export\s+default\s+\{/.test(next)) return replaceFirst(next, /export\s+default\s+\{/, `export default {
96
- tools: {
97
- ${rspackSetup}
98
- },`);
96
+ tools: {
97
+ ${rspackSetup}
98
+ },`);
99
99
  return next;
100
100
  }
101
101
  function addMasterCSSVitePluginCall(content, pluginCall) {
@@ -110,9 +110,9 @@ function createViteConfig(mode) {
110
110
  import masterCSS from '@master/css.vite'
111
111
 
112
112
  export default defineConfig({
113
- plugins: [
114
- ${formatMasterCSSCall(mode)}
115
- ]
113
+ plugins: [
114
+ ${formatMasterCSSCall(mode)}
115
+ ]
116
116
  })
117
117
  `;
118
118
  }
@@ -123,17 +123,17 @@ function createRspackConfig(mode) {
123
123
  return `import MasterCSSPlugin from '@master/css.webpack'
124
124
 
125
125
  export default {
126
- module: {
127
- rules: [
128
- {
129
- test: /\\.css$/i,
130
- type: 'css/auto'
131
- }
132
- ]
133
- },
134
- plugins: [
135
- ${formatWebpackPluginCall(mode)}
126
+ module: {
127
+ rules: [
128
+ {
129
+ test: /\\.css$/i,
130
+ type: 'css/auto'
131
+ }
136
132
  ]
133
+ },
134
+ plugins: [
135
+ ${formatWebpackPluginCall(mode)}
136
+ ]
137
137
  }
138
138
  `;
139
139
  }
@@ -141,9 +141,9 @@ function createWebpackConfig(mode) {
141
141
  return `import MasterCSSPlugin from '@master/css.webpack'
142
142
 
143
143
  export default {
144
- plugins: [
145
- ${formatWebpackPluginCall(mode)}
146
- ]
144
+ plugins: [
145
+ ${formatWebpackPluginCall(mode)}
146
+ ]
147
147
  }
148
148
  `;
149
149
  }
@@ -152,13 +152,13 @@ function createRsbuildConfig(mode) {
152
152
  import MasterCSSPlugin from '@master/css.webpack'
153
153
 
154
154
  export default defineConfig({
155
- tools: {
156
- rspack(config) {
157
- config.plugins ||= []
158
- config.plugins.push(${formatWebpackPluginCall(mode)})
159
- return config
160
- }
155
+ tools: {
156
+ rspack(config) {
157
+ config.plugins ||= []
158
+ config.plugins.push(${formatWebpackPluginCall(mode)})
159
+ return config
161
160
  }
161
+ }
162
162
  })
163
163
  `;
164
164
  }
@@ -191,8 +191,8 @@ function addMasterCSSNuxtModule(content, mode) {
191
191
  }
192
192
  function createNuxtConfig(mode) {
193
193
  return `export default defineNuxtConfig({
194
- modules: [${formatNuxtModule(mode)}],
195
- css: ['~/assets/css/master.css']
194
+ modules: [${formatNuxtModule(mode)}],
195
+ css: ['~/assets/css/master.css']
196
196
  })
197
197
  `;
198
198
  }
@@ -209,9 +209,9 @@ function createAstroConfig(mode) {
209
209
  import masterCSS from '@master/css.astro'
210
210
 
211
211
  export default defineConfig({
212
- integrations: [
213
- ${formatMasterCSSCall(mode)}
214
- ]
212
+ integrations: [
213
+ ${formatMasterCSSCall(mode)}
214
+ ]
215
215
  })
216
216
  `;
217
217
  }
@@ -258,9 +258,9 @@ function addMasterCSSEslintConfig(content) {
258
258
  if (!content.trim()) return CANONICAL_ESLINT_CONFIG;
259
259
  let next = addImport(content, "import { defineConfig } from 'eslint/config'");
260
260
  next = addImport(next, "import css from '@master/eslint-config-css'");
261
- if (/export\s+default\s+defineConfig\(\s*\[/.test(next)) return replaceFirst(next, /export\s+default\s+defineConfig\(\s*\[/, "export default defineConfig([\n ...css,");
261
+ if (/export\s+default\s+defineConfig\(\s*\[/.test(next)) return replaceFirst(next, /export\s+default\s+defineConfig\(\s*\[/, "export default defineConfig([\n ...css,");
262
262
  if (/export\s+default\s+\[/.test(next)) {
263
- next = replaceFirst(next, /export\s+default\s+\[/, "export default defineConfig([\n ...css,");
263
+ next = replaceFirst(next, /export\s+default\s+\[/, "export default defineConfig([\n ...css,");
264
264
  const closeIndex = next.lastIndexOf("]");
265
265
  return closeIndex === -1 ? next : `${next.slice(0, closeIndex + 1)})${next.slice(closeIndex + 1)}`;
266
266
  }
package/package.json CHANGED
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "commander": "^14.0.3"
43
43
  },
44
- "version": "2.0.0-rc.84",
44
+ "version": "2.0.0-rc.86",
45
45
  "scripts": {
46
46
  "build": "tsdown --config ../../shared/tsdown-package.config.ts",
47
47
  "dev": "tsdown --config ../../shared/tsdown-package.config.ts --watch",