@sortlist/cli 0.36.0 → 0.37.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/bin/sl.mjs +20 -7
- package/dist/index.js +1579 -0
- package/dist/index.js.map +1 -0
- package/package.json +8 -7
- package/src/codegen.ts +0 -34
- package/src/commands/config.ts +0 -95
- package/src/commands/dynamic.test.ts +0 -87
- package/src/commands/dynamic.ts +0 -569
- package/src/commands/login.ts +0 -155
- package/src/commands/logout.ts +0 -45
- package/src/commands/token.ts +0 -23
- package/src/commands/whoami.ts +0 -55
- package/src/graphql/client.ts +0 -259
- package/src/graphql/generated/gql.ts +0 -70
- package/src/graphql/generated/graphql.ts +0 -4757
- package/src/graphql/generated/index.ts +0 -1
- package/src/graphql/introspection.ts +0 -240
- package/src/graphql/operations/common.ts +0 -16
- package/src/graphql/operations/hermes.ts +0 -54
- package/src/graphql/query-builder.test.ts +0 -114
- package/src/graphql/query-builder.ts +0 -239
- package/src/index.ts +0 -186
- package/src/lib/auth.test.ts +0 -30
- package/src/lib/auth.ts +0 -58
- package/src/lib/browser.ts +0 -11
- package/src/lib/company.ts +0 -15
- package/src/lib/config.ts +0 -80
- package/src/lib/env.ts +0 -10
- package/src/lib/output.ts +0 -58
- package/src/lib/sentry.ts +0 -70
- package/src/lib/version-check.ts +0 -88
package/bin/sl.mjs
CHANGED
|
@@ -52,22 +52,35 @@ if (process.env.SL_PREFER_LOCAL !== '0') {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// Published builds ship a bundled dist/; source checkouts run TypeScript via
|
|
56
|
+
// tsx — even when a locally-built dist/ exists, so stale bundles never shadow
|
|
57
|
+
// the live source.
|
|
58
|
+
const distEntry = resolve(selfRoot, 'dist/index.js');
|
|
59
|
+
const useDist = existsSync(resolve(selfRoot, '.published')) && existsSync(distEntry);
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
let command;
|
|
62
|
+
let args;
|
|
63
|
+
if (useDist) {
|
|
64
|
+
command = process.execPath;
|
|
65
|
+
args = [distEntry, ...process.argv.slice(2)];
|
|
66
|
+
} else {
|
|
67
|
+
const tsxPath = resolve(selfRoot, 'node_modules/.bin/tsx');
|
|
68
|
+
if (!existsSync(tsxPath)) {
|
|
69
|
+
console.error(`sl: missing dependency at ${tsxPath} — run \`npm install\` in ${selfRoot}`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
command = tsxPath;
|
|
73
|
+
args = [resolve(selfRoot, 'src/index.ts'), ...process.argv.slice(2)];
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
try {
|
|
64
|
-
execFileSync(
|
|
77
|
+
execFileSync(command, args, {
|
|
65
78
|
stdio: 'inherit',
|
|
66
79
|
env: { ...process.env, NODE_OPTIONS: [process.env.NODE_OPTIONS, '--enable-source-maps'].filter(Boolean).join(' ') },
|
|
67
80
|
});
|
|
68
81
|
} catch (err) {
|
|
69
82
|
if (err.code === 'ENOENT') {
|
|
70
|
-
console.error(`sl: failed to spawn
|
|
83
|
+
console.error(`sl: failed to spawn ${command} (${err.message})`);
|
|
71
84
|
}
|
|
72
85
|
process.exit(err.status ?? 1);
|
|
73
86
|
}
|