@aseity/idocs 0.0.0-stage → 0.6.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # @aseity/idocs
2
+
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `idocs pages` to inspect compact pagination summaries without writing a full layout file. Summaries include page labels, source locations, table row ranges and page-break reasons. Use `--pages` to select a page range and `--details` to include font records and diagnostic details. Existing document commands and source files remain compatible.
8
+
9
+ ## 0.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Add local Linux x64 glibc distribution packages. The npm launcher uses an installed native platform package without installation scripts or downloads. A standalone archive uses the same binary and includes checksums and redistribution notices. System fonts are discovered through fontconfig; additional directories can be configured once per user.
14
+
15
+ ## 0.4.1
16
+
17
+ This version is the starting point for local distribution preparation. Public npm and native archive publication remains pending. Future release notes are generated from changesets.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iDocs contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # iDocs CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Create, check and render iDocs source documents and export editable DOCX files.
4
+
5
+ The CLI is available from the public npm registry.
6
+
7
+ The first native target is Linux x64 with glibc 2.36 or newer. The npm launcher requires Node 24 or newer. npm 11 is the tested package manager. musl, other CPU architectures and other operating systems are unsupported.
8
+
9
+ For a published version, install `@aseity/idocs@<version>` with npm, retaining optional dependencies. The launcher requires the exact same version of `@aseity/idocs-linux-x64-gnu`. `--omit=optional` skips the binary. Reinstall with `--include=optional` if it is absent. Installation uses the package manager only, with no lifecycle scripts, binary downloader, font downloader or Rust build.
10
+
11
+ The native archive runs without Node or Rust. It needs the system loader, glibc and libgcc runtime. Install fontconfig and suitable system fonts for document rendering. Debian 12 and Ubuntu systems can install fontconfig and Latin fonts with `apt-get install fontconfig fonts-liberation2`. Chinese rendering requires static single-face OTF or TTF fonts. Distribution packages containing only TTC font collections do not satisfy that requirement. Install static Noto CJK or MiSans fonts into a fontconfig-visible font directory, or configure a font directory once as described below. The package contains no external font directory. Embedded KaTeX math fonts and their licenses remain in the native binary distribution.
12
+
13
+ ```sh
14
+ idocs --version
15
+ idocs check report.idoc --layout report.layout.json
16
+ idocs pages report.idoc
17
+ idocs export report.idoc --out report.docx
18
+ idocs snapshot report.idoc --out preview
19
+ ```
20
+
21
+ Standard output is JSON for document commands. Exit codes are 0 for success, 1 for document failure and 2 for usage or environment failure. Inspect warnings and conversion losses even after success. Native snapshots use the current font environment; Word may paginate differently with other fonts.
22
+
23
+ Use `idocs pages report.idoc --pages 2-4` to inspect a page range without writing a layout file. The summary reports page labels, source locations, table row ranges and page-break reasons. Add `--details` for font records and diagnostic details.
24
+
25
+ Linux system and user fonts are discovered through `fc-list`. Additional font directories can be saved in `$XDG_CONFIG_HOME/idocs/config.json`, or `$HOME/.config/idocs/config.json` when XDG_CONFIG_HOME is unset. Use `{"fontDirs":["/absolute/font/directory"]}`. Relative directories resolve beside the config file. New processes load the saved directories automatically. Remove entries or the config file to clear them. Repeated `--font-dir` arguments add directories for one run without modifying configuration.
26
+
27
+ Font priority is document registration, command-line directories, saved directories, system fonts, then the existing fallback resource directory. `IDOCS_FONTS` names that fallback directory, not a system font list. Missing or unreadable fonts and missing glyphs produce diagnostics. `--strict` makes relevant warnings fail. The CLI does not embed user fonts into exported DOCX.
28
+
29
+ The platform package and native archive include third-party notices. Keep those notices when redistributing the executable.
package/bin/idocs.mjs ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs'
3
+ import { createRequire } from 'node:module'
4
+ import { dirname, join } from 'node:path'
5
+
6
+ const read = (url) => JSON.parse(readFileSync(url, 'utf8'))
7
+ const manifest = read(new URL('../package.json', import.meta.url))
8
+ const platform = read(new URL('../platform.json', import.meta.url))
9
+ try {
10
+ if (process.platform !== platform.os || process.arch !== platform.cpu) {
11
+ throw new Error(`This release supports Linux x64 glibc only; found ${process.platform} ${process.arch}.`)
12
+ }
13
+ const glibc = process.report.getReport().header.glibcVersionRuntime
14
+ const parts = (value) => value.split('.').map(Number)
15
+ const [major, minor] = parts(glibc || '0.0')
16
+ const [minimumMajor, minimumMinor] = parts(platform.minimumGlibc)
17
+ if (major < minimumMajor || (major === minimumMajor && minor < minimumMinor)) {
18
+ throw new Error(`iDocs needs glibc >=${platform.minimumGlibc}; found ${glibc || 'non-glibc Linux'}.`)
19
+ }
20
+ let installed
21
+ try {
22
+ installed = createRequire(import.meta.url).resolve(`${platform.package}/package.json`)
23
+ } catch {
24
+ throw new Error(`Missing ${platform.package}@${manifest.version}. Reinstall with npm install --include=optional ${manifest.name}@${manifest.version}; --omit=optional skips the binary. You can also use the native archive.`)
25
+ }
26
+ const native = read(installed)
27
+ if (native.version !== manifest.version) {
28
+ throw new Error(`Expected ${platform.package}@${manifest.version}, found ${native.version}. Reinstall matching CLI and platform versions.`)
29
+ }
30
+ if (typeof process.execve !== 'function') throw new Error('iDocs requires Node 24 or newer, or use the native archive.')
31
+ const binary = join(dirname(installed), 'bin/idocs')
32
+ process.execve(binary, [binary, ...process.argv.slice(2)], process.env)
33
+ } catch (error) {
34
+ console.error(`idocs: ${error.message}`)
35
+ process.exitCode = 2
36
+ }
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "@aseity/idocs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.6.0",
4
+ "description": "iDocs native command-line tools for editable DOCX documents",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "idocs": "bin/idocs.mjs"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "platform.json",
13
+ "README.md",
14
+ "CHANGELOG.md",
15
+ "LICENSE"
16
+ ],
17
+ "engines": {
18
+ "node": ">=24"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "registry": "https://registry.npmjs.org/"
23
+ },
24
+ "optionalDependencies": {
25
+ "@aseity/idocs-linux-x64-gnu": "0.6.0"
26
+ }
27
+ }
package/platform.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "package": "@aseity/idocs-linux-x64-gnu",
3
+ "target": "x86_64-unknown-linux-gnu",
4
+ "suffix": "linux-x64-gnu",
5
+ "os": "linux",
6
+ "cpu": "x64",
7
+ "libc": "glibc",
8
+ "minimumGlibc": "2.36"
9
+ }