Skip to content

Commit

Permalink
feat: add compile command
Browse files Browse the repository at this point in the history
  • Loading branch information
adbayb committed Nov 10, 2024
1 parent 71fed0b commit 5441a21
Show file tree
Hide file tree
Showing 18 changed files with 393 additions and 185 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-kings-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"quickbundle": minor
---

Add `compile` command to build standalone executables.
21 changes: 21 additions & 0 deletions examples/multiple-standalones/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@examples/multiple-standalones",
"private": true,
"type": "module",
"source": "./src/index.ts",
"bin": {
"standaloneA": "./dist/standaloneA.cjs",
"standaloneB": "./dist/standaloneB.js"
},
"scripts": {
"build": "quickbundle compile",
"watch": "pnpm build"
},
"dependencies": {
"ora": "^8.1.1"
},
"devDependencies": {
"quickbundle": "workspace:*",
"@types/node": "22.9.0"
}
}
14 changes: 14 additions & 0 deletions examples/multiple-standalones/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ora from "ora";

console.info("A standalone program");

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

const sleep = async (duration = 3000) => {
return new Promise((resolve) => setTimeout(resolve, duration));
};

void sleep().then(() => {
spinner.stop();
console.info("End processing");
});
5 changes: 5 additions & 0 deletions examples/multiple-standalones/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
18 changes: 18 additions & 0 deletions examples/single-standalone/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@examples/single-standalone",
"private": true,
"type": "module",
"source": "./src/index.ts",
"bin": "./dist/index.cjs",
"scripts": {
"build": "quickbundle compile",
"watch": "pnpm build"
},
"dependencies": {
"ora": "^8.1.1"
},
"devDependencies": {
"quickbundle": "workspace:*",
"@types/node": "22.9.0"
}
}
14 changes: 14 additions & 0 deletions examples/single-standalone/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ora from "ora";

console.info("A standalone program");

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

const sleep = async (duration = 3000) => {
return new Promise((resolve) => setTimeout(resolve, duration));
};

void sleep().then(() => {
spinner.stop();
console.info("End processing");
});
5 changes: 5 additions & 0 deletions examples/single-standalone/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
},
"prettier": "@adbayb/stack/prettier",
"devDependencies": {
"@adbayb/stack": "2.2.0"
"@adbayb/stack": "2.3.1"
}
}
Loading

0 comments on commit 5441a21

Please sign in to comment.