@ugo-studio/jspp 0.1.1 → 0.1.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/dist/cli.js +5 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,9 @@ async function main() {
|
|
|
16
16
|
try {
|
|
17
17
|
const jsCode = await fs.readFile(jsFilePath, "utf-8");
|
|
18
18
|
const interpreter = new Interpreter();
|
|
19
|
+
console.time(`Generated C++ code ${cppFilePath}...`);
|
|
19
20
|
const { cppCode, preludePath } = interpreter.interpret(jsCode);
|
|
21
|
+
console.timeEnd(`Generated C++ code ${cppFilePath}...`);
|
|
20
22
|
await fs.mkdir(outputDir, { recursive: true });
|
|
21
23
|
await fs.writeFile(cppFilePath, cppCode);
|
|
22
24
|
console.log(`Compiling ${cppFilePath}...`);
|
|
@@ -38,7 +40,7 @@ async function main() {
|
|
|
38
40
|
stderr: "inherit",
|
|
39
41
|
});
|
|
40
42
|
if (compile.exitCode !== 0) {
|
|
41
|
-
console.error(`Compilation failed for ${
|
|
43
|
+
console.error(`Compilation failed for ${cppFilePath}`);
|
|
42
44
|
process.exit(1);
|
|
43
45
|
}
|
|
44
46
|
console.log(`Running ${exeFilePath}...`);
|
|
@@ -50,10 +52,10 @@ async function main() {
|
|
|
50
52
|
});
|
|
51
53
|
console.log("\x1b[32m\n------end--------\x1b[0m");
|
|
52
54
|
if (run.exitCode !== 0) {
|
|
53
|
-
console.error(`Execution failed for ${
|
|
55
|
+
console.error(`Execution failed for ${exeFilePath}`);
|
|
54
56
|
process.exit(1);
|
|
55
57
|
}
|
|
56
|
-
console.log(`Successfully ran ${
|
|
58
|
+
console.log(`Successfully ran ${exeFilePath}`);
|
|
57
59
|
}
|
|
58
60
|
catch (error) {
|
|
59
61
|
console.error(`Error: ${error.message}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ugo-studio/jspp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A modern, experimental transpiler that converts JavaScript code into high-performance, standard C++23.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "bun run precompile && bun test",
|
|
20
20
|
"build": "tsc",
|
|
21
21
|
"prepack": "bun run build",
|
|
22
|
-
"publish
|
|
22
|
+
"publish:npm": "npm publish --access=public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/bun": "latest"
|