monosmith 0.0.0-stage → 1.1.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.
Files changed (3) hide show
  1. package/README.md +11 -2
  2. package/bin/smith.js +45 -0
  3. package/package.json +26 -4
package/README.md CHANGED
@@ -1,3 +1,12 @@
1
- # Temporary Holding Version
1
+ # monosmith
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
+ Runs a monorepo in Node, Go and Python: tasks from a cache, CI and releases
4
+
5
+ ```sh
6
+ npm install --global monosmith
7
+ smith --version
8
+ ```
9
+
10
+ The package holds no code of its own: npm installs the prebuilt smith binary for your platform from one of its optional dependencies (@monosmith/cli-<os>-<cpu>), so nothing is downloaded after install and it works behind a proxy or offline from a cache.
11
+
12
+ More: https://github.com/monosmith-app/monosmith
package/bin/smith.js ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ 'use strict'
3
+ // Runs the smith binary npm installed for this platform, from one of the
4
+ // optional dependencies; nothing is downloaded after install.
5
+ const { spawnSync } = require('node:child_process')
6
+ const fs = require('node:fs')
7
+
8
+ const platforms = {
9
+ "darwin-arm64": "@monosmith/cli-darwin-arm64",
10
+ "darwin-x64": "@monosmith/cli-darwin-x64",
11
+ "linux-arm64": "@monosmith/cli-linux-arm64",
12
+ "linux-x64": "@monosmith/cli-linux-x64",
13
+ "win32-arm64": "@monosmith/cli-win32-arm64",
14
+ "win32-x64": "@monosmith/cli-win32-x64"
15
+ }
16
+ const key = process.platform + '-' + process.arch
17
+ const pkg = platforms[key]
18
+ if (!pkg) {
19
+ console.error('smith has no build for ' + key)
20
+ process.exit(1)
21
+ }
22
+ const file = process.platform === 'win32' ? 'smith.exe' : 'smith'
23
+ let binary
24
+ try {
25
+ binary = require.resolve(pkg + '/bin/' + file)
26
+ } catch {
27
+ console.error('smith: ' + pkg + ' is not installed; reinstall without --omit=optional or --no-optional')
28
+ process.exit(1)
29
+ }
30
+ if (process.platform !== 'win32') {
31
+ try {
32
+ fs.accessSync(binary, fs.constants.X_OK)
33
+ } catch {
34
+ try { fs.chmodSync(binary, 0o755) } catch { /* a read-only install keeps its mode */ }
35
+ }
36
+ }
37
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' })
38
+ if (result.error) {
39
+ console.error('smith: ' + result.error.message)
40
+ process.exit(1)
41
+ }
42
+ if (result.signal) {
43
+ process.kill(process.pid, result.signal)
44
+ }
45
+ process.exit(result.status ?? 1)
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "monosmith",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "Runs a monorepo in Node, Go and Python: tasks from a cache, CI and releases",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/monosmith-app/monosmith",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/monosmith-app/monosmith.git"
10
+ },
11
+ "bin": {
12
+ "smith": "bin/smith.js"
13
+ },
14
+ "files": [
15
+ "bin"
16
+ ],
17
+ "engines": {
18
+ "node": "\u003e=18"
19
+ },
20
+ "optionalDependencies": {
21
+ "@monosmith/cli-darwin-arm64": "1.1.0",
22
+ "@monosmith/cli-darwin-x64": "1.1.0",
23
+ "@monosmith/cli-linux-arm64": "1.1.0",
24
+ "@monosmith/cli-linux-x64": "1.1.0",
25
+ "@monosmith/cli-win32-arm64": "1.1.0",
26
+ "@monosmith/cli-win32-x64": "1.1.0"
27
+ }
28
+ }