@bubblydoo/uxp-test-framework-plugin 0.0.2

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 (39) hide show
  1. package/.npmignore +4 -0
  2. package/.turbo/daemon/b38c7656669412eb-turbo.log.2026-01-28 +0 -0
  3. package/.turbo/turbo-build.log +14 -0
  4. package/CHANGELOG.md +11 -0
  5. package/create-vite-config.ts +91 -0
  6. package/dist/create-vite-config.js +13965 -0
  7. package/index.html +12 -0
  8. package/package.json +63 -0
  9. package/postcss.config.cjs +8 -0
  10. package/public-zip/readme.txt +1 -0
  11. package/src/assets/bolt-uxp-quickstart.gif +0 -0
  12. package/src/assets/bolt-uxp.png +0 -0
  13. package/src/assets/bolt-uxp.svg +55 -0
  14. package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_Black_V01.png +0 -0
  15. package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_Black_V01.svg +78 -0
  16. package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_White_V01.png +0 -0
  17. package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_White_V01.svg +81 -0
  18. package/src/assets/react.png +0 -0
  19. package/src/assets/react.svg +36 -0
  20. package/src/assets/sass.png +0 -0
  21. package/src/assets/sass.svg +45 -0
  22. package/src/assets/svelte.png +0 -0
  23. package/src/assets/svelte.svg +1 -0
  24. package/src/assets/typescript.png +0 -0
  25. package/src/assets/typescript.svg +6 -0
  26. package/src/assets/vite.png +0 -0
  27. package/src/assets/vite.svg +1 -0
  28. package/src/assets/vue.png +0 -0
  29. package/src/assets/vue.svg +2 -0
  30. package/src/bolt-uxp-ws-listener.js +26 -0
  31. package/src/components/ErrorView.tsx +69 -0
  32. package/src/index-react.tsx +14 -0
  33. package/src/index.css +11 -0
  34. package/src/lib/resolvePath.ts +19 -0
  35. package/src/main.tsx +238 -0
  36. package/src/tests.d.ts +5 -0
  37. package/tailwind.config.js +15 -0
  38. package/tsup.config.ts +11 -0
  39. package/uxp.config.ts +109 -0
package/.npmignore ADDED
@@ -0,0 +1,4 @@
1
+ .gitignore
2
+ tsconfig.json
3
+ turbo.json
4
+ .DS_Store
@@ -0,0 +1,14 @@
1
+
2
+ 
3
+ > @bubblydoo/uxp-test-framework-plugin@0.0.2 build /Users/otto/Code/projects/bubbly/uxp-toolkit/packages/uxp-test-framework-plugin
4
+ > tsup
5
+
6
+ CLI Building entry: create-vite-config.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.1
9
+ CLI Using tsup config: /Users/otto/Code/projects/bubbly/uxp-toolkit/packages/uxp-test-framework-plugin/tsup.config.ts
10
+ CLI Target: node20
11
+ CLI Cleaning output folder
12
+ ESM Build start
13
+ ESM dist/create-vite-config.js 511.65 KB
14
+ ESM ⚡️ Build success in 40ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # @bubblydoo/uxp-test-framework-plugin
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 3cafb8e: Initial setup
8
+ - Updated dependencies [3cafb8e]
9
+ - @bubblydoo/uxp-polyfills@0.0.2
10
+ - @bubblydoo/uxp-test-framework-base@0.0.2
11
+ - @bubblydoo/uxp-toolkit@0.0.2
@@ -0,0 +1,91 @@
1
+ import { uxp } from "vite-uxp-plugin";
2
+ import { createUxpConfig } from "./uxp.config";
3
+ import path from "path";
4
+ import { defineConfig } from "vite";
5
+ import react from "@vitejs/plugin-react";
6
+ import { createRequire } from "module";
7
+ import { viteStaticCopy } from "vite-plugin-static-copy";
8
+ import tsconfigPaths from "vite-tsconfig-paths";
9
+ import z from "zod";
10
+
11
+ const require = createRequire(import.meta.url);
12
+ const pkg =
13
+ require.resolve("@bubblydoo/uxp-test-framework-plugin/package.json");
14
+ const root = path.dirname(pkg);
15
+
16
+ const resolvedConfigSchema = z.object({
17
+ plugin: z.object({
18
+ id: z.string(),
19
+ name: z.string(),
20
+ }),
21
+ outDir: z.string().refine((val) => path.isAbsolute(val), "Path must be absolute"),
22
+ testsFile: z.string().refine((val) => path.isAbsolute(val), "Path must be absolute"),
23
+ testFixturesDir: z.string().refine((val) => path.isAbsolute(val), "Path must be absolute").optional(),
24
+ vite: z.object({
25
+ enableTsconfigPathsPlugin: z.boolean().optional().default(false),
26
+ alias: z.record(z.string(), z.string().refine((val) => path.isAbsolute(val), "Path must be absolute")).optional().default({}),
27
+ }).optional().default({ enableTsconfigPathsPlugin: false, alias: {} }),
28
+ });
29
+
30
+ type ResolvedConfig = z.infer<typeof resolvedConfigSchema>;
31
+
32
+ const nativeModules = ["photoshop", "uxp", "fs", "os", "path", "process", "shell"];
33
+
34
+ export function createViteConfig(opts: ResolvedConfig, mode: "dev" | "build") {
35
+ resolvedConfigSchema.parse(opts);
36
+
37
+ const uxpConfig = createUxpConfig({
38
+ id: opts.plugin.id,
39
+ name: opts.plugin.name + " - UXP Test Framework Plugin",
40
+ version: "0.0.1",
41
+ });
42
+
43
+ return defineConfig({
44
+ root,
45
+ define: {
46
+ BOLT_UXP_HOT_RELOAD_PORT: uxpConfig.hotReloadPort,
47
+ BOLT_UXP_MANIFEST_ID: JSON.stringify(uxpConfig.manifest.id),
48
+ },
49
+ plugins: [
50
+ uxp(uxpConfig, mode, { disablePolyfills: true }) as any,
51
+ react(),
52
+ ...(opts.vite.enableTsconfigPathsPlugin ? [tsconfigPaths()] : []),
53
+ // copy the test fixtures to the dist directory
54
+ ...(opts.testFixturesDir
55
+ ? [
56
+ viteStaticCopy({
57
+ targets: [
58
+ {
59
+ src: opts.testFixturesDir,
60
+ dest: ".",
61
+ },
62
+ ],
63
+ }),
64
+ ]
65
+ : []),
66
+ ],
67
+ resolve: {
68
+ alias: {
69
+ ...opts.vite.alias,
70
+ TESTS: opts.testsFile,
71
+ },
72
+ },
73
+ build: {
74
+ sourcemap: true,
75
+ outDir: opts.outDir,
76
+ watch: mode === 'dev' ? {} : undefined,
77
+ minify: false,
78
+ emptyOutDir: true,
79
+ rollupOptions: {
80
+ external: nativeModules.map((module) => new RegExp(`^${module}\\b`)),
81
+ output: {
82
+ format: "cjs",
83
+ },
84
+ },
85
+ },
86
+ publicDir: "public",
87
+ optimizeDeps: {
88
+ exclude: nativeModules,
89
+ }
90
+ });
91
+ }