@alien-css/vite 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +14 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +10 -0
- package/dist/components.d.ts +11 -0
- package/dist/configuration.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +13 -0
- package/dist/native.d.ts +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/reset-css.d.ts +1 -0
- package/dist/reset.d.ts +1 -0
- package/package.json +64 -4
- package/reset.css +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alien CSS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Alien CSS for Vite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```sh
|
|
4
|
+
bun add @alien-css/core
|
|
5
|
+
bun add -d @alien-css/vite
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { defineConfig } from "vite";
|
|
10
|
+
import alien from "@alien-css/vite";
|
|
11
|
+
|
|
12
|
+
export default defineConfig({ plugins: [alien()] });
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Place the Alien plugin before framework plugins. See the [framework guide](https://github.com/snowly14/alien/blob/main/docs/frameworks.md) for configuration and supported frameworks.
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NativeCompiler, SourceEdit } from "@alien-css/compiler";
|
|
2
|
+
export declare const isScript: (path: string) => boolean;
|
|
3
|
+
export declare const isComponent: (path: string) => boolean;
|
|
4
|
+
export declare const isSupported: (path: string) => boolean;
|
|
5
|
+
export type ModuleStyles = {
|
|
6
|
+
css: string;
|
|
7
|
+
edits: SourceEdit[];
|
|
8
|
+
importPosition: number;
|
|
9
|
+
};
|
|
10
|
+
/** Compile scripts before framework plugins lower them into component functions. */
|
|
11
|
+
export declare function transformModule(compiler: NativeCompiler, source: string, path: string, moduleId: string): Promise<ModuleStyles | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { prepareProject, projectDeclarations } from "@alien-css/compiler";
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// packages/alien-vite/src/plugin.ts
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { moduleIdentity, projectNamespace } from "@alien-css/compiler";
|
|
4
|
+
import MagicString from "magic-string";
|
|
5
|
+
import { normalizePath } from "vite";
|
|
6
|
+
|
|
7
|
+
// packages/alien-vite/src/components.ts
|
|
8
|
+
var isScript = (path) => /\.(?:[cm]?[jt]s|[jt]sx)$/.test(path) && !/\.d\.[cm]?ts$/.test(path);
|
|
9
|
+
var isComponent = (path) => /\.(vue|svelte|astro)$/.test(path);
|
|
10
|
+
var isSupported = (path) => isScript(path) || isComponent(path);
|
|
11
|
+
async function scriptBlocks(source, path) {
|
|
12
|
+
if (path.endsWith(".vue")) {
|
|
13
|
+
const { parse } = await import("vue/compiler-sfc");
|
|
14
|
+
const { descriptor, errors } = parse(source, { filename: path });
|
|
15
|
+
if (errors.length)
|
|
16
|
+
throw new Error(`${path}: ${errors.map(String).join(`
|
|
17
|
+
`)}`);
|
|
18
|
+
return [descriptor.script, descriptor.scriptSetup].flatMap((script, index) => {
|
|
19
|
+
if (!script || script.src)
|
|
20
|
+
return [];
|
|
21
|
+
if (script.lang && !["js", "jsx", "ts", "tsx"].includes(script.lang))
|
|
22
|
+
return [];
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
start: script.loc.start.offset,
|
|
26
|
+
end: script.loc.end.offset,
|
|
27
|
+
extension: script.lang ?? "js",
|
|
28
|
+
name: index === 0 ? "script" : "setup"
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (path.endsWith(".svelte")) {
|
|
34
|
+
const { parse } = await import("svelte/compiler");
|
|
35
|
+
const ast = parse(source, { modern: true, filename: path });
|
|
36
|
+
return [ast.module, ast.instance].flatMap((script, index) => {
|
|
37
|
+
if (!script || !("start" in script.content) || !("end" in script.content) || typeof script.content.start !== "number" || typeof script.content.end !== "number")
|
|
38
|
+
return [];
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
start: script.content.start,
|
|
42
|
+
end: script.content.end,
|
|
43
|
+
extension: "ts",
|
|
44
|
+
name: index === 0 ? "module" : "instance"
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const { parse } = await import("@astrojs/compiler");
|
|
50
|
+
const { ast, diagnostics } = await parse(source, { position: true });
|
|
51
|
+
const errors = diagnostics.filter((diagnostic) => diagnostic.severity === 1);
|
|
52
|
+
if (errors.length)
|
|
53
|
+
throw new Error(`${path}: ${errors.map((error) => error.text).join(`
|
|
54
|
+
`)}`);
|
|
55
|
+
return ast.children.flatMap((node) => {
|
|
56
|
+
if (node.type !== "frontmatter" || !node.position)
|
|
57
|
+
return [];
|
|
58
|
+
const start = node.position.start.offset + 3;
|
|
59
|
+
return [{ start, end: start + node.value.length, extension: "ts", name: "frontmatter" }];
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async function transformModule(compiler, source, path, moduleId) {
|
|
63
|
+
if (isScript(path)) {
|
|
64
|
+
const result = compiler.transform(source, path, moduleId);
|
|
65
|
+
return result && { css: result.css, edits: result.edits, importPosition: source.length };
|
|
66
|
+
}
|
|
67
|
+
const blocks = await scriptBlocks(source, path);
|
|
68
|
+
const edits = [];
|
|
69
|
+
let css = "";
|
|
70
|
+
let importPosition = 0;
|
|
71
|
+
for (const block of blocks) {
|
|
72
|
+
const result = compiler.transform(source.slice(block.start, block.end), `${path}.${block.extension}`, `${moduleId}#${block.name}`);
|
|
73
|
+
if (!result)
|
|
74
|
+
continue;
|
|
75
|
+
if (!edits.length)
|
|
76
|
+
importPosition = block.end;
|
|
77
|
+
css += result.css;
|
|
78
|
+
for (const edit of result.edits) {
|
|
79
|
+
edits.push({ ...edit, start: block.start + edit.start, end: block.start + edit.end });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return edits.length ? { css, edits, importPosition } : null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// packages/alien-vite/src/configuration.ts
|
|
86
|
+
import { prepareProject, projectDeclarations } from "@alien-css/compiler";
|
|
87
|
+
|
|
88
|
+
// packages/alien-vite/src/reset.ts
|
|
89
|
+
import { resetCss } from "@alien-css/compiler";
|
|
90
|
+
|
|
91
|
+
// packages/alien-vite/src/plugin.ts
|
|
92
|
+
var resetUrl = "/@alien/reset.css";
|
|
93
|
+
var cssPrefix = "virtual:alien/";
|
|
94
|
+
var resolvedCssPrefix = `\x00${cssPrefix}`;
|
|
95
|
+
var resetId = `${cssPrefix}reset.css`;
|
|
96
|
+
function alien(options = {}) {
|
|
97
|
+
let compiler;
|
|
98
|
+
const modules = new Map;
|
|
99
|
+
const versions = new Map;
|
|
100
|
+
const classOwners = new Map;
|
|
101
|
+
let root = process.cwd();
|
|
102
|
+
let namespace = options.namespace ?? "";
|
|
103
|
+
let globalsPath = "";
|
|
104
|
+
function identify(path) {
|
|
105
|
+
const { id: moduleId, digest, prefix } = moduleIdentity(root, namespace, path);
|
|
106
|
+
const owner = classOwners.get(prefix);
|
|
107
|
+
if (owner !== undefined && owner !== moduleId)
|
|
108
|
+
throw new Error(`Alien class-name collision between ${owner} and ${moduleId}`);
|
|
109
|
+
classOwners.set(prefix, moduleId);
|
|
110
|
+
return { moduleId, cssId: `${cssPrefix}${digest}.css` };
|
|
111
|
+
}
|
|
112
|
+
async function compile(source, path, moduleId, cssId) {
|
|
113
|
+
const cached = modules.get(cssId);
|
|
114
|
+
if (cached?.source === source)
|
|
115
|
+
return cached.result;
|
|
116
|
+
const request = Symbol();
|
|
117
|
+
const activeCompiler = compiler;
|
|
118
|
+
versions.set(cssId, request);
|
|
119
|
+
const result = await transformModule(activeCompiler, source, path, moduleId);
|
|
120
|
+
if (compiler !== activeCompiler)
|
|
121
|
+
return compile(source, path, moduleId, cssId);
|
|
122
|
+
if (versions.get(cssId) === request)
|
|
123
|
+
modules.set(cssId, { source, result });
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
let reloadQueue = Promise.resolve();
|
|
127
|
+
function reloadConfiguration(server) {
|
|
128
|
+
const reload = reloadQueue.then(async () => {
|
|
129
|
+
compiler = await prepareProject(root, options.globals);
|
|
130
|
+
modules.clear();
|
|
131
|
+
versions.clear();
|
|
132
|
+
server.moduleGraph.invalidateAll();
|
|
133
|
+
server.ws.send({ type: "full-reload" });
|
|
134
|
+
});
|
|
135
|
+
reloadQueue = reload.catch(() => {});
|
|
136
|
+
return reload;
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
name: "alien",
|
|
140
|
+
enforce: "pre",
|
|
141
|
+
async configResolved(config) {
|
|
142
|
+
root = resolve(config.root, options.root ?? ".");
|
|
143
|
+
globalsPath = normalizePath(resolve(root, options.globals ?? "alien.globals.ts"));
|
|
144
|
+
namespace = await projectNamespace(root, options.namespace);
|
|
145
|
+
},
|
|
146
|
+
async buildStart() {
|
|
147
|
+
compiler = await prepareProject(root, options.globals);
|
|
148
|
+
modules.clear();
|
|
149
|
+
versions.clear();
|
|
150
|
+
classOwners.clear();
|
|
151
|
+
this.addWatchFile(globalsPath);
|
|
152
|
+
},
|
|
153
|
+
configureServer(server) {
|
|
154
|
+
server.watcher.add(globalsPath);
|
|
155
|
+
const onConfigurationCreatedOrRemoved = (file) => {
|
|
156
|
+
if (normalizePath(file) !== globalsPath)
|
|
157
|
+
return;
|
|
158
|
+
reloadConfiguration(server).catch((error) => {
|
|
159
|
+
server.ws.send({
|
|
160
|
+
type: "error",
|
|
161
|
+
err: {
|
|
162
|
+
message: error instanceof Error ? error.message : String(error),
|
|
163
|
+
stack: "",
|
|
164
|
+
plugin: "alien"
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
server.watcher.on("add", onConfigurationCreatedOrRemoved);
|
|
170
|
+
server.watcher.on("unlink", onConfigurationCreatedOrRemoved);
|
|
171
|
+
server.watcher.on("unlink", (file) => {
|
|
172
|
+
if (isSupported(file)) {
|
|
173
|
+
const { cssId } = identify(normalizePath(file));
|
|
174
|
+
modules.delete(cssId);
|
|
175
|
+
versions.delete(cssId);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
transform: {
|
|
180
|
+
order: "pre",
|
|
181
|
+
async handler(source, id) {
|
|
182
|
+
const path = normalizePath(id);
|
|
183
|
+
if (!isSupported(path) || path.includes("/node_modules/") || path.includes("?") || path.startsWith("\x00"))
|
|
184
|
+
return null;
|
|
185
|
+
if (path === globalsPath) {
|
|
186
|
+
this.error("Do not import alien.globals.ts at runtime. Import alien and tokens from '@alien-css/core'; the plugin loads configuration statically.");
|
|
187
|
+
}
|
|
188
|
+
const { moduleId, cssId } = identify(path);
|
|
189
|
+
const result = await compile(source, path, moduleId, cssId);
|
|
190
|
+
if (!result)
|
|
191
|
+
return null;
|
|
192
|
+
const code = new MagicString(source);
|
|
193
|
+
for (const edit of result.edits)
|
|
194
|
+
code.overwrite(edit.start, edit.end, edit.replacement);
|
|
195
|
+
if (result.css) {
|
|
196
|
+
const imports = `${compiler.reset ? `import ${JSON.stringify(resetId)};
|
|
197
|
+
` : ""}import ${JSON.stringify(cssId)};
|
|
198
|
+
`;
|
|
199
|
+
code.appendLeft(result.importPosition, `
|
|
200
|
+
${imports}`);
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
code: code.toString(),
|
|
204
|
+
map: code.generateMap({ hires: true, source: path, includeContent: true })
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
transformIndexHtml: {
|
|
209
|
+
order: "pre",
|
|
210
|
+
handler() {
|
|
211
|
+
if (!compiler.reset)
|
|
212
|
+
return;
|
|
213
|
+
return [
|
|
214
|
+
{ tag: "link", attrs: { rel: "stylesheet", href: resetUrl }, injectTo: "head-prepend" }
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
resolveId(id) {
|
|
219
|
+
if (id === "@alien-css/vite/reset.css" || id === "alien-vite/reset.css")
|
|
220
|
+
return `\x00${resetId}`;
|
|
221
|
+
if (id === resetUrl || id.startsWith(`${resetUrl}?`)) {
|
|
222
|
+
return `\x00${resetId}${id.slice(resetUrl.length)}`;
|
|
223
|
+
}
|
|
224
|
+
if (id.startsWith(cssPrefix))
|
|
225
|
+
return `\x00${id}`;
|
|
226
|
+
},
|
|
227
|
+
load(id) {
|
|
228
|
+
if (id.split("?", 1)[0] === `\x00${resetId}`)
|
|
229
|
+
return resetCss(compiler.reset);
|
|
230
|
+
if (id.startsWith(resolvedCssPrefix))
|
|
231
|
+
return modules.get(id.slice(1))?.result?.css ?? "";
|
|
232
|
+
},
|
|
233
|
+
handleHotUpdate: {
|
|
234
|
+
order: "post",
|
|
235
|
+
async handler({ file, modules: changed, read, server }) {
|
|
236
|
+
if (normalizePath(file) === globalsPath) {
|
|
237
|
+
await reloadConfiguration(server);
|
|
238
|
+
return [];
|
|
239
|
+
}
|
|
240
|
+
if (!isSupported(file))
|
|
241
|
+
return;
|
|
242
|
+
const { moduleId, cssId } = identify(file);
|
|
243
|
+
const cssModule = server.moduleGraph.getModuleById(`\x00${cssId}`);
|
|
244
|
+
if (!cssModule)
|
|
245
|
+
return;
|
|
246
|
+
await compile(await read(), file, moduleId, cssId);
|
|
247
|
+
return [...new Set([...changed, cssModule])];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export {
|
|
253
|
+
alien as default
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
//# debugId=C671C745888ECD8F64756E2164756E21
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/plugin.ts", "../src/components.ts", "../src/configuration.ts", "../src/reset.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { resolve } from \"node:path\";\nimport { moduleIdentity, projectNamespace } from \"@alien-css/compiler\";\nimport MagicString from \"magic-string\";\nimport { normalizePath, type Plugin, type ViteDevServer } from \"vite\";\nimport { isSupported, type ModuleStyles, transformModule } from \"./components.ts\";\nimport { prepareProject } from \"./configuration.ts\";\nimport type { NativeCompiler } from \"./native.ts\";\n\nimport { resetCss } from \"./reset.ts\";\n\nconst resetUrl = \"/@alien/reset.css\";\nconst cssPrefix = \"virtual:alien/\";\nconst resolvedCssPrefix = `\\0${cssPrefix}`;\nconst resetId = `${cssPrefix}reset.css`;\n\nexport type AlienOptions = {\n /** Project root when the framework uses a different Vite root (for example Nuxt). */\n root?: string;\n /** Configuration path relative to the Alien project root. Defaults to alien.globals.ts. */\n globals?: string;\n /** Stable namespace for CSS shared by independently built applications. */\n namespace?: string;\n};\n\nexport default function alien(options: AlienOptions = {}): Plugin {\n let compiler: NativeCompiler;\n const modules = new Map<string, { source: string; result: ModuleStyles | null }>();\n const versions = new Map<string, symbol>();\n const classOwners = new Map<string, string>();\n let root = process.cwd();\n let namespace = options.namespace ?? \"\";\n let globalsPath = \"\";\n\n function identify(path: string) {\n const { id: moduleId, digest, prefix } = moduleIdentity(root, namespace, path);\n const owner = classOwners.get(prefix);\n if (owner !== undefined && owner !== moduleId)\n throw new Error(`Alien class-name collision between ${owner} and ${moduleId}`);\n classOwners.set(prefix, moduleId);\n return { moduleId, cssId: `${cssPrefix}${digest}.css` };\n }\n\n async function compile(\n source: string,\n path: string,\n moduleId: string,\n cssId: string,\n ): Promise<ModuleStyles | null> {\n const cached = modules.get(cssId);\n if (cached?.source === source) return cached.result;\n const request = Symbol();\n const activeCompiler = compiler;\n versions.set(cssId, request);\n const result = await transformModule(activeCompiler, source, path, moduleId);\n if (compiler !== activeCompiler) return compile(source, path, moduleId, cssId);\n if (versions.get(cssId) === request) modules.set(cssId, { source, result });\n return result;\n }\n\n let reloadQueue = Promise.resolve();\n function reloadConfiguration(server: ViteDevServer) {\n const reload = reloadQueue.then(async () => {\n compiler = await prepareProject(root, options.globals);\n modules.clear();\n versions.clear();\n server.moduleGraph.invalidateAll();\n server.ws.send({ type: \"full-reload\" });\n });\n reloadQueue = reload.catch(() => {});\n return reload;\n }\n\n return {\n name: \"alien\",\n enforce: \"pre\",\n async configResolved(config) {\n root = resolve(config.root, options.root ?? \".\");\n globalsPath = normalizePath(resolve(root, options.globals ?? \"alien.globals.ts\"));\n namespace = await projectNamespace(root, options.namespace);\n },\n async buildStart() {\n compiler = await prepareProject(root, options.globals);\n modules.clear();\n versions.clear();\n classOwners.clear();\n this.addWatchFile(globalsPath);\n },\n configureServer(server) {\n server.watcher.add(globalsPath);\n const onConfigurationCreatedOrRemoved = (file: string) => {\n if (normalizePath(file) !== globalsPath) return;\n void reloadConfiguration(server).catch((error: unknown) => {\n server.ws.send({\n type: \"error\",\n err: {\n message: error instanceof Error ? error.message : String(error),\n stack: \"\",\n plugin: \"alien\",\n },\n });\n });\n };\n server.watcher.on(\"add\", onConfigurationCreatedOrRemoved);\n server.watcher.on(\"unlink\", onConfigurationCreatedOrRemoved);\n server.watcher.on(\"unlink\", (file) => {\n if (isSupported(file)) {\n const { cssId } = identify(normalizePath(file));\n modules.delete(cssId);\n versions.delete(cssId);\n }\n });\n },\n transform: {\n order: \"pre\",\n async handler(source, id) {\n const path = normalizePath(id);\n if (\n !isSupported(path) ||\n path.includes(\"/node_modules/\") ||\n path.includes(\"?\") ||\n path.startsWith(\"\\0\")\n )\n return null;\n if (path === globalsPath) {\n this.error(\n \"Do not import alien.globals.ts at runtime. Import alien and tokens from '@alien-css/core'; the plugin loads configuration statically.\",\n );\n }\n const { moduleId, cssId } = identify(path);\n const result = await compile(source, path, moduleId, cssId);\n if (!result) return null;\n const code = new MagicString(source);\n for (const edit of result.edits) code.overwrite(edit.start, edit.end, edit.replacement);\n if (result.css) {\n const imports = `${compiler.reset ? `import ${JSON.stringify(resetId)};\\n` : \"\"}import ${JSON.stringify(cssId)};\\n`;\n code.appendLeft(result.importPosition, `\\n${imports}`);\n }\n return {\n code: code.toString(),\n map: code.generateMap({ hires: true, source: path, includeContent: true }),\n };\n },\n },\n transformIndexHtml: {\n order: \"pre\",\n handler() {\n if (!compiler.reset) return;\n return [\n { tag: \"link\", attrs: { rel: \"stylesheet\", href: resetUrl }, injectTo: \"head-prepend\" },\n ];\n },\n },\n resolveId(id) {\n if (id === \"@alien-css/vite/reset.css\" || id === \"alien-vite/reset.css\")\n return `\\0${resetId}`;\n if (id === resetUrl || id.startsWith(`${resetUrl}?`)) {\n return `\\0${resetId}${id.slice(resetUrl.length)}`;\n }\n if (id.startsWith(cssPrefix)) return `\\0${id}`;\n },\n load(id) {\n if (id.split(\"?\", 1)[0] === `\\0${resetId}`) return resetCss(compiler.reset);\n if (id.startsWith(resolvedCssPrefix)) return modules.get(id.slice(1))?.result?.css ?? \"\";\n },\n handleHotUpdate: {\n order: \"post\",\n async handler({ file, modules: changed, read, server }) {\n if (normalizePath(file) === globalsPath) {\n await reloadConfiguration(server);\n return [];\n }\n if (!isSupported(file)) return;\n const { moduleId, cssId } = identify(file);\n const cssModule = server.moduleGraph.getModuleById(`\\0${cssId}`);\n if (!cssModule) return;\n await compile(await read(), file, moduleId, cssId);\n return [...new Set([...changed, cssModule])];\n },\n },\n };\n}\n",
|
|
6
|
+
"import type { NativeCompiler, SourceEdit } from \"@alien-css/compiler\";\n\nexport const isScript = (path: string) =>\n /\\.(?:[cm]?[jt]s|[jt]sx)$/.test(path) && !/\\.d\\.[cm]?ts$/.test(path);\nexport const isComponent = (path: string) => /\\.(vue|svelte|astro)$/.test(path);\nexport const isSupported = (path: string) => isScript(path) || isComponent(path);\n\ntype ScriptBlock = { start: number; end: number; extension: string; name: string };\nexport type ModuleStyles = { css: string; edits: SourceEdit[]; importPosition: number };\n\nasync function scriptBlocks(source: string, path: string): Promise<ScriptBlock[]> {\n if (path.endsWith(\".vue\")) {\n const { parse } = await import(\"vue/compiler-sfc\");\n const { descriptor, errors } = parse(source, { filename: path });\n if (errors.length) throw new Error(`${path}: ${errors.map(String).join(\"\\n\")}`);\n return [descriptor.script, descriptor.scriptSetup].flatMap((script, index) => {\n if (!script || script.src) return [];\n if (script.lang && ![\"js\", \"jsx\", \"ts\", \"tsx\"].includes(script.lang)) return [];\n return [\n {\n start: script.loc.start.offset,\n end: script.loc.end.offset,\n extension: script.lang ?? \"js\",\n name: index === 0 ? \"script\" : \"setup\",\n },\n ];\n });\n }\n if (path.endsWith(\".svelte\")) {\n const { parse } = await import(\"svelte/compiler\");\n const ast = parse(source, { modern: true, filename: path });\n return [ast.module, ast.instance].flatMap((script, index) => {\n if (\n !script ||\n !(\"start\" in script.content) ||\n !(\"end\" in script.content) ||\n typeof script.content.start !== \"number\" ||\n typeof script.content.end !== \"number\"\n )\n return [];\n return [\n {\n start: script.content.start,\n end: script.content.end,\n extension: \"ts\",\n name: index === 0 ? \"module\" : \"instance\",\n },\n ];\n });\n }\n const { parse } = await import(\"@astrojs/compiler\");\n const { ast, diagnostics } = await parse(source, { position: true });\n const errors = diagnostics.filter((diagnostic) => diagnostic.severity === 1);\n if (errors.length) throw new Error(`${path}: ${errors.map((error) => error.text).join(\"\\n\")}`);\n return ast.children.flatMap((node) => {\n if (node.type !== \"frontmatter\" || !node.position) return [];\n // Frontmatter starts with a three-character delimiter. Its value is the\n // original script text; use JS string lengths to preserve UTF-16 offsets.\n const start = node.position.start.offset + 3;\n return [{ start, end: start + node.value.length, extension: \"ts\", name: \"frontmatter\" }];\n });\n}\n\n/** Compile scripts before framework plugins lower them into component functions. */\nexport async function transformModule(\n compiler: NativeCompiler,\n source: string,\n path: string,\n moduleId: string,\n): Promise<ModuleStyles | null> {\n if (isScript(path)) {\n const result = compiler.transform(source, path, moduleId);\n return result && { css: result.css, edits: result.edits, importPosition: source.length };\n }\n const blocks = await scriptBlocks(source, path);\n const edits: SourceEdit[] = [];\n let css = \"\";\n let importPosition = 0;\n for (const block of blocks) {\n const result = compiler.transform(\n source.slice(block.start, block.end),\n `${path}.${block.extension}`,\n `${moduleId}#${block.name}`,\n );\n if (!result) continue;\n if (!edits.length) importPosition = block.end;\n css += result.css;\n for (const edit of result.edits) {\n edits.push({ ...edit, start: block.start + edit.start, end: block.start + edit.end });\n }\n }\n return edits.length ? { css, edits, importPosition } : null;\n}\n",
|
|
7
|
+
"export { prepareProject, projectDeclarations } from \"@alien-css/compiler\";\n",
|
|
8
|
+
"export { resetCss } from \"@alien-css/compiler\";\n"
|
|
9
|
+
],
|
|
10
|
+
"mappings": ";AAAA;AACA;AACA;AACA;;;ACDO,IAAM,WAAW,CAAC,SACvB,2BAA2B,KAAK,IAAI,KAAK,CAAC,gBAAgB,KAAK,IAAI;AAC9D,IAAM,cAAc,CAAC,SAAiB,wBAAwB,KAAK,IAAI;AACvE,IAAM,cAAc,CAAC,SAAiB,SAAS,IAAI,KAAK,YAAY,IAAI;AAK/E,eAAe,YAAY,CAAC,QAAgB,MAAsC;AAAA,EAChF,IAAI,KAAK,SAAS,MAAM,GAAG;AAAA,IACzB,QAAQ,UAAU,MAAM;AAAA,IACxB,QAAQ,YAAY,WAAW,MAAM,QAAQ,EAAE,UAAU,KAAK,CAAC;AAAA,IAC/D,IAAI,OAAO;AAAA,MAAQ,MAAM,IAAI,MAAM,GAAG,SAAS,OAAO,IAAI,MAAM,EAAE,KAAK;AAAA,CAAI,GAAG;AAAA,IAC9E,OAAO,CAAC,WAAW,QAAQ,WAAW,WAAW,EAAE,QAAQ,CAAC,QAAQ,UAAU;AAAA,MAC5E,IAAI,CAAC,UAAU,OAAO;AAAA,QAAK,OAAO,CAAC;AAAA,MACnC,IAAI,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,MAAM,KAAK,EAAE,SAAS,OAAO,IAAI;AAAA,QAAG,OAAO,CAAC;AAAA,MAC9E,OAAO;AAAA,QACL;AAAA,UACE,OAAO,OAAO,IAAI,MAAM;AAAA,UACxB,KAAK,OAAO,IAAI,IAAI;AAAA,UACpB,WAAW,OAAO,QAAQ;AAAA,UAC1B,MAAM,UAAU,IAAI,WAAW;AAAA,QACjC;AAAA,MACF;AAAA,KACD;AAAA,EACH;AAAA,EACA,IAAI,KAAK,SAAS,SAAS,GAAG;AAAA,IAC5B,QAAQ,UAAU,MAAM;A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MAChD;AAAA,MACA,IAAI,GAAG,WAAW,SAAS;AAAA,QAAG,OAAO,OAAK;AAAA;AAAA,IAE5C,IAAI,CAAC,IAAI;AAAA,MACP,IAAI,GAAG,MAAM,KAAK,CAAC,EAAE,OAAO,OAAK;AAAA,QAAW,OAAO,SAAS,SAAS,KAAK;AAAA,MAC1E,IAAI,GAAG,WAAW,iBAAiB;AAAA,QAAG,OAAO,QAAQ,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,QAAQ,OAAO;AAAA;AAAA,IAExF,iBAAiB;AAAA,MACf,OAAO;AAAA,YACD,OAAO,GAAG,MAAM,SAAS,SAAS,MAAM,UAAU;AAAA,QACtD,IAAI,cAAc,IAAI,MAAM,aAAa;AAAA,UACvC,MAAM,oBAAoB,MAAM;AAAA,UAChC,OAAO,CAAC;AAAA,QACV;AAAA,QACA,IAAI,CAAC,YAAY,IAAI;AAAA,UAAG;AAAA,QACxB,QAAQ,UAAU,UAAU,SAAS,IAAI;AAAA,QACzC,MAAM,YAAY,OAAO,YAAY,cAAc,OAAK,OAAO;AAAA,QAC/D,IAAI,CAAC;AAAA,UAAW;AAAA,QAChB,MAAM,QAAQ,MAAM,KAAK,GAAG,MAAM,UAAU,KAAK;AAAA,QACjD,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC;AAAA;AAAA,IAE/C;AAAA,EACF;AAAA;",
|
|
11
|
+
"debugId": "C671C745888ECD8F64756E2164756E21",
|
|
12
|
+
"names": []
|
|
13
|
+
}
|
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadCompiler, type NativeCompiler, type SourceEdit, type TransformedModule, } from "@alien-css/compiler";
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Plugin } from "vite";
|
|
2
|
+
export type AlienOptions = {
|
|
3
|
+
/** Project root when the framework uses a different Vite root (for example Nuxt). */
|
|
4
|
+
root?: string;
|
|
5
|
+
/** Configuration path relative to the Alien project root. Defaults to alien.globals.ts. */
|
|
6
|
+
globals?: string;
|
|
7
|
+
/** Stable namespace for CSS shared by independently built applications. */
|
|
8
|
+
namespace?: string;
|
|
9
|
+
};
|
|
10
|
+
export default function alien(options?: AlienOptions): Plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/reset.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resetCss } from "@alien-css/compiler";
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alien-css/vite",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./reset.css": {
|
|
12
|
+
"types": "./dist/reset-css.d.ts",
|
|
13
|
+
"default": "./reset.css"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"reset.css"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"vite": "^8.3.8",
|
|
22
|
+
"vue": "^3.5.0",
|
|
23
|
+
"svelte": "^5.0.0",
|
|
24
|
+
"@astrojs/compiler": "^4.0.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"magic-string": "^0.30.21",
|
|
28
|
+
"@alien-css/compiler": "0.1.0"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"alien": "./dist/cli.js"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=22.22.3"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"vue": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"svelte": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"@astrojs/compiler": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"description": "Vite integration for Alien CSS.",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/snowly14/alien.git",
|
|
51
|
+
"directory": "packages/alien-vite"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/snowly14/alien#readme",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/snowly14/alien/issues"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"css",
|
|
59
|
+
"typescript",
|
|
60
|
+
"styling",
|
|
61
|
+
"alien-css"
|
|
62
|
+
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/reset.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Resolved by the Alien Vite plugin using alien.globals.ts. */
|