@vertesia/create-plugin 0.80.0-dev.20251121 → 0.80.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/README.md +123 -66
- package/lib/configuration.d.ts +63 -0
- package/lib/configuration.d.ts.map +1 -0
- package/lib/configuration.js +68 -0
- package/lib/configuration.js.map +1 -0
- package/lib/download-template.d.ts +5 -0
- package/lib/download-template.d.ts.map +1 -0
- package/lib/download-template.js +33 -0
- package/lib/download-template.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +159 -0
- package/lib/index.js.map +1 -0
- package/lib/package-manager.d.ts +10 -0
- package/lib/package-manager.d.ts.map +1 -0
- package/lib/package-manager.js +74 -0
- package/lib/package-manager.js.map +1 -0
- package/lib/process-template.d.ts +25 -0
- package/lib/process-template.d.ts.map +1 -0
- package/lib/process-template.js +186 -0
- package/lib/process-template.js.map +1 -0
- package/lib/prompts.d.ts +6 -0
- package/lib/prompts.d.ts.map +1 -0
- package/lib/prompts.js +54 -0
- package/lib/prompts.js.map +1 -0
- package/lib/template-config.d.ts +87 -0
- package/lib/template-config.d.ts.map +1 -0
- package/lib/template-config.js +23 -0
- package/lib/template-config.js.map +1 -0
- package/lib/template-selector.d.ts +7 -0
- package/lib/template-selector.d.ts.map +1 -0
- package/lib/template-selector.js +56 -0
- package/lib/template-selector.js.map +1 -0
- package/lib/transforms.d.ts +33 -0
- package/lib/transforms.d.ts.map +1 -0
- package/lib/transforms.js +81 -0
- package/lib/transforms.js.map +1 -0
- package/package.json +22 -32
- package/bin/create-plugin.mjs +0 -2
- package/lib/Package.d.ts +0 -42
- package/lib/Package.d.ts.map +0 -1
- package/lib/Package.js +0 -52
- package/lib/Package.js.map +0 -1
- package/lib/TemplateInit.d.ts +0 -30
- package/lib/TemplateInit.d.ts.map +0 -1
- package/lib/TemplateInit.js +0 -48
- package/lib/TemplateInit.js.map +0 -1
- package/lib/ToolTemplateInit.d.ts +0 -10
- package/lib/ToolTemplateInit.d.ts.map +0 -1
- package/lib/ToolTemplateInit.js +0 -58
- package/lib/ToolTemplateInit.js.map +0 -1
- package/lib/WebTemplateInit.d.ts +0 -10
- package/lib/WebTemplateInit.d.ts.map +0 -1
- package/lib/WebTemplateInit.js +0 -68
- package/lib/WebTemplateInit.js.map +0 -1
- package/lib/copy.d.ts +0 -12
- package/lib/copy.d.ts.map +0 -1
- package/lib/copy.js +0 -45
- package/lib/copy.js.map +0 -1
- package/lib/deps.d.ts +0 -3
- package/lib/deps.d.ts.map +0 -1
- package/lib/deps.js +0 -20
- package/lib/deps.js.map +0 -1
- package/lib/hasBin.d.ts +0 -2
- package/lib/hasBin.d.ts.map +0 -1
- package/lib/hasBin.js +0 -14
- package/lib/hasBin.js.map +0 -1
- package/lib/init.d.ts +0 -2
- package/lib/init.d.ts.map +0 -1
- package/lib/init.js +0 -124
- package/lib/init.js.map +0 -1
- package/lib/main.d.ts +0 -2
- package/lib/main.d.ts.map +0 -1
- package/lib/main.js +0 -8
- package/lib/main.js.map +0 -1
- package/lib/template.d.ts +0 -4
- package/lib/template.d.ts.map +0 -1
- package/lib/template.js +0 -16
- package/lib/template.js.map +0 -1
- package/lib/types.d.ts +0 -12
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -20
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts +0 -2
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -7
- package/lib/utils.js.map +0 -1
- package/templates/tool/.env.example +0 -6
- package/templates/tool/.vscode/launch.json +0 -24
- package/templates/tool/README.md +0 -190
- package/templates/tool/api/index.ts +0 -8
- package/templates/tool/gitignore +0 -26
- package/templates/tool/rollup.config.js +0 -30
- package/templates/tool/src/collections/example/icon.svg.ts +0 -6
- package/templates/tool/src/collections/example/index.ts +0 -14
- package/templates/tool/src/collections/example/weather/WeatherTool.ts +0 -32
- package/templates/tool/src/collections/example/weather/manifest.ts +0 -16
- package/templates/tool/src/collections/index.ts +0 -7
- package/templates/tool/src/index.ts +0 -5
- package/templates/tool/src/server.ts +0 -71
- package/templates/tool/tsconfig.json +0 -24
- package/templates/tool/vite.config.js +0 -48
- package/templates/web/README.md +0 -156
- package/templates/web/eslint.config.js +0 -29
- package/templates/web/gitignore +0 -25
- package/templates/web/index.html.tmpl +0 -26
- package/templates/web/src/app.tsx +0 -8
- package/templates/web/src/assets.ts +0 -26
- package/templates/web/src/env.ts.tmpl +0 -14
- package/templates/web/src/index.css +0 -21
- package/templates/web/src/main.tsx.tmpl +0 -21
- package/templates/web/src/pages.tsx +0 -31
- package/templates/web/src/plugin.tsx.tmpl +0 -18
- package/templates/web/src/routes.tsx +0 -17
- package/templates/web/src/vite-env.d.ts +0 -1
- package/templates/web/tsconfig.app.json +0 -51
- package/templates/web/tsconfig.json +0 -7
- package/templates/web/tsconfig.node.json +0 -27
- package/templates/web/vite.config.ts.tmpl +0 -128
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
2
|
-
import { vertesiaPluginBuilder } from '@vertesia/plugin-builder';
|
|
3
|
-
import basicSsl from '@vitejs/plugin-basic-ssl';
|
|
4
|
-
import react from '@vitejs/plugin-react';
|
|
5
|
-
import { defineConfig, type ConfigEnv, type UserConfig } from 'vite';
|
|
6
|
-
import serveStatic from "vite-plugin-serve-static";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* List of dependencies that must be bundled in the plugin bundle
|
|
11
|
-
*/
|
|
12
|
-
const INTERNALS: (string | RegExp)[] = [
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
function isExternal(id: string) {
|
|
16
|
-
// If it matches INTERNALS → bundle it
|
|
17
|
-
if (INTERNALS.some(pattern =>
|
|
18
|
-
pattern instanceof RegExp ? pattern.test(id) : id === pattern
|
|
19
|
-
)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Otherwise → treat all bare imports (node_modules deps) as external
|
|
24
|
-
return !id.startsWith('.') && !id.startsWith('/') && !id.startsWith('@/') && !id.startsWith('virtual:');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* if you want to debug vertesia ui sources define a relative path to the vertesia ui package root
|
|
30
|
-
*/
|
|
31
|
-
const VERTESIA_UI_PATH = ""
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Set to true to extract the css utility layer and inject it in the plugin js file.
|
|
35
|
-
* If you use shadow dom isolation for the plugin you must set this to false.
|
|
36
|
-
*/
|
|
37
|
-
const inlineCss = ${ inlineCss };
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Vite configuration to build the plugin as a library or as a standalone application or to run the application in dev mode.
|
|
41
|
-
* Use `vite build --mode lib` to build a library (plugin)
|
|
42
|
-
* Use `vite build` or `vite build --mode app`to build a standalone application
|
|
43
|
-
* Use `vite dev` to run the application in dev mode.
|
|
44
|
-
*/
|
|
45
|
-
export default defineConfig((env) => {
|
|
46
|
-
if (env.mode === 'lib') {
|
|
47
|
-
return defineLibConfig(env);
|
|
48
|
-
} else {
|
|
49
|
-
return defineAppConfig();
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Vite configuration to build a library (plugin).
|
|
55
|
-
* @param env - Vite configuration environment
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
function defineLibConfig({ command }: ConfigEnv): UserConfig {
|
|
59
|
-
const isBuildMode = command === 'build';
|
|
60
|
-
if (!isBuildMode) {
|
|
61
|
-
throw new Error("Library config is only available in 'build' mode. Please use 'lib' mode for library builds.");
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
plugins: [
|
|
65
|
-
tailwindcss(),
|
|
66
|
-
react(),
|
|
67
|
-
vertesiaPluginBuilder({ inlineCss })
|
|
68
|
-
],
|
|
69
|
-
build: {
|
|
70
|
-
outDir: 'dist/lib', // the plugin will be generated in the `dist/lib` directory
|
|
71
|
-
lib: {
|
|
72
|
-
entry: './src/plugin.tsx', // Main entry point of your library
|
|
73
|
-
formats: ['es'], // Build ESM versions
|
|
74
|
-
fileName: "plugin",
|
|
75
|
-
},
|
|
76
|
-
minify: true,
|
|
77
|
-
sourcemap: true,
|
|
78
|
-
rollupOptions: {
|
|
79
|
-
external: isExternal,
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Vite configuration to run the application in dev mode
|
|
87
|
-
* or to build a standalone application.
|
|
88
|
-
* @returns
|
|
89
|
-
*/
|
|
90
|
-
function defineAppConfig(): UserConfig {
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
plugins: [
|
|
94
|
-
tailwindcss(),
|
|
95
|
-
react(),
|
|
96
|
-
// we need to use https for the firebase authentication to work
|
|
97
|
-
basicSsl(),
|
|
98
|
-
// serve lib/plugin.js content in dev mode
|
|
99
|
-
serveStatic([
|
|
100
|
-
{
|
|
101
|
-
pattern: new RegExp("/plugin.(js|css)"),
|
|
102
|
-
resolve: (groups: string[]) => `./dist/lib/plugin.${groups[1]}`
|
|
103
|
-
},
|
|
104
|
-
]),
|
|
105
|
-
],
|
|
106
|
-
// for authentication with Firebase
|
|
107
|
-
server: {
|
|
108
|
-
proxy: {
|
|
109
|
-
'/__/auth': {
|
|
110
|
-
target: 'https://dengenlabs.firebaseapp.com',
|
|
111
|
-
changeOrigin: true,
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
resolve: {
|
|
116
|
-
// For debug support in vertesia ui sources - link to the vertesia/ui location
|
|
117
|
-
alias: VERTESIA_UI_PATH ? {
|
|
118
|
-
"@vertesia/ui": resolve(`${VERTESIA_UI_PATH}/src`)
|
|
119
|
-
} : undefined,
|
|
120
|
-
// Deduplicate React to prevent multiple instances
|
|
121
|
-
dedupe: ['react', 'react-dom']
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function resolve(path: string) {
|
|
127
|
-
return new URL(path, import.meta.url).pathname
|
|
128
|
-
}
|