@moonrepo/cli 1.41.7 → 2.0.0-beta.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/README.md CHANGED
@@ -91,7 +91,7 @@ and provide a first-class developer experience.
91
91
  - **Action pipeline** - Executes actions in parallel and in order using a thread pool and our
92
92
  dependency graph.
93
93
  - **Action distribution** - Distributes actions across multiple machines to increase throughput.
94
- - **Incremental builds** - With our smart hashing, only rebuild projects that have been touched
94
+ - **Incremental builds** - With our smart hashing, only rebuild projects that have been changed
95
95
  since the last build.
96
96
 
97
97
  #### Notification
package/moonx.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const cp = require('child_process');
4
- const { findMoonExe } = require('./utils');
4
+ const { findMoonxExe } = require('./utils');
5
5
 
6
- const result = cp.spawnSync(findMoonExe(), ['run', ...process.argv.slice(2)], {
6
+ const result = cp.spawnSync(findMoonxExe(), process.argv.slice(2), {
7
7
  shell: false,
8
8
  stdio: 'inherit',
9
9
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonrepo/cli",
3
- "version": "1.41.7",
3
+ "version": "2.0.0-beta.0",
4
4
  "type": "commonjs",
5
5
  "description": "moon command line and core system.",
6
6
  "keywords": [
@@ -12,32 +12,29 @@
12
12
  "files": [
13
13
  "moon.js",
14
14
  "moonx.js",
15
- "utils.js",
16
- "postinstall-old.js"
15
+ "utils.js"
17
16
  ],
18
17
  "author": "Miles Johnson",
19
18
  "license": "MIT",
20
19
  "bin": {
21
- "moon": "moon.js"
20
+ "moon": "moon.js",
21
+ "moonx": "moonx.js"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
25
  "url": "https://github.com/moonrepo/moon",
26
26
  "directory": "packages/cli"
27
27
  },
28
- "scripts": {
29
- "__postinstall__": "node ./postinstall-old.js"
30
- },
31
28
  "dependencies": {
32
- "detect-libc": "^2.0.4"
29
+ "detect-libc": "^2.1.2"
33
30
  },
34
31
  "optionalDependencies": {
35
- "@moonrepo/core-linux-arm64-gnu": "1.41.7",
36
- "@moonrepo/core-linux-arm64-musl": "1.41.7",
37
- "@moonrepo/core-linux-x64-gnu": "1.41.7",
38
- "@moonrepo/core-linux-x64-musl": "1.41.7",
39
- "@moonrepo/core-macos-arm64": "1.41.7",
40
- "@moonrepo/core-macos-x64": "1.41.7",
41
- "@moonrepo/core-windows-x64-msvc": "1.41.7"
42
- }
43
- }
32
+ "@moonrepo/core-linux-arm64-gnu": "2.0.0-beta.0",
33
+ "@moonrepo/core-linux-arm64-musl": "2.0.0-beta.0",
34
+ "@moonrepo/core-linux-x64-gnu": "2.0.0-beta.0",
35
+ "@moonrepo/core-linux-x64-musl": "2.0.0-beta.0",
36
+ "@moonrepo/core-macos-arm64": "2.0.0-beta.0",
37
+ "@moonrepo/core-windows-x64-msvc": "2.0.0-beta.0"
38
+ },
39
+ "stableVersion": "1.41.8"
40
+ }
package/utils.js CHANGED
@@ -28,9 +28,9 @@ if (isLinux) {
28
28
 
29
29
  const triple = parts.join('-');
30
30
 
31
- function findMoonExe() {
31
+ function findExe(name) {
32
32
  const pkgPath = require.resolve(`@moonrepo/core-${triple}/package.json`);
33
- const exePath = path.join(path.dirname(pkgPath), isWindows ? 'moon.exe' : 'moon');
33
+ const exePath = path.join(path.dirname(pkgPath), isWindows ? `${name}.exe` : name);
34
34
 
35
35
  if (fs.existsSync(exePath)) {
36
36
  return exePath;
@@ -39,4 +39,13 @@ function findMoonExe() {
39
39
  throw new Error(`moon executable "${exePath}" not found!`);
40
40
  }
41
41
 
42
+ function findMoonExe() {
43
+ return findExe('moon');
44
+ }
45
+
46
+ function findMoonxExe() {
47
+ return findExe('moonx');
48
+ }
49
+
42
50
  exports.findMoonExe = findMoonExe;
51
+ exports.findMoonxExe = findMoonxExe;
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Based on the great parcel-css
4
- // https://github.com/parcel-bundler/parcel-css/blob/master/cli/postinstall.js
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
-
9
- const isMoonLocal =
10
- fs.existsSync(path.join(__dirname, '../../.moon')) &&
11
- fs.existsSync(path.join(__dirname, '../../crates'));
12
-
13
- const isLinux = process.platform === 'linux';
14
- const isMacos = process.platform === 'darwin';
15
- const isWindows = process.platform === 'win32';
16
-
17
- const platform = isWindows ? 'windows' : isMacos ? 'macos' : process.platform;
18
- const arch =
19
- process.env['npm_config_user_agent'] && process.env['npm_config_user_agent'].match(/^bun.*arm64$/)
20
- ? 'arm64'
21
- : process.arch; // https://github.com/moonrepo/moon/issues/1103
22
- const parts = [platform, arch];
23
-
24
- if (isLinux) {
25
- const { familySync } = require('detect-libc');
26
-
27
- if (familySync() === 'musl') {
28
- parts.push('musl');
29
- } else if (process.arch === 'arm') {
30
- parts.push('gnueabihf');
31
- } else {
32
- parts.push('gnu');
33
- }
34
- } else if (isWindows) {
35
- parts.push('msvc');
36
- }
37
-
38
- const binary = isWindows ? 'moon.exe' : 'moon';
39
- const triple = parts.join('-');
40
-
41
- const pkgPath = path.dirname(require.resolve(`@moonrepo/core-${triple}/package.json`));
42
- const binPath = path.join(pkgPath, binary);
43
-
44
- try {
45
- const linkPath = path.join(__dirname, binary);
46
-
47
- if (fs.existsSync(binPath)) {
48
- try {
49
- fs.linkSync(binPath, linkPath);
50
- } catch {
51
- fs.copyFileSync(binPath, linkPath);
52
- }
53
-
54
- fs.chmodSync(linkPath, 0o755);
55
- } else {
56
- throw new Error();
57
- }
58
- } catch {
59
- console.error(`Failed to find "${binary}" binary.`);
60
-
61
- if (!isMoonLocal) {
62
- // process.exit(1);
63
- }
64
- }