@bamboocss/node 1.56.5 → 1.56.7
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/index.cjs +18 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +18 -1
- package/dist/native/darwin-arm64.node +0 -0
- package/dist/native/darwin-x64.node +0 -0
- package/dist/native/linux-arm64-gnu.node +0 -0
- package/dist/native/linux-x64-gnu.node +0 -0
- package/dist/native/win32-x64-msvc.node +0 -0
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -163,6 +163,20 @@ let convert;
|
|
|
163
163
|
const load = () => convert ??= (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("@astrojs/compiler/sync").convertToTSX;
|
|
164
164
|
/** The inline source map Astro appends, which nothing downstream reads. */
|
|
165
165
|
const SOURCE_MAP_COMMENT = /\n\/\/# sourceMappingURL=data:[^\n]*\s*$/;
|
|
166
|
+
/** A static `import` statement starting a line: a binding clause and `from`, or neither. */
|
|
167
|
+
const IMPORT_STATEMENT = /^[ \t]*import\s+(?:type\s+)?(?:[\w$*{}\s,]+?\s+from\s+)?(['"])[^'"\n]+\1[ \t]*;?/gm;
|
|
168
|
+
/**
|
|
169
|
+
* A bundled `<script>` as module code: its imports at the top level, where they bind, and the
|
|
170
|
+
* rest in a block of its own, so its declarations do not meet the frontmatter's.
|
|
171
|
+
*/
|
|
172
|
+
const moduleCode = (script) => {
|
|
173
|
+
const imports = [];
|
|
174
|
+
const body = script.content.replace(IMPORT_STATEMENT, (statement) => {
|
|
175
|
+
imports.push(statement.trim());
|
|
176
|
+
return "";
|
|
177
|
+
});
|
|
178
|
+
return `${imports.join("\n")}\n${/^[ \t]*export\b/m.test(body) ? body : `{\n${body}\n}`}`;
|
|
179
|
+
};
|
|
166
180
|
/**
|
|
167
181
|
* A `.astro` file as TSX the extractor can parse.
|
|
168
182
|
*
|
|
@@ -181,7 +195,10 @@ const astroToTsx = (code, filename) => {
|
|
|
181
195
|
} catch {
|
|
182
196
|
return "";
|
|
183
197
|
}
|
|
184
|
-
|
|
198
|
+
const tsx = result.code.replace(SOURCE_MAP_COMMENT, "\n");
|
|
199
|
+
const scripts = (result.metaRanges?.scripts ?? []).filter((script) => script.type === "processed-module");
|
|
200
|
+
if (!scripts.length) return tsx;
|
|
201
|
+
return `${tsx}\n${scripts.map(moduleCode).join("\n")}\n`;
|
|
185
202
|
};
|
|
186
203
|
/** Built in, rather than a plugin package: Astro support is part of the Vite integration. */
|
|
187
204
|
const pluginAstro = () => ({
|
package/dist/index.d.cts
CHANGED
|
@@ -134,6 +134,17 @@ interface FoldAnalysis {
|
|
|
134
134
|
dependencies: string[];
|
|
135
135
|
}>;
|
|
136
136
|
dependencies: string[];
|
|
137
|
+
/**
|
|
138
|
+
* Bamboo bindings a `<script setup>` compiled for a separate render function exposes to its
|
|
139
|
+
* template, as `__returned__` getters: where the getter reads the binding, what that becomes
|
|
140
|
+
* once nothing reads it, and every `$setup.<name>` the module reads.
|
|
141
|
+
*/
|
|
142
|
+
vueExposures: Array<{
|
|
143
|
+
name: string;
|
|
144
|
+
span: FoldSpan;
|
|
145
|
+
replacement: string;
|
|
146
|
+
reads: FoldSpan[];
|
|
147
|
+
}>;
|
|
137
148
|
errors: string[];
|
|
138
149
|
}
|
|
139
150
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -134,6 +134,17 @@ interface FoldAnalysis {
|
|
|
134
134
|
dependencies: string[];
|
|
135
135
|
}>;
|
|
136
136
|
dependencies: string[];
|
|
137
|
+
/**
|
|
138
|
+
* Bamboo bindings a `<script setup>` compiled for a separate render function exposes to its
|
|
139
|
+
* template, as `__returned__` getters: where the getter reads the binding, what that becomes
|
|
140
|
+
* once nothing reads it, and every `$setup.<name>` the module reads.
|
|
141
|
+
*/
|
|
142
|
+
vueExposures: Array<{
|
|
143
|
+
name: string;
|
|
144
|
+
span: FoldSpan;
|
|
145
|
+
replacement: string;
|
|
146
|
+
reads: FoldSpan[];
|
|
147
|
+
}>;
|
|
137
148
|
errors: string[];
|
|
138
149
|
}
|
|
139
150
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -151,6 +151,20 @@ let convert;
|
|
|
151
151
|
const load = () => convert ??= createRequire(import.meta.url)("@astrojs/compiler/sync").convertToTSX;
|
|
152
152
|
/** The inline source map Astro appends, which nothing downstream reads. */
|
|
153
153
|
const SOURCE_MAP_COMMENT = /\n\/\/# sourceMappingURL=data:[^\n]*\s*$/;
|
|
154
|
+
/** A static `import` statement starting a line: a binding clause and `from`, or neither. */
|
|
155
|
+
const IMPORT_STATEMENT = /^[ \t]*import\s+(?:type\s+)?(?:[\w$*{}\s,]+?\s+from\s+)?(['"])[^'"\n]+\1[ \t]*;?/gm;
|
|
156
|
+
/**
|
|
157
|
+
* A bundled `<script>` as module code: its imports at the top level, where they bind, and the
|
|
158
|
+
* rest in a block of its own, so its declarations do not meet the frontmatter's.
|
|
159
|
+
*/
|
|
160
|
+
const moduleCode = (script) => {
|
|
161
|
+
const imports = [];
|
|
162
|
+
const body = script.content.replace(IMPORT_STATEMENT, (statement) => {
|
|
163
|
+
imports.push(statement.trim());
|
|
164
|
+
return "";
|
|
165
|
+
});
|
|
166
|
+
return `${imports.join("\n")}\n${/^[ \t]*export\b/m.test(body) ? body : `{\n${body}\n}`}`;
|
|
167
|
+
};
|
|
154
168
|
/**
|
|
155
169
|
* A `.astro` file as TSX the extractor can parse.
|
|
156
170
|
*
|
|
@@ -169,7 +183,10 @@ const astroToTsx = (code, filename) => {
|
|
|
169
183
|
} catch {
|
|
170
184
|
return "";
|
|
171
185
|
}
|
|
172
|
-
|
|
186
|
+
const tsx = result.code.replace(SOURCE_MAP_COMMENT, "\n");
|
|
187
|
+
const scripts = (result.metaRanges?.scripts ?? []).filter((script) => script.type === "processed-module");
|
|
188
|
+
if (!scripts.length) return tsx;
|
|
189
|
+
return `${tsx}\n${scripts.map(moduleCode).join("\n")}\n`;
|
|
173
190
|
};
|
|
174
191
|
/** Built in, rather than a plugin package: Astro support is part of the Vite integration. */
|
|
175
192
|
const pluginAstro = () => ({
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/node",
|
|
3
|
-
"version": "1.56.
|
|
3
|
+
"version": "1.56.7",
|
|
4
4
|
"description": "The core css bamboo library",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,23 +61,23 @@
|
|
|
61
61
|
"pkg-types": "2.3.0",
|
|
62
62
|
"pluralize": "8.0.0",
|
|
63
63
|
"ts-pattern": "5.9.0",
|
|
64
|
-
"@bamboocss/config": "1.56.
|
|
65
|
-
"@bamboocss/core": "1.56.
|
|
66
|
-
"@bamboocss/generator": "1.56.
|
|
67
|
-
"@bamboocss/logger": "1.56.
|
|
68
|
-
"@bamboocss/plugin-svelte": "1.56.
|
|
69
|
-
"@bamboocss/plugin-vue": "1.56.
|
|
70
|
-
"@bamboocss/reporter": "1.56.
|
|
71
|
-
"@bamboocss/shared": "1.56.
|
|
72
|
-
"@bamboocss/token-dictionary": "1.56.
|
|
73
|
-
"@bamboocss/types": "1.56.
|
|
64
|
+
"@bamboocss/config": "1.56.7",
|
|
65
|
+
"@bamboocss/core": "1.56.7",
|
|
66
|
+
"@bamboocss/generator": "1.56.7",
|
|
67
|
+
"@bamboocss/logger": "1.56.7",
|
|
68
|
+
"@bamboocss/plugin-svelte": "1.56.7",
|
|
69
|
+
"@bamboocss/plugin-vue": "1.56.7",
|
|
70
|
+
"@bamboocss/reporter": "1.56.7",
|
|
71
|
+
"@bamboocss/shared": "1.56.7",
|
|
72
|
+
"@bamboocss/token-dictionary": "1.56.7",
|
|
73
|
+
"@bamboocss/types": "1.56.7"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@astrojs/compiler": "3.0.1",
|
|
77
77
|
"@types/fs-extra": "11.0.4",
|
|
78
78
|
"@types/picomatch": "4.0.2",
|
|
79
79
|
"boxen": "8.0.1",
|
|
80
|
-
"@bamboocss/native-extractor": "1.56.
|
|
80
|
+
"@bamboocss/native-extractor": "1.56.7"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@astrojs/compiler": ">=2"
|