bun-plugin-stx 0.2.146 → 0.2.147
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,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/index.ts
|
|
3
3
|
import path2 from "path";
|
|
4
|
-
import { buildWebComponents, cacheTemplate, checkCache,
|
|
4
|
+
import { buildWebComponents, cacheTemplate, checkCache, classifyAllScripts, defaultConfig, extractVariables, processClientScript, processDirectives, readMarkdownFile } from "@stacksjs/stx";
|
|
5
5
|
|
|
6
6
|
// src/watch.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -388,25 +388,9 @@ export { content as default };
|
|
|
388
388
|
if (templateTagMatch) {
|
|
389
389
|
workingContent = templateTagMatch[1].trim();
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
const clientScripts =
|
|
393
|
-
const serverScripts =
|
|
394
|
-
const signalsScripts = [];
|
|
395
|
-
let scriptMatch;
|
|
396
|
-
while ((scriptMatch = scriptRegex.exec(content)) !== null) {
|
|
397
|
-
const classified = classifyScript(scriptMatch[1], scriptMatch[2], scriptMatch[0]);
|
|
398
|
-
switch (classified.type) {
|
|
399
|
-
case "signals":
|
|
400
|
-
signalsScripts.push(classified.fullTag);
|
|
401
|
-
break;
|
|
402
|
-
case "client":
|
|
403
|
-
clientScripts.push(classified.fullTag);
|
|
404
|
-
break;
|
|
405
|
-
case "server":
|
|
406
|
-
serverScripts.push(classified.content);
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
391
|
+
const classified = classifyAllScripts(content);
|
|
392
|
+
const clientScripts = classified.client.map((s) => s.fullTag);
|
|
393
|
+
const serverScripts = classified.server.map((s) => s.content);
|
|
410
394
|
let templateContent = workingContent;
|
|
411
395
|
for (const script of serverScripts) {
|
|
412
396
|
const escapedScript = script.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
package/dist/index.js
CHANGED
package/dist/preload.js
CHANGED
package/package.json
CHANGED