@gameap/debug 0.2.0 → 0.2.1
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/bin/cli.js +26 -0
- package/package.json +18 -6
- package/vite.config.ts +3 -12
- package/tailwind.config.js +0 -25
- package/tsconfig.node.json +0 -11
package/bin/cli.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { dirname, resolve } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const packageRoot = resolve(__dirname, '..');
|
|
9
|
+
|
|
10
|
+
// Run vite dev server from the package directory
|
|
11
|
+
const vite = spawn('npx', ['vite'], {
|
|
12
|
+
cwd: packageRoot,
|
|
13
|
+
stdio: 'inherit',
|
|
14
|
+
shell: true,
|
|
15
|
+
env: {
|
|
16
|
+
...process.env,
|
|
17
|
+
// Pass through PLUGIN_PATH, resolve relative paths from CWD
|
|
18
|
+
PLUGIN_PATH: process.env.PLUGIN_PATH
|
|
19
|
+
? resolve(process.cwd(), process.env.PLUGIN_PATH)
|
|
20
|
+
: undefined
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
vite.on('close', (code) => {
|
|
25
|
+
process.exit(code);
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gameap/debug",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Debug harness for GameAP plugin development with mock API",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gameap-debug": "./bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"src",
|
|
12
|
+
"index.html",
|
|
13
|
+
"vite.config.ts",
|
|
14
|
+
"tsconfig.json",
|
|
15
|
+
"postcss.config.cjs",
|
|
16
|
+
"empty-plugin"
|
|
17
|
+
],
|
|
6
18
|
"scripts": {
|
|
7
19
|
"dev": "vite",
|
|
8
20
|
"build": "vue-tsc && vite build",
|
|
@@ -12,15 +24,15 @@
|
|
|
12
24
|
},
|
|
13
25
|
"dependencies": {
|
|
14
26
|
"@gameap/plugin-sdk": "^0.2.0",
|
|
15
|
-
"@gameap/frontend": "
|
|
16
|
-
"msw": "^2.7.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
27
|
+
"@gameap/frontend": "4.1.0-dev1",
|
|
19
28
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
20
29
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
30
|
+
"msw": "^2.7.0",
|
|
21
31
|
"sass": "^1.32.0",
|
|
32
|
+
"vite": "^7.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
22
35
|
"typescript": "^5.3.0",
|
|
23
|
-
"vite": "^7.1.0",
|
|
24
36
|
"vue-tsc": "^2.2.10"
|
|
25
37
|
},
|
|
26
38
|
"peerDependencies": {
|
package/vite.config.ts
CHANGED
|
@@ -6,9 +6,6 @@ import { fileURLToPath } from 'url'
|
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
8
8
|
|
|
9
|
-
// Path to the main frontend (for local development fallback)
|
|
10
|
-
const frontendRoot = resolve(__dirname, '../..')
|
|
11
|
-
|
|
12
9
|
// Default plugin path - can be overridden via PLUGIN_PATH env variable
|
|
13
10
|
function resolvePluginPath(): string {
|
|
14
11
|
const pluginPath = process.env.PLUGIN_PATH
|
|
@@ -34,22 +31,15 @@ export default defineConfig({
|
|
|
34
31
|
],
|
|
35
32
|
root: __dirname,
|
|
36
33
|
base: '/',
|
|
37
|
-
publicDir: resolve(frontendRoot, 'public'),
|
|
38
34
|
resolve: {
|
|
39
35
|
alias: [
|
|
40
36
|
// Debug harness source (for mocks, etc.)
|
|
41
37
|
{ find: '@debug', replacement: resolve(__dirname, 'src') },
|
|
42
|
-
// Frontend app - resolve from npm package @gameap/frontend
|
|
43
|
-
// Vite will resolve this from node_modules automatically
|
|
44
|
-
// Standard @ alias for frontend components (fallback to local for development)
|
|
45
|
-
{ find: '@', replacement: resolve(frontendRoot, 'js') },
|
|
46
|
-
// GameAP UI package - resolve from node_modules
|
|
47
38
|
// Plugin source (built bundle from external plugin)
|
|
48
39
|
{ find: '@plugin', replacement: resolvePluginPath() },
|
|
49
40
|
],
|
|
50
41
|
},
|
|
51
42
|
css: {
|
|
52
|
-
// Use debug harness's postcss config with correct Tailwind content paths
|
|
53
43
|
postcss: resolve(__dirname, 'postcss.config.cjs'),
|
|
54
44
|
preprocessorOptions: {
|
|
55
45
|
scss: {
|
|
@@ -64,9 +54,10 @@ export default defineConfig({
|
|
|
64
54
|
// Allow serving files from these directories
|
|
65
55
|
allow: [
|
|
66
56
|
__dirname,
|
|
67
|
-
frontendRoot,
|
|
68
57
|
resolvePluginPath(),
|
|
69
|
-
|
|
58
|
+
// Allow node_modules for npm packages
|
|
59
|
+
resolve(__dirname, 'node_modules'),
|
|
60
|
+
resolve(process.cwd(), 'node_modules'),
|
|
70
61
|
],
|
|
71
62
|
},
|
|
72
63
|
},
|
package/tailwind.config.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'path'
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
import { dirname } from 'path'
|
|
4
|
-
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
6
|
-
const frontendRoot = resolve(__dirname, '../..')
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
content: [
|
|
10
|
-
// Main frontend files
|
|
11
|
-
resolve(frontendRoot, 'index.html'),
|
|
12
|
-
resolve(frontendRoot, 'js/**/*.{js,ts,jsx,tsx,vue}'),
|
|
13
|
-
resolve(frontendRoot, 'packages/**/*.{js,vue,css}'),
|
|
14
|
-
// Debug harness files
|
|
15
|
-
resolve(__dirname, 'index.html'),
|
|
16
|
-
resolve(__dirname, 'src/**/*.{js,ts,vue}'),
|
|
17
|
-
],
|
|
18
|
-
theme: {
|
|
19
|
-
extend: {},
|
|
20
|
-
},
|
|
21
|
-
plugins: [
|
|
22
|
-
require('@tailwindcss/aspect-ratio'),
|
|
23
|
-
],
|
|
24
|
-
darkMode: 'selector',
|
|
25
|
-
}
|
package/tsconfig.node.json
DELETED