@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.
- package/.npmignore +4 -0
- package/.turbo/daemon/b38c7656669412eb-turbo.log.2026-01-28 +0 -0
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +11 -0
- package/create-vite-config.ts +91 -0
- package/dist/create-vite-config.js +13965 -0
- package/index.html +12 -0
- package/package.json +63 -0
- package/postcss.config.cjs +8 -0
- package/public-zip/readme.txt +1 -0
- package/src/assets/bolt-uxp-quickstart.gif +0 -0
- package/src/assets/bolt-uxp.png +0 -0
- package/src/assets/bolt-uxp.svg +55 -0
- package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_Black_V01.png +0 -0
- package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_Black_V01.svg +78 -0
- package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_White_V01.png +0 -0
- package/src/assets/built-with-bolt-uxp/Built_With_BOLT_UXP_Logo_White_V01.svg +81 -0
- package/src/assets/react.png +0 -0
- package/src/assets/react.svg +36 -0
- package/src/assets/sass.png +0 -0
- package/src/assets/sass.svg +45 -0
- package/src/assets/svelte.png +0 -0
- package/src/assets/svelte.svg +1 -0
- package/src/assets/typescript.png +0 -0
- package/src/assets/typescript.svg +6 -0
- package/src/assets/vite.png +0 -0
- package/src/assets/vite.svg +1 -0
- package/src/assets/vue.png +0 -0
- package/src/assets/vue.svg +2 -0
- package/src/bolt-uxp-ws-listener.js +26 -0
- package/src/components/ErrorView.tsx +69 -0
- package/src/index-react.tsx +14 -0
- package/src/index.css +11 -0
- package/src/lib/resolvePath.ts +19 -0
- package/src/main.tsx +238 -0
- package/src/tests.d.ts +5 -0
- package/tailwind.config.js +15 -0
- package/tsup.config.ts +11 -0
- package/uxp.config.ts +109 -0
package/.npmignore
ADDED
|
File without changes
|
|
@@ -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
|
+
[34mCLI[39m Building entry: create-vite-config.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.1
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/otto/Code/projects/bubbly/uxp-toolkit/packages/uxp-test-framework-plugin/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: node20
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/create-vite-config.js [22m[32m511.65 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 40ms
|
package/CHANGELOG.md
ADDED
|
@@ -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
|
+
}
|