@officecli/officecli 1.0.122-test.1 → 1.0.122

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.
@@ -19,17 +19,12 @@ const MIRROR_BASE = 'https://d.officecli.ai';
19
19
  const GITHUB_BASE = 'https://github.com/' + REPO;
20
20
 
21
21
  // The package version is set to the release version at publish time, so the
22
- // release tag we download from is derived directly from it (immutable, never
23
- // stale). A prerelease/build suffix (e.g. 1.0.122-test.1) maps to the same
24
- // binary release v1.0.122 — strip everything after the first '-' or '+'.
22
+ // tag we download from is derived directly from it (immutable, never stale).
25
23
  const VERSION = require('../package.json').version;
26
- const TAG = 'v' + VERSION.split('+')[0].split('-')[0];
24
+ const TAG = 'v' + VERSION;
27
25
 
28
26
  const PKG_ROOT = path.join(__dirname, '..');
29
- // Native binary lives under vendor/, NOT bin/: the repo's root .gitignore
30
- // ignores `bin/`, and keeping the download target out of bin/ avoids any
31
- // collision with the launcher shim.
32
- const BIN_DIR = path.join(PKG_ROOT, 'vendor');
27
+ const BIN_DIR = path.join(PKG_ROOT, 'bin');
33
28
 
34
29
  function log(msg) {
35
30
  // postinstall output goes to stderr so it never pollutes a command's stdout.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@officecli/officecli",
3
- "version": "1.0.122-test.1",
3
+ "version": "1.0.122",
4
4
  "description": "OfficeCli — CLI for reading and writing Office documents (.docx, .xlsx, .pptx) via a document DOM API. The native binary is fetched on install for your platform.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "goworm",
@@ -24,13 +24,13 @@
24
24
  "cli"
25
25
  ],
26
26
  "bin": {
27
- "officecli": "officecli.js"
27
+ "officecli": "bin/officecli.js"
28
28
  },
29
29
  "scripts": {
30
30
  "postinstall": "node install.js"
31
31
  },
32
32
  "files": [
33
- "officecli.js",
33
+ "bin/officecli.js",
34
34
  "lib/install-binary.js",
35
35
  "install.js",
36
36
  "README.md"
package/officecli.js DELETED
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- // Launcher shim. npm links this as the `officecli` command. It execs the native
5
- // binary fetched by postinstall, forwarding argv, stdio and the exit code. If
6
- // the binary is missing (postinstall was skipped or failed offline), it is
7
- // downloaded lazily on this first run.
8
- //
9
- // This lives at the package root, NOT under bin/, on purpose: the repo's root
10
- // .gitignore ignores `bin/`, which would silently drop a bin/ shim from the
11
- // published tarball.
12
-
13
- const fs = require('fs');
14
- const { spawnSync } = require('child_process');
15
- const installer = require('./lib/install-binary');
16
-
17
- async function main() {
18
- let bin = installer.binaryPath();
19
- if (!fs.existsSync(bin)) {
20
- try {
21
- bin = await installer.ensureBinary();
22
- } catch (err) {
23
- process.stderr.write('[officecli] ' + err.message + '\n');
24
- process.exit(1);
25
- }
26
- }
27
- const res = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
28
- if (res.error) {
29
- process.stderr.write('[officecli] failed to launch binary: ' + res.error.message + '\n');
30
- process.exit(1);
31
- }
32
- // Signal-terminated child: surface a non-zero exit rather than a null status.
33
- if (res.signal) {
34
- process.exit(1);
35
- }
36
- process.exit(res.status === null ? 1 : res.status);
37
- }
38
-
39
- main();