Initial empty commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/* eslint-disable */
|
||||
const esbuild = require('esbuild');
|
||||
const path = require('path');
|
||||
|
||||
async function build() {
|
||||
const entry = path.resolve(__dirname, '../src/webview/react/index.tsx');
|
||||
const outFile = path.resolve(__dirname, '../out/webview/react-webview.js');
|
||||
try {
|
||||
await esbuild.build({
|
||||
entryPoints: [entry],
|
||||
outfile: outFile,
|
||||
bundle: true,
|
||||
platform: 'browser',
|
||||
format: 'iife',
|
||||
sourcemap: true,
|
||||
minify: false,
|
||||
loader: { '.ts': 'ts', '.tsx': 'tsx' },
|
||||
});
|
||||
console.log('Built React webview to', outFile);
|
||||
} catch (err) {
|
||||
console.error('Failed to build React webview:', err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
build();
|
||||
@@ -0,0 +1,42 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function copyFile(src, dst) {
|
||||
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
||||
fs.copyFileSync(src, dst);
|
||||
}
|
||||
|
||||
function copyDir(src, dst) {
|
||||
if (!fs.existsSync(src)) return;
|
||||
fs.mkdirSync(dst, { recursive: true });
|
||||
const entries = fs.readdirSync(src, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
const srcPath = path.join(src, entry.name);
|
||||
const dstPath = path.join(dst, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
copyDir(srcPath, dstPath);
|
||||
} else {
|
||||
fs.copyFileSync(srcPath, dstPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const projectRoot = process.cwd();
|
||||
const srcParserPath = path.join(projectRoot, 'src', 'parser');
|
||||
const outParserPath = path.join(projectRoot, 'out', 'parser');
|
||||
|
||||
copyFile(
|
||||
path.join(srcParserPath, 'tkinter_ast_parser.py'),
|
||||
path.join(outParserPath, 'tkinter_ast_parser.py')
|
||||
);
|
||||
|
||||
copyDir(
|
||||
path.join(srcParserPath, 'tk_ast'),
|
||||
path.join(outParserPath, 'tk_ast')
|
||||
);
|
||||
|
||||
console.log('Copied Python files to out/parser.');
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user