Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb60971f27 | |||
| db24bcdee7 | |||
| 6cefe77703 | |||
| 9df14f80c5 |
11
changelog.md
11
changelog.md
@@ -1,5 +1,16 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-15 - 1.2.0 - feat(readme)
|
||||||
|
document config-based compile targets via npmextra.json
|
||||||
|
|
||||||
|
- Rename CLI usage to passthrough mode and add config mode documentation
|
||||||
|
- Describe the npmextra.json schema for compileTargets with example target definitions
|
||||||
|
- Document the compileFromConfig() programmatic API and batch hide/restore behavior for package.json
|
||||||
|
|
||||||
|
## 2026-03-15 - 1.1.1 - fix(repository)
|
||||||
|
no changes to commit
|
||||||
|
|
||||||
|
|
||||||
## 2026-03-15 - 1.1.0 - feat(cli)
|
## 2026-03-15 - 1.1.0 - feat(cli)
|
||||||
add npmextra-based compile target configuration for deno builds
|
add npmextra-based compile target configuration for deno builds
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/tsdeno",
|
"name": "@git.zone/tsdeno",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A helper tool for deno compile that strips package.json to prevent devDependency bloat in compiled binaries.",
|
"description": "A helper tool for deno compile that strips package.json to prevent devDependency bloat in compiled binaries.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
56
readme.md
56
readme.md
@@ -45,7 +45,7 @@ With `package.json` hidden, Deno only resolves dependencies declared in `deno.js
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### CLI
|
### CLI — Passthrough Mode
|
||||||
|
|
||||||
Drop-in replacement — just swap `deno compile` for `tsdeno compile`:
|
Drop-in replacement — just swap `deno compile` for `tsdeno compile`:
|
||||||
|
|
||||||
@@ -71,6 +71,54 @@ tsdeno compile --allow-all --no-check \
|
|||||||
mod.ts
|
mod.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### CLI — Config Mode (npmextra.json)
|
||||||
|
|
||||||
|
For projects with multiple compile targets, you can define them in `npmextra.json` instead of writing long CLI commands. Just run `tsdeno compile` with no arguments:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tsdeno compile
|
||||||
|
```
|
||||||
|
|
||||||
|
tsdeno reads compile targets from the `@git.zone/tsdeno` key in your `npmextra.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"@git.zone/tsdeno": {
|
||||||
|
"compileTargets": [
|
||||||
|
{
|
||||||
|
"name": "myapp-linux-x64",
|
||||||
|
"entryPoint": "mod.ts",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"target": "x86_64-unknown-linux-gnu",
|
||||||
|
"permissions": ["--allow-all"],
|
||||||
|
"noCheck": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "myapp-macos-arm64",
|
||||||
|
"entryPoint": "mod.ts",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"target": "aarch64-apple-darwin",
|
||||||
|
"permissions": ["--allow-all"],
|
||||||
|
"noCheck": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Each compile target supports these fields:
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------- | ---------- | -------- | ----------------------------------------------------- |
|
||||||
|
| `name` | `string` | ✅ | Output binary name (combined with `outDir` for path) |
|
||||||
|
| `entryPoint` | `string` | ✅ | Path to the entry TypeScript file |
|
||||||
|
| `outDir` | `string` | ✅ | Directory for the compiled output |
|
||||||
|
| `target` | `string` | ✅ | Deno compile target triple (e.g. `x86_64-unknown-linux-gnu`) |
|
||||||
|
| `permissions` | `string[]` | ❌ | Deno permission flags (e.g. `["--allow-all"]`) |
|
||||||
|
| `noCheck` | `boolean` | ❌ | Skip type checking (`--no-check`) |
|
||||||
|
|
||||||
|
In config mode, `package.json` is hidden **once** for the entire batch — all targets compile in sequence with a single hide/restore cycle.
|
||||||
|
|
||||||
### Programmatic API
|
### Programmatic API
|
||||||
|
|
||||||
You can also use `tsdeno` as a library in your build scripts:
|
You can also use `tsdeno` as a library in your build scripts:
|
||||||
@@ -81,6 +129,7 @@ import { TsDeno } from '@git.zone/tsdeno';
|
|||||||
const tsDeno = new TsDeno(); // uses process.cwd()
|
const tsDeno = new TsDeno(); // uses process.cwd()
|
||||||
// or: new TsDeno('/path/to/project')
|
// or: new TsDeno('/path/to/project')
|
||||||
|
|
||||||
|
// Passthrough mode — pass args directly
|
||||||
await tsDeno.compile([
|
await tsDeno.compile([
|
||||||
'--allow-all',
|
'--allow-all',
|
||||||
'--no-check',
|
'--no-check',
|
||||||
@@ -88,6 +137,9 @@ await tsDeno.compile([
|
|||||||
'--target', 'x86_64-unknown-linux-gnu',
|
'--target', 'x86_64-unknown-linux-gnu',
|
||||||
'mod.ts',
|
'mod.ts',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Config mode — reads compile targets from npmextra.json
|
||||||
|
await tsDeno.compileFromConfig();
|
||||||
```
|
```
|
||||||
|
|
||||||
The `TsDeno` class handles the full package.json isolation lifecycle automatically.
|
The `TsDeno` class handles the full package.json isolation lifecycle automatically.
|
||||||
@@ -151,7 +203,7 @@ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark G
|
|||||||
|
|
||||||
### Company Information
|
### Company Information
|
||||||
|
|
||||||
Task Venture Capital GmbH
|
Task Venture Capital GmbH
|
||||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||||
|
|
||||||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsdeno',
|
name: '@git.zone/tsdeno',
|
||||||
version: '1.1.0',
|
version: '1.2.0',
|
||||||
description: 'A helper tool for deno compile that strips package.json to prevent devDependency bloat in compiled binaries.'
|
description: 'A helper tool for deno compile that strips package.json to prevent devDependency bloat in compiled binaries.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user