heyiam 0.2.18 → 0.2.19
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/dist/export.js +5 -1
- package/dist/mount.js +23199 -0
- package/dist/routes/preview.js +5 -1
- package/package.json +2 -2
package/dist/routes/preview.js
CHANGED
|
@@ -180,7 +180,11 @@ export function createPreviewRouter(ctx) {
|
|
|
180
180
|
});
|
|
181
181
|
// Serve @heyiam/ui mount script for preview pages
|
|
182
182
|
router.get('/heyiam-mount.js', (_req, res) => {
|
|
183
|
-
|
|
183
|
+
// In built dist: dist/mount.js (copied during build)
|
|
184
|
+
// In dev: ../../../packages/ui/dist/mount.js (monorepo layout)
|
|
185
|
+
const builtPath = path.resolve(__dirname, '..', 'mount.js');
|
|
186
|
+
const devPath = path.resolve(__dirname, '..', '..', '..', 'packages', 'ui', 'dist', 'mount.js');
|
|
187
|
+
const mountPath = existsSync(builtPath) ? builtPath : devPath;
|
|
184
188
|
try {
|
|
185
189
|
const js = readFileSync(mountPath, 'utf-8');
|
|
186
190
|
res.type('application/javascript').send(js);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heyiam",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "Turn AI coding sessions into portfolio case studies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"clean": "rm -rf dist",
|
|
26
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/index.js && cp -r src/render/templates dist/render/templates && cd app && npx vite build && rm -rf ../dist/public && cp -r dist ../dist/public",
|
|
26
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/index.js && cp -r src/render/templates dist/render/templates && (test -f ../packages/ui/dist/mount.js && cp ../packages/ui/dist/mount.js dist/mount.js || echo 'Warning: packages/ui/dist/mount.js not found — skipping') && cd app && npx vite build && rm -rf ../dist/public && cp -r dist ../dist/public",
|
|
27
27
|
"verify-build": "node -e \"const fs=require('fs'); const assert=require('assert'); const pkg=require('./package.json'); assert(fs.existsSync('dist/index.js'),'missing dist/index.js'); assert(fs.existsSync('dist/public/index.html'),'missing dist/public/index.html'); assert(fs.existsSync('dist/render/templates'),'missing templates'); const js=fs.readdirSync('dist/public/assets').filter(f=>f.endsWith('.js')); assert(js.length===1,'expected exactly 1 JS bundle, found '+js.length); const html=fs.readFileSync('dist/public/index.html','utf8'); assert(html.includes(js[0]),'index.html does not reference the JS bundle'); const tests=fs.readdirSync('dist',{recursive:true}).filter(f=>String(f).includes('.test.')); assert(tests.length===0,'test files found in dist: '+tests.join(', ')); console.log('Build verified: v'+pkg.version+' — dist/index.js + frontend + templates, 0 test files')\"",
|
|
28
28
|
"prepublishOnly": "npm run test:backend && npm run build && npm run verify-build",
|
|
29
29
|
"prepack": "npm run verify-build",
|