@backstage/cli-node 0.0.0-nightly-20241120023536 → 0.0.0-nightly-20241121023535
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 +2 -1
- package/dist/util.cjs.js +1 -0
- package/dist/util.cjs.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# @backstage/cli-node
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20241121023535
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- af665ea: add PackageManager and Lockfile interfaces for future use
|
|
7
8
|
- cbfc69e: Internal refactor
|
|
8
9
|
- Updated dependencies
|
|
9
10
|
- @backstage/cli-common@0.1.15
|
package/dist/util.cjs.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var child_process = require('child_process');
|
|
4
4
|
var util = require('util');
|
|
5
5
|
var cliCommon = require('@backstage/cli-common');
|
|
6
|
+
require('@backstage/errors');
|
|
6
7
|
|
|
7
8
|
const execFile = util.promisify(child_process.execFile);
|
|
8
9
|
const paths = cliCommon.findPaths(__dirname);
|
package/dist/util.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.cjs.js","sources":["../src/util.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"util.cjs.js","sources":["../src/util.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ChildProcess,\n execFile as execFileCb,\n spawn,\n SpawnOptions,\n} from 'child_process';\nimport { promisify } from 'util';\nimport { findPaths } from '@backstage/cli-common';\nimport { ExitCodeError } from './errors';\n\nexport const execFile = promisify(execFileCb);\n\n/* eslint-disable-next-line no-restricted-syntax */\nexport const paths = findPaths(__dirname);\n\n/**\n * A function that can be used to log data from a child process\n *\n * @public\n */\nexport type LogFunc = (data: Buffer) => void;\n\n/**\n * Options for running a child process\n *\n * @public\n */\nexport type SpawnOptionsPartialEnv = Omit<SpawnOptions, 'env'> & {\n env?: Partial<NodeJS.ProcessEnv>;\n // Pipe stdout to this log function\n stdoutLogFunc?: LogFunc;\n // Pipe stderr to this log function\n stderrLogFunc?: LogFunc;\n};\n\n// Runs a child command, returning a promise that is only resolved if the child exits with code 0.\nexport async function run(\n name: string,\n args: string[] = [],\n options: SpawnOptionsPartialEnv = {},\n) {\n const { stdoutLogFunc, stderrLogFunc } = options;\n const env: NodeJS.ProcessEnv = {\n ...process.env,\n FORCE_COLOR: 'true',\n ...(options.env ?? {}),\n };\n\n const stdio = [\n 'inherit',\n stdoutLogFunc ? 'pipe' : 'inherit',\n stderrLogFunc ? 'pipe' : 'inherit',\n ] as ('inherit' | 'pipe')[];\n\n const child = spawn(name, args, {\n stdio,\n shell: true,\n ...options,\n env,\n });\n\n if (stdoutLogFunc && child.stdout) {\n child.stdout.on('data', stdoutLogFunc);\n }\n if (stderrLogFunc && child.stderr) {\n child.stderr.on('data', stderrLogFunc);\n }\n\n await waitForExit(child, name);\n}\n\nasync function waitForExit(\n child: ChildProcess & { exitCode: number | null },\n name?: string,\n): Promise<void> {\n if (typeof child.exitCode === 'number') {\n if (child.exitCode) {\n throw new ExitCodeError(child.exitCode, name);\n }\n return;\n }\n\n await new Promise<void>((resolve, reject) => {\n child.once('error', error => reject(error));\n child.once('exit', code => {\n if (code) {\n reject(new ExitCodeError(code, name));\n } else {\n resolve();\n }\n });\n });\n}\n"],"names":["promisify","execFileCb","findPaths"],"mappings":";;;;;;;AA0Ba,MAAA,QAAA,GAAWA,eAAUC,sBAAU;AAG/B,MAAA,KAAA,GAAQC,oBAAU,SAAS;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-node",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20241121023535",
|
|
4
4
|
"description": "Node.js library for Backstage CLIs",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
"zod": "^3.22.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@backstage/backend-test-utils": "0.0.0-nightly-
|
|
45
|
-
"@backstage/cli": "0.0.0-nightly-
|
|
44
|
+
"@backstage/backend-test-utils": "0.0.0-nightly-20241121023535",
|
|
45
|
+
"@backstage/cli": "0.0.0-nightly-20241121023535",
|
|
46
|
+
"@backstage/test-utils": "1.7.1"
|
|
46
47
|
},
|
|
47
48
|
"typesVersions": {
|
|
48
49
|
"*": {
|