socket 0.14.32 → 0.14.34

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 (38) hide show
  1. package/bin/cli.js +2 -4
  2. package/bin/npm-cli.js +2 -4
  3. package/bin/npx-cli.js +2 -4
  4. package/dist/constants.js +68 -0
  5. package/dist/module-sync/cli.d.ts +0 -1
  6. package/dist/module-sync/cli.js +184 -164
  7. package/dist/module-sync/constants.d.ts +91 -18
  8. package/dist/module-sync/constants.js +2 -79
  9. package/dist/module-sync/link.js +9 -12
  10. package/dist/module-sync/npm-cli.js +23 -19
  11. package/dist/module-sync/npm-injection.js +126 -123
  12. package/dist/module-sync/npx-cli.js +21 -17
  13. package/dist/module-sync/path-resolve.js +11 -14
  14. package/dist/module-sync/sdk.js +30 -29
  15. package/dist/module-sync/vendor.js +0 -12
  16. package/dist/require/cli.js +168 -148
  17. package/dist/require/constants.js +2 -79
  18. package/dist/require/link.js +9 -12
  19. package/dist/require/npm-cli.js +23 -19
  20. package/dist/require/npm-injection.js +126 -123
  21. package/dist/require/npx-cli.js +21 -17
  22. package/dist/require/path-resolve.js +11 -14
  23. package/dist/require/sdk.js +26 -25
  24. package/dist/require/vendor.js +30 -115
  25. package/package.json +18 -32
  26. package/dist/module-sync/cli.d.ts.map +0 -1
  27. package/dist/require/cli.d.ts +0 -3
  28. package/dist/require/cli.d.ts.map +0 -1
  29. package/dist/require/color-or-markdown.d.ts +0 -23
  30. package/dist/require/constants.d.ts +0 -21
  31. package/dist/require/errors.d.ts +0 -7
  32. package/dist/require/link.d.ts +0 -2
  33. package/dist/require/npm-cli.d.ts +0 -2
  34. package/dist/require/npm-injection.d.ts +0 -1
  35. package/dist/require/npx-cli.d.ts +0 -2
  36. package/dist/require/path-resolve.d.ts +0 -8
  37. package/dist/require/sdk.d.ts +0 -8
  38. package/dist/require/settings.d.ts +0 -9
package/bin/cli.js CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
3
 
4
- const DIST_TYPE = require('semver').satisfies(process.versions.node, '>=22.12')
5
- ? 'module-sync'
6
- : 'require'
7
- require(`../dist/${DIST_TYPE}/cli.js`)
4
+ const constants = require('../dist/constants')
5
+ require(`../dist/${constants.DIST_TYPE}/cli.js`)
package/bin/npm-cli.js CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
3
 
4
- const DIST_TYPE = require('semver').satisfies(process.versions.node, '>=22.12')
5
- ? 'module-sync'
6
- : 'require'
7
- require(`../dist/${DIST_TYPE}/npm-cli.js`)
4
+ const constants = require('../dist/constants')
5
+ require(`../dist/${constants.DIST_TYPE}/npm-cli.js`)
package/bin/npx-cli.js CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
3
 
4
- const DIST_TYPE = require('semver').satisfies(process.versions.node, '>=22.12')
5
- ? 'module-sync'
6
- : 'require'
7
- require(`../dist/${DIST_TYPE}/npx-cli.js`)
4
+ const constants = require('../dist/constants')
5
+ require(`../dist/${constants.DIST_TYPE}/npx-cli.js`)
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('node:fs');
4
+ var require$$1 = require('node:path');
5
+ var require$$2 = require('@socketsecurity/registry/lib/env');
6
+ var require$$3 = require('@socketsecurity/registry/lib/constants');
7
+
8
+ var _nodeFs = require$$0;
9
+ var _nodePath = require$$1;
10
+ var _env = require$$2;
11
+ var _constants = require$$3;
12
+ const {
13
+ kInternalsSymbol,
14
+ PACKAGE_JSON,
15
+ [kInternalsSymbol]: {
16
+ createConstantsObject
17
+ }
18
+ } = _constants;
19
+ const API_V0_URL = 'https://api.socket.dev/v0';
20
+ const NPM_REGISTRY_URL = 'https://registry.npmjs.org';
21
+ const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues';
22
+ const UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE = 'UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE';
23
+ const ENV = Object.freeze({
24
+ ..._constants.ENV,
25
+ // Flag set by the optimize command to bypass the packagesHaveRiskyIssues check.
26
+ [UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE]: (0, _env.envAsBoolean)(process.env[UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE])
27
+ });
28
+ const rootPath = _nodePath.resolve((0, _nodeFs.realpathSync)(__dirname), '..');
29
+ const rootDistPath = _nodePath.join(rootPath, 'dist');
30
+ const rootBinPath = _nodePath.join(rootPath, 'bin');
31
+ const rootPkgJsonPath = _nodePath.join(rootPath, PACKAGE_JSON);
32
+ const nmBinPath = _nodePath.join(rootPath, 'node_modules/.bin');
33
+ const cdxgenBinPath = _nodePath.join(nmBinPath, 'cdxgen');
34
+ const synpBinPath = _nodePath.join(nmBinPath, 'synp');
35
+ const LAZY_DIST_TYPE = () => _constants.SUPPORTS_NODE_REQUIRE_MODULE ? 'module-sync' : 'require';
36
+ const lazyConstants = () => constants;
37
+ const lazyDistPath = () => _nodePath.join(rootDistPath, constants.DIST_TYPE);
38
+ const lazyShadowBinPath = () => _nodePath.join(rootPath, 'shadow', constants.DIST_TYPE);
39
+ const constants = createConstantsObject({
40
+ API_V0_URL,
41
+ ENV,
42
+ // Lazily defined values are initialized as `undefined` to keep their key order.
43
+ DIST_TYPE: undefined,
44
+ NPM_REGISTRY_URL,
45
+ SOCKET_CLI_ISSUES_URL,
46
+ UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE,
47
+ cdxgenBinPath,
48
+ constants: undefined,
49
+ distPath: undefined,
50
+ nmBinPath,
51
+ rootBinPath,
52
+ rootDistPath,
53
+ rootPath,
54
+ rootPkgJsonPath,
55
+ shadowBinPath: undefined,
56
+ synpBinPath
57
+ }, {
58
+ getters: {
59
+ DIST_TYPE: LAZY_DIST_TYPE,
60
+ // Preserve rollup chunk compatibility.
61
+ constants: lazyConstants,
62
+ distPath: lazyDistPath,
63
+ shadowBinPath: lazyShadowBinPath
64
+ },
65
+ mixin: _constants
66
+ });
67
+
68
+ module.exports = constants
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map