@tantawowa/hsc 0.0.0-stage → 1.54.2

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/bin/hsc.cjs ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ /* global require, process, console */
3
+ /* eslint-disable @typescript-eslint/no-require-imports */
4
+ 'use strict';
5
+
6
+ const { spawnSync } = require('node:child_process');
7
+ const { version } = require('../package.json');
8
+ const supported = new Set(['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64']);
9
+ const platform = `${process.platform}-${process.arch}`;
10
+
11
+ if (!supported.has(platform)) {
12
+ console.error(`Hosanna compiler does not support this host: ${platform}. Supported hosts: ${[...supported].join(', ')}.`);
13
+ process.exit(1);
14
+ }
15
+
16
+ const packageName = `@tantawowa/hsc-${platform}`;
17
+ let binary;
18
+ try {
19
+ const installed = require(`${packageName}/package.json`);
20
+ if (installed.version !== version) {
21
+ throw new Error(`Expected ${version}, found ${installed.version}.`);
22
+ }
23
+ binary = require.resolve(`${packageName}/bin/hsc`);
24
+ } catch (error) {
25
+ console.error(`Cannot load ${packageName}@${version}: ${error.message}\nRun npm install --include=optional. Do not copy node_modules between different operating systems or CPUs.`);
26
+ process.exit(1);
27
+ }
28
+
29
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
30
+ if (result.error) {
31
+ console.error(`Cannot start the Hosanna compiler: ${result.error.message}`);
32
+ process.exit(1);
33
+ }
34
+ if (result.signal) {
35
+ process.kill(process.pid, result.signal);
36
+ } else {
37
+ process.exit(result.status ?? 1);
38
+ }
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "@tantawowa/hsc",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.54.2",
4
+ "description": "Hosanna TypeScript to BrightScript compiler for Roku",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/TantaWowa/hosanna-compiler.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public",
12
+ "registry": "https://registry.npmjs.org"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "LICENSE",
17
+ "README.md",
18
+ "THIRD_PARTY_NOTICES.txt"
19
+ ],
20
+ "bin": {
21
+ "hsc": "bin/hsc.cjs"
22
+ },
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "optionalDependencies": {
27
+ "@tantawowa/hsc-darwin-arm64": "1.54.2",
28
+ "@tantawowa/hsc-darwin-x64": "1.54.2",
29
+ "@tantawowa/hsc-linux-arm64": "1.54.2",
30
+ "@tantawowa/hsc-linux-x64": "1.54.2"
31
+ }
32
+ }