@maka/meteor-sdk 0.2.4 → 0.2.5
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/isopackets/combined/npm/node_modules/meteor/babel-compiler/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/boilerplate-generator/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/constraint-solver/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/ddp-client/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/ecmascript/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/ecmascript-runtime/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/ecmascript-runtime-client/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/ecmascript-runtime-server/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/fetch/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/inter-process-messaging/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/logging/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/logic-solver/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/meteor/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/modules/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/modules-runtime/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/npm-mongo/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/package-version-parser/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/promise/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/react-fast-refresh/node_modules/.package-lock.json +1 -1
- package/isopackets/combined/npm/node_modules/meteor/socket-stream-client/node_modules/.package-lock.json +1 -1
- package/package.json +1 -1
- package/tools/isobuild/meteor-npm.js +65 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/meteor-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Programmatic Node API over the Meteor build tool (bundle/run/create/etc.) -- for driving Meteor's build system from plain Node code instead of shelling out to a meteor CLI (there isn't one anymore; see README.md). \"dependencies\" is generated by scripts/write-tool-package-json.js from scripts/dev-bundle-tool-package.js at the monorepo root -- do not hand-edit that field, edit that file and re-run the script instead.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -957,6 +957,36 @@ const npmUserConfigFile = files.pathJoin(
|
|
|
957
957
|
"meteor-npm-userconfig"
|
|
958
958
|
);
|
|
959
959
|
|
|
960
|
+
// The npm major version of the system npm these installs spawn --
|
|
961
|
+
// resolved once per process. Needed because npm 12 changed script
|
|
962
|
+
// execution policy: install-time lifecycle scripts are SKIPPED unless
|
|
963
|
+
// covered by allow-scripts, which silently breaks native-binding deps
|
|
964
|
+
// (@meteorjs/swc-core's postinstall never runs -> no binding -> builds
|
|
965
|
+
// fail much later). --dangerously-allow-all-scripts restores the
|
|
966
|
+
// pre-npm-12 behavior for these tool-controlled installs (the deps come
|
|
967
|
+
// from meteor's own package manifests, same trust model npm<=11 always
|
|
968
|
+
// had) -- but the flag can't be passed unconditionally: npm 12 hard-errors
|
|
969
|
+
// on flags it doesn't recognize, and vice versa older npms warn/err on
|
|
970
|
+
// unknown ones, so it's gated on the detected major.
|
|
971
|
+
let npmMajorVersionPromise = null;
|
|
972
|
+
function getNpmMajorVersion(commandToRun, npmPath, isWindows, env) {
|
|
973
|
+
if (!npmMajorVersionPromise) {
|
|
974
|
+
npmMajorVersionPromise = new Promise(function (resolve) {
|
|
975
|
+
const versionArgs = isWindows
|
|
976
|
+
? ['/c', npmPath, '--version']
|
|
977
|
+
: ['--version'];
|
|
978
|
+
require('child_process').execFile(
|
|
979
|
+
commandToRun, versionArgs, { env },
|
|
980
|
+
function (err, stdout) {
|
|
981
|
+
const major = err ? NaN : parseInt(String(stdout).trim(), 10);
|
|
982
|
+
resolve(Number.isNaN(major) ? 0 : major);
|
|
983
|
+
}
|
|
984
|
+
);
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
return npmMajorVersionPromise;
|
|
988
|
+
}
|
|
989
|
+
|
|
960
990
|
var runNpmCommand = meteorNpm.runNpmCommand =
|
|
961
991
|
Profile("meteorNpm.runNpmCommand", async function (args, cwd) {
|
|
962
992
|
import { getEnv } from "../utils/dev-bundle-env.js";
|
|
@@ -978,6 +1008,33 @@ Profile("meteorNpm.runNpmCommand", async function (args, cwd) {
|
|
|
978
1008
|
// http://nodejs.org/api/child_process.html#child_process_shell_requirements.
|
|
979
1009
|
|
|
980
1010
|
let commandToRun = npmPath;
|
|
1011
|
+
|
|
1012
|
+
const env = await getEnv({devBundle: toolRootDir});
|
|
1013
|
+
// Make sure we don't honor any user-provided configuration files.
|
|
1014
|
+
env.npm_config_userconfig = npmUserConfigFile;
|
|
1015
|
+
|
|
1016
|
+
// npm 12 skips uncovered install scripts (see getNpmMajorVersion's
|
|
1017
|
+
// comment); restore full script execution for the script-running
|
|
1018
|
+
// subcommands only.
|
|
1019
|
+
const npmMajor = await getNpmMajorVersion(
|
|
1020
|
+
isWindows ? (process.env.ComSpec || "cmd.exe") : npmPath,
|
|
1021
|
+
npmPath, isWindows, env
|
|
1022
|
+
);
|
|
1023
|
+
const runsScripts = ['install', 'i', 'ci', 'rebuild', 'update'].includes(args[0]);
|
|
1024
|
+
if (npmMajor >= 12 && runsScripts) {
|
|
1025
|
+
// Also restore git/tarball-URL dependency fetching: npm 12 defaults
|
|
1026
|
+
// allow-git and allow-remote to "none", but core packages
|
|
1027
|
+
// legitimately pin such deps (e.g. ddp-server's uWebSockets.js,
|
|
1028
|
+
// which upstream only distributes via GitHub) -- EALLOWGIT broke
|
|
1029
|
+
// every fresh machine's first build of ddp-server.
|
|
1030
|
+
args = [
|
|
1031
|
+
...args,
|
|
1032
|
+
'--dangerously-allow-all-scripts',
|
|
1033
|
+
'--allow-git=all',
|
|
1034
|
+
'--allow-remote=all',
|
|
1035
|
+
];
|
|
1036
|
+
}
|
|
1037
|
+
|
|
981
1038
|
if (isWindows) {
|
|
982
1039
|
args = ['/c', npmPath, ...args];
|
|
983
1040
|
commandToRun = process.env.ComSpec || "cmd.exe";
|
|
@@ -989,20 +1046,22 @@ Profile("meteorNpm.runNpmCommand", async function (args, cwd) {
|
|
|
989
1046
|
args.join(' ') + ' ...\n');
|
|
990
1047
|
}
|
|
991
1048
|
|
|
992
|
-
const env = await getEnv({devBundle: toolRootDir});
|
|
993
|
-
|
|
994
1049
|
const opts = {
|
|
995
1050
|
env: env,
|
|
996
|
-
maxBuffer: 10 * 1024 * 1024
|
|
1051
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
1052
|
+
// stdin 'ignore', NOT the default open pipe: a child npm that decides
|
|
1053
|
+
// to prompt (npm 12's interactive allow-scripts confirmation, auth
|
|
1054
|
+
// prompts, ...) would otherwise block forever on a pipe nobody writes
|
|
1055
|
+
// to -- observed as a hard hang (^C-immune) during a fresh machine's
|
|
1056
|
+
// first `maka create` on an npm 12 box. With stdin closed, npm sees
|
|
1057
|
+
// a non-interactive session and warns/skips instead of waiting.
|
|
1058
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
997
1059
|
};
|
|
998
1060
|
|
|
999
1061
|
if (cwd) {
|
|
1000
1062
|
opts.cwd = files.convertToOSPath(cwd);
|
|
1001
1063
|
}
|
|
1002
1064
|
|
|
1003
|
-
// Make sure we don't honor any user-provided configuration files.
|
|
1004
|
-
env.npm_config_userconfig = npmUserConfigFile;
|
|
1005
|
-
|
|
1006
1065
|
return new Promise(function (resolve) {
|
|
1007
1066
|
require('child_process').execFile(
|
|
1008
1067
|
commandToRun, args, opts, function (err, stdout, stderr) {
|