@knighted/module 1.5.1 → 1.5.2

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/dist/cjs/cli.cjs CHANGED
@@ -9,7 +9,6 @@ var _nodeProcess = require("node:process");
9
9
  var _nodeUtil = require("node:util");
10
10
  var _promises = require("node:fs/promises");
11
11
  var _nodePath = require("node:path");
12
- var _glob = require("glob");
13
12
  var _module = require("./module.cjs");
14
13
  var _parse = require("./parse.cjs");
15
14
  var _format = require("./format.cjs");
@@ -387,14 +386,14 @@ const normalizeSourceMapArgv = argv => {
387
386
  const expandFiles = async (patterns, cwd, ignore) => {
388
387
  const files = new Set();
389
388
  for (const pattern of patterns) {
390
- const matches = await (0, _glob.glob)(pattern, {
389
+ for await (const match of (0, _promises.glob)(pattern, {
391
390
  cwd,
392
- absolute: true,
393
- nodir: true,
394
- windowsPathsNoEscape: true,
395
- ignore
396
- });
397
- for (const m of matches) files.add((0, _nodePath.resolve)(m));
391
+ exclude: ignore,
392
+ withFileTypes: true
393
+ })) {
394
+ if (match.isDirectory()) continue;
395
+ files.add((0, _nodePath.resolve)(match.parentPath, match.name));
396
+ }
398
397
  }
399
398
  return [...files];
400
399
  };
package/dist/cli.js CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { stdin as defaultStdin, stdout as defaultStdout, stderr as defaultStderr } from 'node:process';
3
3
  import { parseArgs } from 'node:util';
4
- import { readFile, mkdir, writeFile } from 'node:fs/promises';
4
+ import { readFile, mkdir, writeFile, glob } from 'node:fs/promises';
5
5
  import { dirname, resolve, relative, join, basename } from 'node:path';
6
- import { glob } from 'glob';
7
6
  import { transform, collectProjectDualPackageHazards } from './module.js';
8
7
  import { parse } from './parse.js';
9
8
  import { format } from './format.js';
@@ -381,14 +380,14 @@ const normalizeSourceMapArgv = argv => {
381
380
  const expandFiles = async (patterns, cwd, ignore) => {
382
381
  const files = new Set();
383
382
  for (const pattern of patterns) {
384
- const matches = await glob(pattern, {
383
+ for await (const match of glob(pattern, {
385
384
  cwd,
386
- absolute: true,
387
- nodir: true,
388
- windowsPathsNoEscape: true,
389
- ignore
390
- });
391
- for (const m of matches) files.add(resolve(m));
385
+ exclude: ignore,
386
+ withFileTypes: true
387
+ })) {
388
+ if (match.isDirectory()) continue;
389
+ files.add(resolve(match.parentPath, match.name));
390
+ }
392
391
  }
393
392
  return [...files];
394
393
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knighted/module",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Bidirectional transform for ES modules and CommonJS.",
5
5
  "type": "module",
6
6
  "main": "dist/module.js",
@@ -75,7 +75,6 @@
75
75
  "typescript": "^5.9.3"
76
76
  },
77
77
  "dependencies": {
78
- "glob": "^13.0.6",
79
78
  "magic-string": "^0.30.21",
80
79
  "oxc-parser": "^0.116.0",
81
80
  "periscopic": "^4.0.2"