@master/create-css 2.0.0-rc.84 → 2.0.0-rc.85
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.
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +1 -1
- package/dist/transforms.js +39 -39
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const MASTER_CSS_PACKAGES: {
|
|
|
15
15
|
readonly eslintConfig: "@master/eslint-config-css";
|
|
16
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
|
|
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
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,
|
|
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/transforms.js
CHANGED
|
@@ -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
|
-
|
|
83
|
-
|
|
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
|
-
|
|
90
|
+
${rspackSetup},`);
|
|
91
91
|
if (/defineConfig\(\s*\{/.test(next)) return replaceFirst(next, /defineConfig\(\s*\{/, `defineConfig({
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
97
|
-
|
|
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
|
-
|
|
114
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
145
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
195
|
-
|
|
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
|
-
|
|
213
|
-
|
|
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
|
|
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
|
|
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.
|
|
44
|
+
"version": "2.0.0-rc.85",
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsdown --config ../../shared/tsdown-package.config.ts",
|
|
47
47
|
"dev": "tsdown --config ../../shared/tsdown-package.config.ts --watch",
|