2 Commits
v1.1.1 ... main

Author SHA1 Message Date
cb60971f27 v1.2.0 2026-03-15 18:23:00 +00:00
db24bcdee7 feat(readme): document config-based compile targets via npmextra.json 2026-03-15 18:23:00 +00:00
4 changed files with 63 additions and 4 deletions

View File

@@ -1,5 +1,12 @@
# 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) ## 2026-03-15 - 1.1.1 - fix(repository)
no changes to commit no changes to commit

View File

@@ -1,6 +1,6 @@
{ {
"name": "@git.zone/tsdeno", "name": "@git.zone/tsdeno",
"version": "1.1.1", "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",

View File

@@ -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.

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tsdeno', name: '@git.zone/tsdeno',
version: '1.1.1', 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.'
} }