Skip to content

Commit

Permalink
feat: add cross-compilation feature
Browse files Browse the repository at this point in the history
  • Loading branch information
adbayb committed Nov 12, 2024
1 parent e351a81 commit 3b75337
Show file tree
Hide file tree
Showing 12 changed files with 591 additions and 55 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-cows-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"quickbundle": minor
---

Add cross-compilation feature.
4 changes: 3 additions & 1 deletion examples/multiple-standalones/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"standaloneB": "./dist/standaloneB.js"
},
"scripts": {
"build": "quickbundle compile",
"build": "pnpm build:local",
"build:cross": "quickbundle compile --target node-v21.7.3-linux-arm64",
"build:local": "quickbundle compile",
"watch": "pnpm build"
},
"dependencies": {
Expand Down
16 changes: 14 additions & 2 deletions examples/multiple-standalones/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
#!/usr/bin/env node

import process from "node:process";

import ora from "ora";

console.info("A standalone program");
console.info("Hello world\n");

console.debug(
"Debug information",
JSON.stringify(
{
embeddedNodeVersion: process.version,
},
null,
2,
),
);

const spinner = ora("Fake processing").start();

Expand All @@ -12,5 +25,4 @@ const sleep = async (duration = 3000) => {

void sleep().then(() => {
spinner.stop();
console.info("End processing");
});
4 changes: 3 additions & 1 deletion examples/single-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"source": "./src/index.ts",
"bin": "./dist/index.cjs",
"scripts": {
"build": "quickbundle compile",
"build": "pnpm build:local",
"build:cross": "quickbundle compile --target node-v21.7.3-linux-arm64",
"build:local": "quickbundle compile",
"watch": "pnpm build"
},
"dependencies": {
Expand Down
16 changes: 14 additions & 2 deletions examples/single-standalone/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
#!/usr/bin/env node

import process from "node:process";

import ora from "ora";

console.info("A standalone program");
console.info("Hello world\n");

console.debug(
"Debug information",
JSON.stringify(
{
embeddedNodeVersion: process.version,
},
null,
2,
),
);

const spinner = ora("Fake processing").start();

Expand All @@ -12,5 +25,4 @@ const sleep = async (duration = 3000) => {

void sleep().then(() => {
spinner.stop();
console.info("End processing");
});
Loading

0 comments on commit 3b75337

Please sign in to comment.