@socketsecurity/cli-with-sentry 1.0.77 → 1.0.78

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.
@@ -6,6 +6,46 @@ const { getGlobMatcher } = /*@__PURE__*/ require('./globs')
6
6
  const { naturalCompare } = /*@__PURE__*/ require('./sorts')
7
7
  const { stripBom } = /*@__PURE__*/ require('./strings')
8
8
 
9
+ const defaultIgnore = ObjectFreeze([
10
+ // Most of these ignored files can be included specifically if included in the
11
+ // files globs. Exceptions to this are:
12
+ // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files
13
+ // These can NOT be included.
14
+ // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L280
15
+ '**/.git',
16
+ '**/.npmrc',
17
+ // '**/bun.lockb?',
18
+ // '**/node_modules',
19
+ // '**/package-lock.json',
20
+ // '**/pnpm-lock.ya?ml',
21
+ // '**/yarn.lock',
22
+ // Include npm-packlist defaults:
23
+ // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L15-L38
24
+ '**/.DS_Store',
25
+ '**/.gitignore',
26
+ '**/.hg',
27
+ '**/.lock-wscript',
28
+ '**/.npmignore',
29
+ '**/.svn',
30
+ '**/.wafpickle-*',
31
+ '**/.*.swp',
32
+ '**/._*/**',
33
+ '**/archived-packages/**',
34
+ '**/build/config.gypi',
35
+ '**/CVS',
36
+ '**/npm-debug.log',
37
+ '**/*.orig',
38
+ // Inline generic .gitignore entries from the socket-registry repository root.
39
+ '**/.env',
40
+ '**/.eslintcache',
41
+ '**/.nvm',
42
+ '**/.tap',
43
+ '**/.tapci.yaml',
44
+ '**/.vscode',
45
+ '**/*.tsbuildinfo',
46
+ '**/Thumbs.db'
47
+ ])
48
+
9
49
  const defaultRemoveOptions = ObjectFreeze({
10
50
  __proto__: null,
11
51
  force: true,
@@ -38,25 +78,26 @@ function getPath() {
38
78
 
39
79
  /*@__NO_SIDE_EFFECTS__*/
40
80
  function innerReadDirNames(dirents, options) {
41
- const { includeEmpty, sort } = {
42
- __proto__: null,
43
- sort: true,
44
- includeEmpty: false,
45
- ...options
46
- }
81
+ const {
82
+ ignore,
83
+ includeEmpty = false,
84
+ sort = true
85
+ } = { __proto__: null, ...options }
47
86
  const path = getPath()
48
87
  const names = dirents
49
88
  .filter(
50
89
  d =>
51
90
  d.isDirectory() &&
52
- (includeEmpty || !isDirEmptySync(path.join(d.parentPath, d.name)))
91
+ (includeEmpty ||
92
+ !isDirEmptySync(path.join(d.parentPath, d.name), { ignore }))
53
93
  )
54
94
  .map(d => d.name)
55
95
  return sort ? names.sort(naturalCompare) : names
56
96
  }
57
97
 
58
98
  /*@__NO_SIDE_EFFECTS__*/
59
- function isDirEmptySync(dirname) {
99
+ function isDirEmptySync(dirname, options) {
100
+ const { ignore = defaultIgnore } = { __proto__: null, ...options }
60
101
  const fs = getFs()
61
102
  try {
62
103
  const files = fs.readdirSync(dirname)
@@ -64,10 +105,7 @@ function isDirEmptySync(dirname) {
64
105
  if (length === 0) {
65
106
  return true
66
107
  }
67
- const matcher = getGlobMatcher(
68
- /*@__PURE__*/ require('./constants/ignore-globs'),
69
- { cwd: dirname }
70
- )
108
+ const matcher = getGlobMatcher(ignore, { cwd: dirname })
71
109
  let ignoredCount = 0
72
110
  for (let i = 0; i < length; i += 1) {
73
111
  if (matcher(files[i])) {
@@ -216,8 +216,8 @@ function resolveBinPathSync(binPath) {
216
216
  }
217
217
 
218
218
  let relPath = ''
219
- const source = fs.readFileSync(binPath, 'utf8')
220
219
  if (hasKnownExt) {
220
+ const source = fs.readFileSync(binPath, 'utf8')
221
221
  if (isNpmOrNpx) {
222
222
  if (extLowered === '.cmd') {
223
223
  // "npm.cmd" and "npx.cmd" defined by
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "description": "CLI for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
5
5
  "homepage": "https://github.com/SocketDev/socket-cli",
6
6
  "license": "MIT",
@@ -112,7 +112,7 @@
112
112
  "@socketregistry/is-interactive": "1.0.6",
113
113
  "@socketregistry/packageurl-js": "1.0.8",
114
114
  "@socketsecurity/config": "3.0.1",
115
- "@socketsecurity/registry": "1.0.254",
115
+ "@socketsecurity/registry": "1.0.256",
116
116
  "@socketsecurity/sdk": "1.4.67",
117
117
  "@types/blessed": "0.1.25",
118
118
  "@types/cmd-shim": "5.0.2",
@@ -1,41 +0,0 @@
1
- 'use strict'
2
-
3
- module.exports = Object.freeze([
4
- // Most of these ignored files can be included specifically if included in the
5
- // files globs. Exceptions to this are:
6
- // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files
7
- // These can NOT be included.
8
- // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L280
9
- '**/.git',
10
- '**/.npmrc',
11
- '**/bun.lockb?',
12
- '**/node_modules',
13
- '**/package-lock.json',
14
- '**/pnpm-lock.ya?ml',
15
- '**/yarn.lock',
16
- // Include npm-packlist defaults:
17
- // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L15-L38
18
- '**/.DS_Store',
19
- '**/.gitignore',
20
- '**/.hg',
21
- '**/.lock-wscript',
22
- '**/.npmignore',
23
- '**/.svn',
24
- '**/.wafpickle-*',
25
- '**/.*.swp',
26
- '**/._*/**',
27
- '**/archived-packages/**',
28
- '**/build/config.gypi',
29
- '**/CVS',
30
- '**/npm-debug.log',
31
- '**/*.orig',
32
- // Inline .gitignore from the socket-registry repository root.
33
- '**/.env',
34
- '**/.eslintcache',
35
- '**/.nvm',
36
- '**/.tap',
37
- '**/.tapci.yaml',
38
- '**/.vscode',
39
- '**/*.tsbuildinfo',
40
- '**/Thumbs.db'
41
- ])