@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.
Files changed (119) hide show
  1. package/README.md +123 -66
  2. package/lib/configuration.d.ts +63 -0
  3. package/lib/configuration.d.ts.map +1 -0
  4. package/lib/configuration.js +68 -0
  5. package/lib/configuration.js.map +1 -0
  6. package/lib/download-template.d.ts +5 -0
  7. package/lib/download-template.d.ts.map +1 -0
  8. package/lib/download-template.js +33 -0
  9. package/lib/download-template.js.map +1 -0
  10. package/lib/index.d.ts +9 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +159 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/package-manager.d.ts +10 -0
  15. package/lib/package-manager.d.ts.map +1 -0
  16. package/lib/package-manager.js +74 -0
  17. package/lib/package-manager.js.map +1 -0
  18. package/lib/process-template.d.ts +25 -0
  19. package/lib/process-template.d.ts.map +1 -0
  20. package/lib/process-template.js +186 -0
  21. package/lib/process-template.js.map +1 -0
  22. package/lib/prompts.d.ts +6 -0
  23. package/lib/prompts.d.ts.map +1 -0
  24. package/lib/prompts.js +54 -0
  25. package/lib/prompts.js.map +1 -0
  26. package/lib/template-config.d.ts +87 -0
  27. package/lib/template-config.d.ts.map +1 -0
  28. package/lib/template-config.js +23 -0
  29. package/lib/template-config.js.map +1 -0
  30. package/lib/template-selector.d.ts +7 -0
  31. package/lib/template-selector.d.ts.map +1 -0
  32. package/lib/template-selector.js +56 -0
  33. package/lib/template-selector.js.map +1 -0
  34. package/lib/transforms.d.ts +33 -0
  35. package/lib/transforms.d.ts.map +1 -0
  36. package/lib/transforms.js +81 -0
  37. package/lib/transforms.js.map +1 -0
  38. package/package.json +22 -32
  39. package/bin/create-plugin.mjs +0 -2
  40. package/lib/Package.d.ts +0 -42
  41. package/lib/Package.d.ts.map +0 -1
  42. package/lib/Package.js +0 -52
  43. package/lib/Package.js.map +0 -1
  44. package/lib/TemplateInit.d.ts +0 -30
  45. package/lib/TemplateInit.d.ts.map +0 -1
  46. package/lib/TemplateInit.js +0 -48
  47. package/lib/TemplateInit.js.map +0 -1
  48. package/lib/ToolTemplateInit.d.ts +0 -10
  49. package/lib/ToolTemplateInit.d.ts.map +0 -1
  50. package/lib/ToolTemplateInit.js +0 -58
  51. package/lib/ToolTemplateInit.js.map +0 -1
  52. package/lib/WebTemplateInit.d.ts +0 -10
  53. package/lib/WebTemplateInit.d.ts.map +0 -1
  54. package/lib/WebTemplateInit.js +0 -68
  55. package/lib/WebTemplateInit.js.map +0 -1
  56. package/lib/copy.d.ts +0 -12
  57. package/lib/copy.d.ts.map +0 -1
  58. package/lib/copy.js +0 -45
  59. package/lib/copy.js.map +0 -1
  60. package/lib/deps.d.ts +0 -3
  61. package/lib/deps.d.ts.map +0 -1
  62. package/lib/deps.js +0 -20
  63. package/lib/deps.js.map +0 -1
  64. package/lib/hasBin.d.ts +0 -2
  65. package/lib/hasBin.d.ts.map +0 -1
  66. package/lib/hasBin.js +0 -14
  67. package/lib/hasBin.js.map +0 -1
  68. package/lib/init.d.ts +0 -2
  69. package/lib/init.d.ts.map +0 -1
  70. package/lib/init.js +0 -124
  71. package/lib/init.js.map +0 -1
  72. package/lib/main.d.ts +0 -2
  73. package/lib/main.d.ts.map +0 -1
  74. package/lib/main.js +0 -8
  75. package/lib/main.js.map +0 -1
  76. package/lib/template.d.ts +0 -4
  77. package/lib/template.d.ts.map +0 -1
  78. package/lib/template.js +0 -16
  79. package/lib/template.js.map +0 -1
  80. package/lib/types.d.ts +0 -12
  81. package/lib/types.d.ts.map +0 -1
  82. package/lib/types.js +0 -20
  83. package/lib/types.js.map +0 -1
  84. package/lib/utils.d.ts +0 -2
  85. package/lib/utils.d.ts.map +0 -1
  86. package/lib/utils.js +0 -7
  87. package/lib/utils.js.map +0 -1
  88. package/templates/tool/.env.example +0 -6
  89. package/templates/tool/.vscode/launch.json +0 -24
  90. package/templates/tool/README.md +0 -190
  91. package/templates/tool/api/index.ts +0 -8
  92. package/templates/tool/gitignore +0 -26
  93. package/templates/tool/rollup.config.js +0 -30
  94. package/templates/tool/src/collections/example/icon.svg.ts +0 -6
  95. package/templates/tool/src/collections/example/index.ts +0 -14
  96. package/templates/tool/src/collections/example/weather/WeatherTool.ts +0 -32
  97. package/templates/tool/src/collections/example/weather/manifest.ts +0 -16
  98. package/templates/tool/src/collections/index.ts +0 -7
  99. package/templates/tool/src/index.ts +0 -5
  100. package/templates/tool/src/server.ts +0 -71
  101. package/templates/tool/tsconfig.json +0 -24
  102. package/templates/tool/vite.config.js +0 -48
  103. package/templates/web/README.md +0 -156
  104. package/templates/web/eslint.config.js +0 -29
  105. package/templates/web/gitignore +0 -25
  106. package/templates/web/index.html.tmpl +0 -26
  107. package/templates/web/src/app.tsx +0 -8
  108. package/templates/web/src/assets.ts +0 -26
  109. package/templates/web/src/env.ts.tmpl +0 -14
  110. package/templates/web/src/index.css +0 -21
  111. package/templates/web/src/main.tsx.tmpl +0 -21
  112. package/templates/web/src/pages.tsx +0 -31
  113. package/templates/web/src/plugin.tsx.tmpl +0 -18
  114. package/templates/web/src/routes.tsx +0 -17
  115. package/templates/web/src/vite-env.d.ts +0 -1
  116. package/templates/web/tsconfig.app.json +0 -51
  117. package/templates/web/tsconfig.json +0 -7
  118. package/templates/web/tsconfig.node.json +0 -27
  119. 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
- }