@archilogic/plugin-container 0.0.0-20260119145126 → 0.0.0-20260209135631
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/index.html +2 -36
- package/package.json +10 -1
package/index.html
CHANGED
|
@@ -26,42 +26,8 @@
|
|
|
26
26
|
<body>
|
|
27
27
|
<div id="app"></div>
|
|
28
28
|
<script type="module">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const url = queries.get('extensionUrl') || queries.get('pluginUrl')
|
|
32
|
-
|
|
33
|
-
if (!url) {
|
|
34
|
-
document.getElementById('app').innerHTML =
|
|
35
|
-
'Please provide an extension URL as a query parameter: extensionUrl.'
|
|
36
|
-
|
|
37
|
-
throw new Error('No extension URL provided')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const name = queries.get('pluginName') ?? url.split('/').pop()
|
|
41
|
-
|
|
42
|
-
console.info(`${name}: Loading plugin from ${url}`)
|
|
43
|
-
|
|
44
|
-
import(/* @vite-ignore */ url)
|
|
45
|
-
.then(pluginModule => {
|
|
46
|
-
// backawards compatibility for 'runPlugin' method
|
|
47
|
-
const run = pluginModule.run || pluginModule.runPlugin
|
|
48
|
-
|
|
49
|
-
if (typeof run !== 'function') {
|
|
50
|
-
throw new Error(`${name}: Could not find extension method 'run' in ${url}`)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
console.info(`${name}: Loaded plugin from ${url}`)
|
|
54
|
-
|
|
55
|
-
run({
|
|
56
|
-
pluginModule,
|
|
57
|
-
container: document.getElementById('app'),
|
|
58
|
-
url,
|
|
59
|
-
name
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
.catch(error => {
|
|
63
|
-
console.error(`${name}: Error loading plugin from ${url}`, error)
|
|
64
|
-
})
|
|
29
|
+
import { initExtension } from './src/main.ts'
|
|
30
|
+
initExtension()
|
|
65
31
|
</script>
|
|
66
32
|
</body>
|
|
67
33
|
</html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archilogic/plugin-container",
|
|
3
3
|
"description": "An HTML container for Archilogic plugins",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-20260209135631",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,7 +11,16 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"dev": "vite",
|
|
14
|
+
"build": "vite build",
|
|
15
|
+
"dev:e2e": "vite --config ./vite.config-e2e.ts",
|
|
16
|
+
"dev:all": "concurrently \"npm run dev\" \"npm run dev:e2e\"",
|
|
14
17
|
"preview": "vite preview --outDir=../ --port 3000",
|
|
15
18
|
"test:e2e": "npx playwright test"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"concurrently": "^9.2.1"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@archilogic/extension-sdk": "0.0.0-20260209135631"
|
|
16
25
|
}
|
|
17
26
|
}
|