Skip to content

Commit f49b422

Browse files
committed
add domside & worker support
1 parent f8f344b commit f49b422

File tree

11 files changed

+224
-118
lines changed

11 files changed

+224
-118
lines changed

build.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync, mkdirSync, closeSync, openSync, writeFileSync, copyFileSync, readFileSync } from "fs";
33
import { join } from "path";
44

5+
const __dirname = import.meta.dirname;
6+
57
// get command line arguments
68
const args = process.argv.slice(2);
79
const devBuild = args.includes("--dev");
@@ -571,6 +573,7 @@ try {
571573
const pluginWithPluginInfo = plugin
572574
.replaceAll("//<-- PLUGIN_INFO -->", pluginPluginInfo)
573575
.replaceAll("//<-- INSTANCE -->", instance)
576+
.replaceAll("//<-- DOM_COMPONENT_ID -->", `DOM_COMPONENT_ID = "${config.id}";`)
574577
.replaceAll("//<-- C3_INSTANCE -->", `const C3 = ${sdk === 'v1' ? 'self' : 'globalThis'}.C3;`)
575578
.replaceAll("//<-- SDK_VERSION -->", `sdk = "${sdk}"`)
576579

examples/example.c3p

-16 Bytes
Binary file not shown.

mise.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
node = "22.14.0"
33

44
[env]
5-
_.file = ".env"
5+
_.file = ".env"
6+
7+
[tasks.build]
8+
run = "pnpm run build"
9+
10+
[tasks.validate]
11+
run = "pnpm run validate"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
},
3131
"homepage": "https://github.com/CynToolkit/construct-plugin#readme",
3232
"devDependencies": {
33+
"@types/node": "24.1.0",
3334
"c3ide2-types": "1.0.1",
3435
"electron": "35.0.3",
3536
"lefthook": "1.11.3",

pnpm-lock.yaml

Lines changed: 83 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)