fix(providence): use globby again
This commit is contained in:
parent
87a1cb4d5b
commit
9827228b83
18 changed files with 1274 additions and 1083 deletions
5
.changeset/sweet-seals-fold.md
Normal file
5
.changeset/sweet-seals-fold.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'providence-analytics': minor
|
||||
---
|
||||
|
||||
use globby again
|
||||
410
package-lock.json
generated
410
package-lock.json
generated
|
|
@ -4238,110 +4238,6 @@
|
|||
"lit-html": "^2.0.0 || ^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-arm64": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.48.2.tgz",
|
||||
"integrity": "sha512-3JY3K6AXq6QyloxLJkK9s7VFcrGU7Of8tG0bf9lIFzeNzmJDQAGUMYUkfUzDubx9prlNLCbxsgBTww5PjKgQeQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-x64": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.48.2.tgz",
|
||||
"integrity": "sha512-v1MQnfx2iwoy1eMJYHRwHsp8FA9HK4xa+oqx6XEhxft6yVwrt+gVIBAU6jUAk783OGkmvIbZbw8uVosg+YYOGA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-gnu": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.48.2.tgz",
|
||||
"integrity": "sha512-g9FUS++WwVJmrsZHS3vi7mlLQYHKL/tbX7H8ERlQhLp01JzD3zyyHzieVqeClV7B+nQSctyurpwmYuOD4grZPw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-musl": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.48.2.tgz",
|
||||
"integrity": "sha512-r5S+2IRW8QCL8eSv1gzp/nMTt1WbS04etm5mvM/55SH2G6bXJ8MNfcj3KATjmD/JvfNvsDVB80VlwI6HUNX+WQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-gnu": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.48.2.tgz",
|
||||
"integrity": "sha512-f10drS9TBekdHh37TSWYSGLgKBAofC7zuRjnTTuH1sXWTxRzmshs8p4WNVYcqImfgix48o3H0uwIFNm/UsSkfA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-musl": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.48.2.tgz",
|
||||
"integrity": "sha512-rUAOgodK1wW++RO2xBjvXJtALVyKbXDkaiG61Ob5+f9M4gfD6kfci2cqOT4dD5z2+zxB4dC71DaaOdwM20Yx9Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-arm64-msvc": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.48.2.tgz",
|
||||
"integrity": "sha512-xHMx56Xd0gXp3nwrIJ8Z6Hny2Mvj5jSAUUkd8cYakItA7LNGWYl3EeFKErRXh/Qyd9uhuB4BqSr0CjiMU40vsg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-x64-msvc": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.48.2.tgz",
|
||||
"integrity": "sha512-lOszFeGRNeiShsS2GJBzFBrMiDFhxCi0ddBc3tewtmjXsrb84dNuzM8+JgG6x9WQMIcLB68YZGjtOL+63cC/EQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.48.2.tgz",
|
||||
|
|
@ -20555,28 +20451,6 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/oxc-parser": {
|
||||
"version": "0.48.2",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.48.2.tgz",
|
||||
"integrity": "sha512-UlCh4q1FrPNlc0WzPA5cw0SRnGprpn8o4aRU05ceeqTfbT2KoRus9X1bkHGngSP6n7IXUHUPJ6hs3mJW1GBu/w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "^0.48.2"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/Boshen"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@oxc-parser/binding-darwin-arm64": "0.48.2",
|
||||
"@oxc-parser/binding-darwin-x64": "0.48.2",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.48.2",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.48.2",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.48.2",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.48.2",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.48.2",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.48.2"
|
||||
}
|
||||
},
|
||||
"node_modules/oxc-resolver": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-1.12.0.tgz",
|
||||
|
|
@ -28257,27 +28131,27 @@
|
|||
"version": "0.18.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": "^16.0.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"commander": "^2.20.3",
|
||||
"oxc-parser": "0.48.2",
|
||||
"globby": "^14.1.0",
|
||||
"oxc-parser": "0.48.0",
|
||||
"parse5": "^7.2.1",
|
||||
"semver": "^7.7.0"
|
||||
"semver": "^7.7.1"
|
||||
},
|
||||
"bin": {
|
||||
"providence": "src/cli/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/parser": "^7.26.7",
|
||||
"@babel/parser": "^7.26.10",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.26.0",
|
||||
"@babel/traverse": "^7.26.7",
|
||||
"@babel/traverse": "^7.26.10",
|
||||
"@swc/core": "^1.10.12",
|
||||
"@types/inquirer": "^9.0.7",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@web/dev-server": "^0.4.6",
|
||||
"@web/dev-server-core": "^0.7.5",
|
||||
"globby": "^14.0.2",
|
||||
"lit-element": "^4.1.1",
|
||||
"mock-fs": "^5.4.1"
|
||||
"mock-fs": "^5.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
|
|
@ -28285,7 +28159,7 @@
|
|||
"peerDependencies": {
|
||||
"@babel/parser": "^7.25.8",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.25.7",
|
||||
"@swc/core": "^1.7.36"
|
||||
"@swc/core": "^1.10.12"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/code-frame": {
|
||||
|
|
@ -28293,6 +28167,7 @@
|
|||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
|
||||
"integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.25.9",
|
||||
"js-tokens": "^4.0.0",
|
||||
|
|
@ -28303,14 +28178,14 @@
|
|||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/generator": {
|
||||
"version": "7.26.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz",
|
||||
"integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.10.tgz",
|
||||
"integrity": "sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.26.5",
|
||||
"@babel/types": "^7.26.5",
|
||||
"@babel/parser": "^7.26.10",
|
||||
"@babel/types": "^7.26.10",
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"jsesc": "^3.0.2"
|
||||
|
|
@ -28333,6 +28208,7 @@
|
|||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz",
|
||||
"integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
|
|
@ -28342,18 +28218,19 @@
|
|||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
|
||||
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/parser": {
|
||||
"version": "7.26.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz",
|
||||
"integrity": "sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz",
|
||||
"integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.26.7"
|
||||
"@babel/types": "^7.26.10"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
|
|
@ -28378,31 +28255,32 @@
|
|||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/template": {
|
||||
"version": "7.25.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz",
|
||||
"integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==",
|
||||
"version": "7.26.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz",
|
||||
"integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.25.9",
|
||||
"@babel/parser": "^7.25.9",
|
||||
"@babel/types": "^7.25.9"
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@babel/parser": "^7.26.9",
|
||||
"@babel/types": "^7.26.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/traverse": {
|
||||
"version": "7.26.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz",
|
||||
"integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.10.tgz",
|
||||
"integrity": "sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@babel/generator": "^7.26.5",
|
||||
"@babel/parser": "^7.26.7",
|
||||
"@babel/template": "^7.25.9",
|
||||
"@babel/types": "^7.26.7",
|
||||
"@babel/generator": "^7.26.10",
|
||||
"@babel/parser": "^7.26.10",
|
||||
"@babel/template": "^7.26.9",
|
||||
"@babel/types": "^7.26.10",
|
||||
"debug": "^4.3.1",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
|
|
@ -28411,9 +28289,9 @@
|
|||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@babel/types": {
|
||||
"version": "7.26.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz",
|
||||
"integrity": "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==",
|
||||
"version": "7.26.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz",
|
||||
"integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -28424,10 +28302,114 @@
|
|||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-darwin-arm64": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.48.0.tgz",
|
||||
"integrity": "sha512-UqStsHzXrwKw/HZgRHxTr048gEJQCvRZGiEehfloSbUGUFw/WMOjVWp5jZbYpYml55ksw6Ev/BNEx1BqUZbxeg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-darwin-x64": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.48.0.tgz",
|
||||
"integrity": "sha512-v00Qt+RZcL3Hj1hTfW7kgbvwkNBghMUsSP2YQxxYA/pEBiDIKBp9dkqpK3CaetYP/UJOkoTLKw5oEElPT2daAw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-linux-arm64-gnu": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.48.0.tgz",
|
||||
"integrity": "sha512-XfoqcvRzHjeCtQbdk8V0PtuvKIkFWpEmnKp/eOM/FVwGbcLjHeW05/Fg8WK8K+LEiEAj5EY4miH6HVxLjBc+Pg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-linux-arm64-musl": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.48.0.tgz",
|
||||
"integrity": "sha512-yLBrN5rYR9ZzsJZWe87CVnR5XwTFIWjLl6Tglezp++JzaUnkPOtPy3lQ82NIn76fzCPG6leyDoHxKLHEnQyxWg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-linux-x64-gnu": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.48.0.tgz",
|
||||
"integrity": "sha512-D3pW2vujgfMow/W7if9KS48fRsg7ggFLgmxCdaXvTl9jqX35kPQ3Byk6RYSdcWXQgtPpojnDvhkNTRGyS7ZU0w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-linux-x64-musl": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.48.0.tgz",
|
||||
"integrity": "sha512-yXRmsBP3aUBDCu1lQhod4NOPeJ01Yv+s8wTs7riIR8Rodk59EqV+MlA0sKKSXYGl1JKW/TiaqXJxJAnOkevTIA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-win32-arm64-msvc": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.48.0.tgz",
|
||||
"integrity": "sha512-5MZytXFpwUZaJpmzdrycMdFqGgcNmUYNqtOZar5ItrJ2JuYQMjGwvjfRpFGyn8RNdqA28cdhk36Yta6gNyeW1Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@oxc-parser/binding-win32-x64-msvc": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.48.0.tgz",
|
||||
"integrity": "sha512-oxpr15T4nVaSUB5W/dvx00SGG8OrKN4vNfAQVN7J1KK7jh/dpaZXzXw4koQpAIEAj+d82CQ201MXRZi3jdpmSA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/@rollup/plugin-node-resolve": {
|
||||
"version": "16.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.0.tgz",
|
||||
"integrity": "sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==",
|
||||
"version": "16.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz",
|
||||
"integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
|
|
@ -28730,6 +28712,48 @@
|
|||
"integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==",
|
||||
"dev": true
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/fast-glob": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
||||
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
"@nodelib/fs.walk": "^1.2.3",
|
||||
"glob-parent": "^5.1.2",
|
||||
"merge2": "^1.3.0",
|
||||
"micromatch": "^4.0.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/globby": {
|
||||
"version": "14.1.0",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz",
|
||||
"integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==",
|
||||
"dependencies": {
|
||||
"@sindresorhus/merge-streams": "^2.1.0",
|
||||
"fast-glob": "^3.3.3",
|
||||
"ignore": "^7.0.3",
|
||||
"path-type": "^6.0.0",
|
||||
"slash": "^5.1.0",
|
||||
"unicorn-magic": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/ignore": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.3.tgz",
|
||||
"integrity": "sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==",
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/lru-cache": {
|
||||
"version": "8.0.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz",
|
||||
|
|
@ -28748,6 +28772,28 @@
|
|||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/oxc-parser": {
|
||||
"version": "0.48.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.48.0.tgz",
|
||||
"integrity": "sha512-bmIrKFC/di75joc/mmo8iE5rCJ0DBkgSbjKnNkmacxcD6Uhfg7bD3Vu7/GJhtrbfVwtR76UMoWI1Hl3HxW40ow==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "^0.48.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/Boshen"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@oxc-parser/binding-darwin-arm64": "0.48.0",
|
||||
"@oxc-parser/binding-darwin-x64": "0.48.0",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.48.0",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.48.0",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.48.0",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.48.0",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.48.0",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.48.0"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/parse5": {
|
||||
"version": "7.2.1",
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz",
|
||||
|
|
@ -28759,6 +28805,17 @@
|
|||
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/path-type": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz",
|
||||
"integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/readdirp": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz",
|
||||
|
|
@ -28773,9 +28830,10 @@
|
|||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/semver": {
|
||||
"version": "7.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz",
|
||||
"integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
|
||||
"integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
|
|
@ -28783,6 +28841,28 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/slash": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
|
||||
"integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages-node/providence-analytics/node_modules/unicorn-magic": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
|
||||
"integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages-node/publish-docs": {
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -37,29 +37,29 @@
|
|||
"test:node:unit": "mocha './{test-node,src}/**/*.test.js'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": "^16.0.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"commander": "^2.20.3",
|
||||
"oxc-parser": "0.48.2",
|
||||
"globby": "^14.1.0",
|
||||
"oxc-parser": "0.48.0",
|
||||
"parse5": "^7.2.1",
|
||||
"semver": "^7.7.0"
|
||||
"semver": "^7.7.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/parser": "^7.25.8",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.25.7",
|
||||
"@swc/core": "^1.7.36"
|
||||
"@swc/core": "^1.10.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/parser": "^7.26.7",
|
||||
"@babel/parser": "^7.26.10",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.26.0",
|
||||
"@babel/traverse": "^7.26.7",
|
||||
"@babel/traverse": "^7.26.10",
|
||||
"@swc/core": "^1.10.12",
|
||||
"@types/inquirer": "^9.0.7",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@web/dev-server": "^0.4.6",
|
||||
"@web/dev-server-core": "^0.7.5",
|
||||
"globby": "^14.0.2",
|
||||
"lit-element": "^4.1.1",
|
||||
"mock-fs": "^5.4.1"
|
||||
"mock-fs": "^5.5.0"
|
||||
},
|
||||
"keywords": [
|
||||
"analysis",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable no-shadow */
|
||||
import child_process from 'child_process'; // eslint-disable-line camelcase
|
||||
import path from 'path';
|
||||
|
||||
import { optimisedGlob } from '../program/utils/optimised-glob.js';
|
||||
import { globby } from 'globby';
|
||||
import { toPosixPath } from '../program/utils/to-posix-path.js';
|
||||
import { LogService } from '../program/core/LogService.js';
|
||||
import { fsAdapter } from '../program/utils/fs-adapter.js';
|
||||
|
|
@ -59,9 +58,7 @@ export async function pathsArrayFromCs(targets, cwd = process.cwd()) {
|
|||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
if (t.includes('*')) {
|
||||
const x = (await optimisedGlob(t, { cwd, absolute: true, onlyFiles: false })).map(
|
||||
toPosixPath,
|
||||
);
|
||||
const x = (await globby(t, { cwd, absolute: true, onlyFiles: false })).map(toPosixPath);
|
||||
resultPaths.push(...x);
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
|
|
@ -139,7 +136,7 @@ export function targetDefault(cwd) {
|
|||
*/
|
||||
async function readPackageTree(targetPath, matcher, mode) {
|
||||
const folderName = mode === 'npm' ? 'node_modules' : 'bower_components';
|
||||
const potentialPaths = await optimisedGlob(`${folderName}/**/*`, {
|
||||
const potentialPaths = await globby(`${folderName}/**/*`, {
|
||||
onlyDirectories: true,
|
||||
fs: fsAdapter.fs,
|
||||
cwd: targetPath,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import child_process from 'child_process'; // eslint-disable-line camelcase
|
||||
import { globby } from 'globby';
|
||||
import path from 'path';
|
||||
|
||||
import { getFilePathRelativeFromRoot } from '../utils/get-file-path-relative-from-root.js';
|
||||
import { optimisedGlob } from '../utils/optimised-glob.js';
|
||||
import { toPosixPath } from '../utils/to-posix-path.js';
|
||||
import { fsAdapter } from '../utils/fs-adapter.js';
|
||||
import { memoize } from '../utils/memoize.js';
|
||||
|
|
@ -83,7 +83,7 @@ const getPathsFromGlobList = memoize(
|
|||
const results = [];
|
||||
for (const pathOrGlob of list) {
|
||||
if (pathOrGlob.includes('*')) {
|
||||
const globResults = await optimisedGlob(pathOrGlob, {
|
||||
const globResults = await globby(pathOrGlob, {
|
||||
cwd: rootPath,
|
||||
absolute: false,
|
||||
onlyFiles: false,
|
||||
|
|
@ -547,13 +547,13 @@ export class InputDataService {
|
|||
absolute: true,
|
||||
cwd: startPath,
|
||||
};
|
||||
let filteredGlobRes = await optimisedGlob(combinedGlobs, globbyCfg);
|
||||
let filteredGlobRes = await globby(combinedGlobs, globbyCfg);
|
||||
|
||||
// Unfortunatly, globby does not correctly remove the negated globs,
|
||||
// so we have to do it manually
|
||||
const negatedGlobs = combinedGlobs.filter(p => p.startsWith('!'));
|
||||
if (negatedGlobs.length) {
|
||||
const subtract = await optimisedGlob(
|
||||
const subtract = await globby(
|
||||
negatedGlobs.map(p => p.slice(1)),
|
||||
globbyCfg,
|
||||
);
|
||||
|
|
@ -563,7 +563,7 @@ export class InputDataService {
|
|||
|
||||
// Make sure we don't delete to much by giving customConfig.allowlist priority
|
||||
if (customConfig.allowlist?.length) {
|
||||
const customResults = await optimisedGlob(customConfig.allowlist, globbyCfg);
|
||||
const customResults = await globby(customConfig.allowlist, globbyCfg);
|
||||
filteredGlobRes = Array.from(new Set([...filteredGlobRes, ...customResults]));
|
||||
}
|
||||
|
||||
|
|
@ -649,7 +649,7 @@ export class InputDataService {
|
|||
const valueToUseForGlob = stripDotSlashFromLocalPath(resolvedVal).replace('*', '**/*');
|
||||
|
||||
// Generate all possible entries via glob, first strip './'
|
||||
const internalExportMapPathsForKeyRaw = await optimisedGlob(valueToUseForGlob, {
|
||||
const internalExportMapPathsForKeyRaw = await globby(valueToUseForGlob, {
|
||||
cwd: packageRootPath,
|
||||
onlyFiles: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ export {
|
|||
getSourceCodeFragmentOfDeclaration,
|
||||
getFilePathOrExternalSource,
|
||||
} from './get-source-code-fragment-of-declaration.js';
|
||||
export { optimisedGlob } from './optimised-glob.js';
|
||||
export { oxcTraverse } from './oxc-traverse.js';
|
||||
export { fsAdapter } from './fs-adapter.js';
|
||||
export { memoize } from './memoize.js';
|
||||
|
|
|
|||
|
|
@ -1,473 +0,0 @@
|
|||
/* eslint-disable no-case-declarations */
|
||||
/* eslint-disable no-fallthrough */
|
||||
import nodeFs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { toPosixPath } from './to-posix-path.js';
|
||||
import { memoize } from './memoize.js';
|
||||
|
||||
/**
|
||||
* @typedef {nodeFs.Dirent & { path:string; parentPath:string }} DirentWithPath
|
||||
* @typedef {nodeFs} FsLike
|
||||
* @typedef {{
|
||||
* onlyDirectories: boolean;
|
||||
* suppressErrors: boolean;
|
||||
* onlyFiles: boolean;
|
||||
* absolute: boolean;
|
||||
* extglob: boolean;
|
||||
* ignore: string[];
|
||||
* unique: boolean;
|
||||
* deep: number;
|
||||
* dot: boolean;
|
||||
* cwd: string;
|
||||
* fs: FsLike;
|
||||
* }} FastGlobtions
|
||||
*/
|
||||
|
||||
const [nodeMajor] = process.versions.node.split('.').map(Number);
|
||||
|
||||
export const parseGlobToRegex = memoize(
|
||||
/**
|
||||
* @param {string} glob
|
||||
* @param {object} [providedOpts]
|
||||
* @param {boolean} [providedOpts.globstar=true] if true, '/foo/*' => '^\/foo\/[^/]*$' (not allowing folders inside *), else '/foo/*' => '^\/foo\/.*$'
|
||||
* @param {boolean} [providedOpts.extglob=true] if true, supports so called "extended" globs (like bash) and single character matching, matching ranges of characters, group matching etc.
|
||||
* @returns {RegExp}
|
||||
*/
|
||||
(glob, providedOpts) => {
|
||||
if (typeof glob !== 'string') throw new TypeError('Expected a string');
|
||||
|
||||
const options = {
|
||||
globstar: true,
|
||||
extglob: true,
|
||||
...providedOpts,
|
||||
};
|
||||
|
||||
let regexResultStr = '';
|
||||
let isInGroup = false;
|
||||
let currentChar;
|
||||
|
||||
for (let i = 0; i < glob.length; i += 1) {
|
||||
currentChar = glob[i];
|
||||
|
||||
const charsToEscape = ['/', '$', '^', '+', '.', '(', ')', '=', '!', '|'];
|
||||
if (charsToEscape.includes(currentChar)) {
|
||||
regexResultStr += `\\${currentChar}`;
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
|
||||
if (options.extglob) {
|
||||
if (currentChar === '?') {
|
||||
regexResultStr += '.';
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
if (['[', ']'].includes(currentChar)) {
|
||||
regexResultStr += currentChar;
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
if (currentChar === '{') {
|
||||
isInGroup = true;
|
||||
regexResultStr += '(';
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
if (currentChar === '}') {
|
||||
isInGroup = false;
|
||||
regexResultStr += ')';
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
}
|
||||
|
||||
if (currentChar === ',') {
|
||||
if (isInGroup) {
|
||||
regexResultStr += '|';
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
regexResultStr += `\\${currentChar}`;
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
|
||||
if (currentChar === '*') {
|
||||
const prevChar = glob[i - 1];
|
||||
let isMultiStar = false;
|
||||
while (glob[i + 1] === '*') {
|
||||
isMultiStar = true;
|
||||
i += 1;
|
||||
}
|
||||
const nextChar = glob[i + 1];
|
||||
if (!options.globstar) {
|
||||
// Treat any number of "*" as one
|
||||
regexResultStr += '.*';
|
||||
} else {
|
||||
const isGlobstarSegment =
|
||||
isMultiStar &&
|
||||
['/', undefined].includes(prevChar) &&
|
||||
['/', undefined].includes(nextChar);
|
||||
if (isGlobstarSegment) {
|
||||
// Match zero or more path segments
|
||||
regexResultStr += '((?:[^/]*(?:/|$))*)';
|
||||
// Move over the "/"
|
||||
i += 1;
|
||||
} else {
|
||||
// Only match one path segment
|
||||
regexResultStr += '([^/]*)';
|
||||
}
|
||||
}
|
||||
continue; // eslint-disable-line no-continue
|
||||
}
|
||||
regexResultStr += currentChar;
|
||||
}
|
||||
return new RegExp(`^${regexResultStr}$`);
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {T[]} arr
|
||||
* @returns {T[]}
|
||||
*/
|
||||
function toUniqueArray(arr) {
|
||||
return Array.from(new Set(arr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} glob
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isRootGlob(glob) {
|
||||
return glob.startsWith('/') || glob.startsWith('!/') || Boolean(glob.match(/^([A-Z]:\\|\\\\)/));
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure cwd does not end with a slash
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
*/
|
||||
function normalizeCwd(str) {
|
||||
return str.endsWith('/') ? str.slice(0, -1) : str;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {DirentWithPath} dirent
|
||||
* @param {{cwd:string}} cfg
|
||||
* @returns {string}
|
||||
*/
|
||||
function direntToLocalPath(dirent, { cwd }) {
|
||||
const parentPath = toPosixPath(dirent.parentPath || dirent.path);
|
||||
// Since `fs.glob` can return parent paths with files included, we need to strip the file part
|
||||
const parts = parentPath.split('/');
|
||||
const lastPart = parts[parts.length - 1];
|
||||
const isLastPartFile = !lastPart.startsWith('.') && lastPart.split('.').length > 1;
|
||||
const folder = isLastPartFile ? parts.slice(0, parts.length - 1).join('/') : parentPath;
|
||||
|
||||
return toPosixPath(path.join(folder, dirent.name)).replace(
|
||||
new RegExp(`^${toPosixPath(cwd)}/`),
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{dirent:nodeFs.Dirent;relativeToCwdPath:string}[]} matchedEntries
|
||||
* @param {FastGlobtions} options
|
||||
* @returns {string[]}
|
||||
*/
|
||||
function postprocessOptions(matchedEntries, options) {
|
||||
const allFileOrDirectoryEntries = matchedEntries.filter(({ dirent }) =>
|
||||
options.onlyDirectories ? dirent.isDirectory() : dirent.isFile(),
|
||||
);
|
||||
|
||||
let filteredPaths = allFileOrDirectoryEntries.map(({ relativeToCwdPath }) => relativeToCwdPath);
|
||||
|
||||
if (!options.dot) {
|
||||
filteredPaths = filteredPaths.filter(
|
||||
f => !f.split('/').some(folderOrFile => folderOrFile.startsWith('.')),
|
||||
);
|
||||
}
|
||||
|
||||
if (options.absolute) {
|
||||
filteredPaths = filteredPaths.map(f => {
|
||||
const isRootPath = isRootGlob(f);
|
||||
return isRootPath ? toPosixPath(f) : toPosixPath(path.join(options.cwd, f));
|
||||
});
|
||||
if (process.platform === 'win32') {
|
||||
const driveChar = path.win32.resolve(options.cwd).slice(0, 1).toUpperCase();
|
||||
filteredPaths = filteredPaths.map(f => `${driveChar}:${f}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.deep !== Infinity) {
|
||||
filteredPaths = filteredPaths.filter(f => f.split('/').length <= options.deep + 2);
|
||||
}
|
||||
|
||||
const result = options.unique ? toUniqueArray(filteredPaths) : filteredPaths;
|
||||
return result.sort((a, b) => {
|
||||
const pathDiff = a.split('/').length - b.split('/').length;
|
||||
return pathDiff !== 0 ? pathDiff : a.localeCompare(b);
|
||||
});
|
||||
}
|
||||
|
||||
const getStartPath = memoize(
|
||||
/**
|
||||
* @param {string} glob
|
||||
* @returns {string}
|
||||
*/
|
||||
glob => {
|
||||
const reservedChars = ['?', '[', ']', '{', '}', ',', '.', '*'];
|
||||
const startPathParts = [];
|
||||
for (const part of glob.split('/')) {
|
||||
const hasReservedChar = reservedChars.some(reservedChar => part.includes(reservedChar));
|
||||
if (hasReservedChar) break;
|
||||
startPathParts.push(part);
|
||||
}
|
||||
return startPathParts.join('/');
|
||||
},
|
||||
);
|
||||
|
||||
let isCacheEnabled = false;
|
||||
let isExperimentalFsGlobEnabled = false;
|
||||
/** @type {{[path:string]:DirentWithPath[]}} */
|
||||
const cache = {};
|
||||
|
||||
const getAllDirentsFromStartPath = memoize(
|
||||
/**
|
||||
* @param {string} startPath
|
||||
* @param {{fs?:FsLike, dirents?:DirentWithPath[]}} providedOptions
|
||||
* @returns {Promise<DirentWithPath[]>}
|
||||
*/
|
||||
async (startPath, { fs = /** @type {* & FsLike} */ (nodeFs), dirents = [] } = {}) => {
|
||||
if (isCacheEnabled && cache[startPath]) return cache[startPath];
|
||||
|
||||
// Older node doesn't support recursive option
|
||||
if (nodeMajor < 18) {
|
||||
/** @type {nodeFs.Dirent[]} */
|
||||
const direntsForLvl = await fs.promises.readdir(startPath, { withFileTypes: true });
|
||||
for (const _dirent of direntsForLvl) {
|
||||
const dirent = /** @type {DirentWithPath} */ (_dirent);
|
||||
dirent.parentPath = dirent.path = startPath; // eslint-disable-line no-multi-assign
|
||||
dirents.push(/** @type {DirentWithPath} */ (dirent));
|
||||
|
||||
if (dirent.isDirectory()) {
|
||||
const subDir = path.join(startPath, dirent.name);
|
||||
await getAllDirentsFromStartPath(subDir, { fs, dirents });
|
||||
}
|
||||
}
|
||||
return dirents;
|
||||
}
|
||||
|
||||
const direntResult = /** @type {* & DirentWithPath[]} */ (
|
||||
await fs.promises.readdir(startPath, {
|
||||
withFileTypes: true,
|
||||
// @ts-expect-error
|
||||
recursive: true,
|
||||
})
|
||||
);
|
||||
|
||||
cache[startPath] = direntResult;
|
||||
return direntResult;
|
||||
},
|
||||
);
|
||||
|
||||
const getAllDirentsRelativeToCwd = memoize(
|
||||
/**
|
||||
* @param {string} fullStartPath
|
||||
* @param {{fs?:FsLike, cwd:string}} options
|
||||
* @returns {Promise<{relativeToCwdPath:string;dirent:DirentWithPath}[]>}
|
||||
*/
|
||||
async (fullStartPath, options) => {
|
||||
const allDirentsRelativeToStartPath = await getAllDirentsFromStartPath(fullStartPath, {
|
||||
fs: options.fs,
|
||||
});
|
||||
|
||||
const allDirEntsRelativeToCwd = allDirentsRelativeToStartPath.map(dirent => ({
|
||||
relativeToCwdPath: direntToLocalPath(dirent, { cwd: options.cwd }),
|
||||
dirent,
|
||||
}));
|
||||
|
||||
return allDirEntsRelativeToCwd;
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {string|string[]} globOrGlobs
|
||||
* @param {Partial<FastGlobtions> & {exclude?:Function; stats: boolean; cwd:string}} cfg
|
||||
* @returns {Promise<string[]|DirentWithPath[]>}
|
||||
*/
|
||||
async function nativeGlob(globOrGlobs, { fs, cwd, exclude, stats }) {
|
||||
// @ts-expect-error
|
||||
const asyncGenResult = await fs.promises.glob(globOrGlobs, {
|
||||
withFileTypes: true,
|
||||
cwd,
|
||||
...(exclude ? { exclude } : {}),
|
||||
});
|
||||
const results = [];
|
||||
for await (const dirent of asyncGenResult) {
|
||||
if (dirent.name === '.' || dirent.isDirectory()) continue; // eslint-disable-line no-continue
|
||||
results.push(stats ? dirent : direntToLocalPath(dirent, { cwd }));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {{globs: string[]; ignoreGlobs: string[]; options: FastGlobtions; regularGlobs:string[]}} config
|
||||
* @returns {Promise<string[]|void>}
|
||||
*/
|
||||
async function getNativeGlobResults({ globs, options, ignoreGlobs, regularGlobs }) {
|
||||
const optionsNotSupportedByNativeGlob = ['onlyDirectories', 'dot'];
|
||||
const hasGlobWithFullPath = globs.some(isRootGlob);
|
||||
const doesConfigAllowNative =
|
||||
!optionsNotSupportedByNativeGlob.some(opt => options[opt]) && !hasGlobWithFullPath;
|
||||
|
||||
if (!doesConfigAllowNative) return undefined;
|
||||
|
||||
const negativeGlobs = [...ignoreGlobs, ...regularGlobs.filter(r => r.startsWith('!'))].map(r =>
|
||||
r.slice(1),
|
||||
);
|
||||
|
||||
const negativeResults = negativeGlobs.length
|
||||
? // @ts-ignore
|
||||
/** @type {string[]} */ (await nativeGlob(negativeGlobs, options))
|
||||
: [];
|
||||
const positiveGlobs = regularGlobs.filter(r => !r.startsWith('!'));
|
||||
|
||||
const result = /** @type {DirentWithPath[]} */ (
|
||||
await nativeGlob(positiveGlobs, {
|
||||
cwd: /** @type {string} */ (options.cwd),
|
||||
fs: options.fs,
|
||||
stats: true,
|
||||
// we cannot use the exclude option here, because it's not working correctly
|
||||
})
|
||||
);
|
||||
|
||||
const direntsFiltered = result.filter(
|
||||
dirent =>
|
||||
!negativeResults.includes(
|
||||
direntToLocalPath(dirent, { cwd: /** @type {string} */ (options.cwd) }),
|
||||
),
|
||||
);
|
||||
|
||||
return postprocessOptions(
|
||||
direntsFiltered.map(dirent => ({
|
||||
dirent,
|
||||
relativeToCwdPath: direntToLocalPath(dirent, { cwd: /** @type {string} */ (options.cwd) }),
|
||||
})),
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lightweight glob implementation.
|
||||
* It's a drop-in replacement for globby, but it's faster, a few hundred lines of code and has no dependencies.
|
||||
* @param {string|string[]} globOrGlobs
|
||||
* @param {Partial<FastGlobtions>} providedOptions
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
export async function optimisedGlob(globOrGlobs, providedOptions = {}) {
|
||||
const options = {
|
||||
fs: /** @type {* & FsLike} */ (nodeFs),
|
||||
onlyDirectories: false,
|
||||
suppressErrors: true,
|
||||
cwd: process.cwd(),
|
||||
absolute: false,
|
||||
onlyFiles: true,
|
||||
deep: Infinity,
|
||||
globstar: true,
|
||||
extglob: true,
|
||||
unique: true,
|
||||
sync: false,
|
||||
dot: false,
|
||||
ignore: [],
|
||||
// Add if needed: throwErrorOnBrokenSymbolicLink, markDirectories, objectMode, stats
|
||||
// https://github.com/mrmlnc/fast-glob?tab=readme-ov-file
|
||||
...providedOptions,
|
||||
};
|
||||
|
||||
options.cwd = normalizeCwd(options.cwd);
|
||||
|
||||
if (!options.onlyFiles) {
|
||||
// This makes behavior aligned with globby
|
||||
options.onlyDirectories = true;
|
||||
}
|
||||
|
||||
const regularGlobs = Array.isArray(globOrGlobs) ? globOrGlobs : [globOrGlobs];
|
||||
const ignoreGlobs = options.ignore.map((/** @type {string} */ g) =>
|
||||
g.startsWith('!') ? g : `!${g}`,
|
||||
);
|
||||
const globs = toUniqueArray([...regularGlobs, ...ignoreGlobs]);
|
||||
|
||||
if (isExperimentalFsGlobEnabled && options.fs?.promises.glob) {
|
||||
const params = { regularGlobs, ignoreGlobs, options, globs };
|
||||
const nativeGlobResults = await getNativeGlobResults(params);
|
||||
if (nativeGlobResults) return nativeGlobResults;
|
||||
}
|
||||
|
||||
/** @type {RegExp[]} */
|
||||
const matchRegexesNegative = [];
|
||||
/** @type {RegExp[]} */
|
||||
const matchRegexes = [];
|
||||
/** @type {{dirent:nodeFs.Dirent;relativeToCwdPath:string}[]} */
|
||||
let globEntries = [];
|
||||
|
||||
for (const glob of globs) {
|
||||
const isNegative = glob.startsWith('!');
|
||||
|
||||
// Relative paths like './my/folder/**/*.js' are changed to 'my/folder/**/*.js'
|
||||
const globNormalized = glob.replace(/^\.\//g, '').slice(isNegative ? 1 : 0);
|
||||
|
||||
const regexForGlob = parseGlobToRegex(globNormalized, {
|
||||
globstar: options.globstar,
|
||||
extglob: options.extglob,
|
||||
});
|
||||
|
||||
if (isNegative) {
|
||||
matchRegexesNegative.push(regexForGlob);
|
||||
} else {
|
||||
matchRegexes.push(regexForGlob);
|
||||
}
|
||||
|
||||
// Search for the "deepest" starting point in the filesystem that we can use to search the fs
|
||||
const startPath = getStartPath(globNormalized);
|
||||
const isRootPath = isRootGlob(startPath);
|
||||
const cwd = isRootPath ? '/' : options.cwd;
|
||||
const fullStartPath = path.join(cwd, startPath);
|
||||
try {
|
||||
const allDirEntsRelativeToCwd = await getAllDirentsRelativeToCwd(fullStartPath, {
|
||||
fs: options.fs,
|
||||
cwd,
|
||||
});
|
||||
|
||||
// N.B. `globEntries.push(...allDirEntsRelativeToCwd);` can give memory issues for large file trees
|
||||
globEntries = globEntries.concat(allDirEntsRelativeToCwd);
|
||||
} catch (e) {
|
||||
if (!options.suppressErrors) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: for perf, combine options checks instead of doing multiple filters and maps
|
||||
const matchedEntries = globEntries.filter(
|
||||
globEntry =>
|
||||
matchRegexes.some(globRe => globRe.test(globEntry.relativeToCwdPath)) &&
|
||||
!matchRegexesNegative.some(globReNeg => globReNeg.test(globEntry.relativeToCwdPath)),
|
||||
);
|
||||
|
||||
const res = postprocessOptions(matchedEntries, options);
|
||||
|
||||
// It could happen the fs changes with the next call, so we clear the cache
|
||||
getAllDirentsRelativeToCwd.clearCache();
|
||||
getAllDirentsFromStartPath.clearCache();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
optimisedGlob.disableCache = () => {
|
||||
isCacheEnabled = false;
|
||||
};
|
||||
|
||||
optimisedGlob.enableExperimentalFsGlob = () => {
|
||||
isExperimentalFsGlobEnabled = true;
|
||||
};
|
||||
|
||||
optimisedGlob.disableExperimentalFsGlob = () => {
|
||||
isExperimentalFsGlobEnabled = false;
|
||||
};
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "find-classes",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock__1279983111",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"gatherFilesConfig": {},
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"file": "./target-src/find-customelements/multiple.js",
|
||||
"result": [
|
||||
{
|
||||
"name": null,
|
||||
"isMixin": true,
|
||||
"superClasses": [
|
||||
{
|
||||
"name": "HTMLElement",
|
||||
"isMixin": false,
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "HTMLElement"
|
||||
}
|
||||
}
|
||||
],
|
||||
"members": {
|
||||
"props": [],
|
||||
"methods": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ExtendedOnTheFly",
|
||||
"isMixin": false,
|
||||
"superClasses": [
|
||||
{
|
||||
"name": null,
|
||||
"customElementsGetRef": "on-the-fly",
|
||||
"isMixin": false,
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"members": {
|
||||
"props": [],
|
||||
"methods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/match-subclasses/ExtendedComp.js",
|
||||
"result": [
|
||||
{
|
||||
"name": "ExtendedComp",
|
||||
"isMixin": false,
|
||||
"superClasses": [
|
||||
{
|
||||
"name": "MyCompMixin",
|
||||
"isMixin": true,
|
||||
"rootFile": {
|
||||
"file": "exporting-ref-project",
|
||||
"specifier": "[default]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "RefClass",
|
||||
"isMixin": false,
|
||||
"rootFile": {
|
||||
"file": "exporting-ref-project",
|
||||
"specifier": "RefClass"
|
||||
}
|
||||
}
|
||||
],
|
||||
"members": {
|
||||
"props": [
|
||||
{
|
||||
"name": "getterSetter",
|
||||
"accessType": "public",
|
||||
"kind": [
|
||||
"get",
|
||||
"set"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "staticGetterSetter",
|
||||
"accessType": "public",
|
||||
"static": true,
|
||||
"kind": [
|
||||
"get",
|
||||
"set"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "attributes",
|
||||
"accessType": "public",
|
||||
"static": true,
|
||||
"kind": [
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "styles",
|
||||
"accessType": "public",
|
||||
"static": true,
|
||||
"kind": [
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "updateComplete",
|
||||
"accessType": "public",
|
||||
"kind": [
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "localizeNamespaces",
|
||||
"accessType": "public",
|
||||
"static": true,
|
||||
"kind": [
|
||||
"get"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "slots",
|
||||
"accessType": "public",
|
||||
"kind": [
|
||||
"get"
|
||||
]
|
||||
}
|
||||
],
|
||||
"methods": [
|
||||
{
|
||||
"name": "method",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "_protectedMethod",
|
||||
"accessType": "protected"
|
||||
},
|
||||
{
|
||||
"name": "__privateMethod",
|
||||
"accessType": "private"
|
||||
},
|
||||
{
|
||||
"name": "$protectedMethod",
|
||||
"accessType": "protected"
|
||||
},
|
||||
{
|
||||
"name": "$$privateMethod",
|
||||
"accessType": "private"
|
||||
},
|
||||
{
|
||||
"name": "constructor",
|
||||
"accessType": "[n/a]",
|
||||
"isPartOfPlatformLifeCycle": true
|
||||
},
|
||||
{
|
||||
"name": "connectedCallback",
|
||||
"accessType": "public",
|
||||
"isPartOfPlatformLifeCycle": true
|
||||
},
|
||||
{
|
||||
"name": "disconnectedCallback",
|
||||
"accessType": "public",
|
||||
"isPartOfPlatformLifeCycle": true
|
||||
},
|
||||
{
|
||||
"name": "requestUpdate",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "createRenderRoot",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "render",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "updated",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "firstUpdated",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "update",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "shouldUpdate",
|
||||
"accessType": "public"
|
||||
},
|
||||
{
|
||||
"name": "onLocaleUpdated",
|
||||
"accessType": "public"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "find-customelements",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock__2080016337",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"gatherFilesConfig": {},
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"file": "./target-src/find-customelements/multiple.js",
|
||||
"result": [
|
||||
{
|
||||
"tagName": "ref-class",
|
||||
"constructorIdentifier": "RefClass",
|
||||
"rootFile": {
|
||||
"file": "exporting-ref-project",
|
||||
"specifier": "RefClass"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tagName": "extended-comp",
|
||||
"constructorIdentifier": "ExtendedComp",
|
||||
"rootFile": {
|
||||
"file": "./target-src/match-subclasses/ExtendedComp.js",
|
||||
"specifier": "ExtendedComp"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tagName": "on-the-fly",
|
||||
"constructorIdentifier": "[inline]",
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "[inline]"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "find-exports",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "exporting-ref-project_1.0.0__1983195885",
|
||||
"targetProject": {
|
||||
"mainEntry": "./index.js",
|
||||
"name": "exporting-ref-project",
|
||||
"version": "1.0.0",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"skipFileImports": false,
|
||||
"gatherFilesConfig": {},
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"file": "./index.js",
|
||||
"result": [
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "./ref-src/core.js",
|
||||
"normalizedSource": "./ref-src/core.js",
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "[default]",
|
||||
"rootFile": {
|
||||
"file": "./ref-src/core.js",
|
||||
"specifier": "[default]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"RefClass",
|
||||
"RefRenamedClass"
|
||||
],
|
||||
"localMap": [
|
||||
{
|
||||
"local": "RefClass",
|
||||
"exported": "RefRenamedClass"
|
||||
}
|
||||
],
|
||||
"source": "./ref-src/core.js",
|
||||
"normalizedSource": "./ref-src/core.js",
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "RefClass",
|
||||
"rootFile": {
|
||||
"file": "./ref-src/core.js",
|
||||
"specifier": "RefClass"
|
||||
}
|
||||
},
|
||||
{
|
||||
"currentFileSpecifier": "RefRenamedClass",
|
||||
"rootFile": {
|
||||
"file": "./ref-src/core.js",
|
||||
"specifier": "RefClass"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./not-imported.js",
|
||||
"result": [
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"notImported"
|
||||
],
|
||||
"localMap": [],
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "notImported",
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "notImported"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./ref-component.js",
|
||||
"result": [
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./ref-src/core.js",
|
||||
"result": [
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"RefClass"
|
||||
],
|
||||
"localMap": [],
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "RefClass",
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "RefClass"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "[default]",
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "[default]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./ref-src/folder/index.js",
|
||||
"result": [
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"resolvePathCorrect"
|
||||
],
|
||||
"localMap": [],
|
||||
"rootFileMap": [
|
||||
{
|
||||
"currentFileSpecifier": "resolvePathCorrect",
|
||||
"rootFile": {
|
||||
"file": "[current]",
|
||||
"specifier": "resolvePathCorrect"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"rootFileMap": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "find-imports",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock__843408924",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"keepInternalSources": false,
|
||||
"gatherFilesConfig": {},
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"file": "./target-src/find-customelements/multiple.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"RefClass"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/find-imports/all-notations.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"source": "imported/source",
|
||||
"normalizedSource": "imported/source"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "imported/source-a",
|
||||
"normalizedSource": "imported/source-a"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"b"
|
||||
],
|
||||
"source": "imported/source-b",
|
||||
"normalizedSource": "imported/source-b"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"c",
|
||||
"d"
|
||||
],
|
||||
"source": "imported/source-c",
|
||||
"normalizedSource": "imported/source-c"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]",
|
||||
"f",
|
||||
"g"
|
||||
],
|
||||
"source": "imported/source-d",
|
||||
"normalizedSource": "imported/source-d"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "my/source-e",
|
||||
"normalizedSource": "my/source-e"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "[variable]",
|
||||
"normalizedSource": "[variable]"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[*]"
|
||||
],
|
||||
"source": "imported/source-g",
|
||||
"normalizedSource": "imported/source-g"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/match-imports/deep-imports.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"RefClass"
|
||||
],
|
||||
"source": "exporting-ref-project/ref-src/core.js",
|
||||
"normalizedSource": "exporting-ref-project/ref-src/core.js"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "exporting-ref-project/ref-src/core.js",
|
||||
"normalizedSource": "exporting-ref-project/ref-src/core.js"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"nonMatched"
|
||||
],
|
||||
"source": "unknown-project/xyz.js",
|
||||
"normalizedSource": "unknown-project/xyz.js"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[file]"
|
||||
],
|
||||
"source": "exporting-ref-project/ref-component",
|
||||
"normalizedSource": "exporting-ref-project/ref-component"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"resolvePathCorrect"
|
||||
],
|
||||
"source": "exporting-ref-project/ref-src/folder",
|
||||
"normalizedSource": "exporting-ref-project/ref-src/folder"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[*]"
|
||||
],
|
||||
"source": "exporting-ref-project/ref-src/core.js",
|
||||
"normalizedSource": "exporting-ref-project/ref-src/core.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/match-imports/root-level-imports.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"RefClass"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"RefRenamedClass"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
},
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"nonMatched"
|
||||
],
|
||||
"source": "unknown-project",
|
||||
"normalizedSource": "unknown-project"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/match-subclasses/ExtendedComp.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"RefClass"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "./target-src/match-subclasses/internalProxy.js",
|
||||
"result": [
|
||||
{
|
||||
"importSpecifiers": [
|
||||
"[default]"
|
||||
],
|
||||
"source": "exporting-ref-project",
|
||||
"normalizedSource": "exporting-ref-project"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "match-imports",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock_+_exporting-ref-project_1.0.0__-1243953700",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"referenceProject": {
|
||||
"mainEntry": "./index.js",
|
||||
"name": "exporting-ref-project",
|
||||
"version": "1.0.0",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"gatherFilesConfig": {},
|
||||
"targetProjectResult": null,
|
||||
"referenceProjectResult": null,
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "[default]::./index.js::exporting-ref-project",
|
||||
"name": "[default]",
|
||||
"filePath": "./index.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/root-level-imports.js",
|
||||
"./target-src/match-subclasses/internalProxy.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "RefClass::./index.js::exporting-ref-project",
|
||||
"name": "RefClass",
|
||||
"filePath": "./index.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/find-customelements/multiple.js",
|
||||
"./target-src/match-imports/root-level-imports.js",
|
||||
"./target-src/match-subclasses/ExtendedComp.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "RefRenamedClass::./index.js::exporting-ref-project",
|
||||
"name": "RefRenamedClass",
|
||||
"filePath": "./index.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/root-level-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "[file]::./ref-component.js::exporting-ref-project",
|
||||
"name": "[file]",
|
||||
"filePath": "./ref-component.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/deep-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "RefClass::./ref-src/core.js::exporting-ref-project",
|
||||
"name": "RefClass",
|
||||
"filePath": "./ref-src/core.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/deep-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "[default]::./ref-src/core.js::exporting-ref-project",
|
||||
"name": "[default]",
|
||||
"filePath": "./ref-src/core.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/deep-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "[file]::./ref-src/core.js::exporting-ref-project",
|
||||
"name": "[file]",
|
||||
"filePath": "./ref-src/core.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/deep-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"id": "resolvePathCorrect::./ref-src/folder/index.js::exporting-ref-project",
|
||||
"name": "resolvePathCorrect",
|
||||
"filePath": "./ref-src/folder/index.js",
|
||||
"project": "exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
"./target-src/match-imports/deep-imports.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "match-paths",
|
||||
"requiredAst": "babel",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock_+_exporting-ref-project_1.0.0__698299465",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"referenceProject": {
|
||||
"mainEntry": "./index.js",
|
||||
"name": "exporting-ref-project",
|
||||
"version": "1.0.0",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"gatherFilesConfig": {},
|
||||
"prefix": null,
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"name": "[default]",
|
||||
"variable": {
|
||||
"from": "[default]",
|
||||
"to": "ExtendedComp",
|
||||
"paths": [
|
||||
{
|
||||
"from": "./index.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "./ref-src/core.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "exporting-ref-project/index.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "exporting-ref-project/ref-src/core.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "RefClass",
|
||||
"variable": {
|
||||
"from": "RefClass",
|
||||
"to": "ExtendedComp",
|
||||
"paths": [
|
||||
{
|
||||
"from": "./index.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "./ref-src/core.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "exporting-ref-project/index.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
},
|
||||
{
|
||||
"from": "exporting-ref-project/ref-src/core.js",
|
||||
"to": "./target-src/match-subclasses/ExtendedComp.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"from": "ref-component",
|
||||
"to": "extended-comp",
|
||||
"paths": [
|
||||
{
|
||||
"from": "./ref-component.js",
|
||||
"to": "./target-src/find-customelements/multiple.js"
|
||||
},
|
||||
{
|
||||
"from": "exporting-ref-project/ref-component.js",
|
||||
"to": "./target-src/find-customelements/multiple.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"meta": {
|
||||
"searchType": "ast-analyzer",
|
||||
"analyzerMeta": {
|
||||
"name": "match-subclasses",
|
||||
"requiredAst": "oxc",
|
||||
"identifier": "importing-target-project_0.0.2-target-mock_+_exporting-ref-project_1.0.0__-852415408",
|
||||
"targetProject": {
|
||||
"mainEntry": "./target-src/match-imports/root-level-imports.js",
|
||||
"name": "importing-target-project",
|
||||
"version": "0.0.2-target-mock",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"referenceProject": {
|
||||
"mainEntry": "./index.js",
|
||||
"name": "exporting-ref-project",
|
||||
"version": "1.0.0",
|
||||
"commitHash": "[not-a-git-root]"
|
||||
},
|
||||
"configuration": {
|
||||
"gatherFilesConfig": {},
|
||||
"skipCheckMatchCompatibility": false,
|
||||
"addSystemPathsInResult": false,
|
||||
"parser": "swc"
|
||||
}
|
||||
}
|
||||
},
|
||||
"queryOutput": [
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"name": "[default]",
|
||||
"project": "exporting-ref-project",
|
||||
"filePath": "./index.js",
|
||||
"id": "[default]::./index.js::exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
{
|
||||
"file": "./target-src/match-subclasses/ExtendedComp.js",
|
||||
"identifier": "ExtendedComp"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"exportSpecifier": {
|
||||
"name": "RefClass",
|
||||
"project": "exporting-ref-project",
|
||||
"filePath": "./index.js",
|
||||
"id": "RefClass::./index.js::exporting-ref-project"
|
||||
},
|
||||
"matchesPerProject": [
|
||||
{
|
||||
"project": "importing-target-project",
|
||||
"files": [
|
||||
{
|
||||
"file": "./target-src/match-subclasses/ExtendedComp.js",
|
||||
"identifier": "ExtendedComp"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -228,18 +228,18 @@ describe('Analyzer "find-exports"', async () => {
|
|||
]);
|
||||
expect(secondEntry.result[0].rootFileMap).to.deep.equal([
|
||||
{
|
||||
currentFileSpecifier: 'InBetweenComp',
|
||||
currentFileSpecifier: 'OriginalComp',
|
||||
rootFile: {
|
||||
file: './src/OriginalComp.js',
|
||||
file: '[current]',
|
||||
specifier: 'OriginalComp',
|
||||
},
|
||||
},
|
||||
]);
|
||||
expect(thirdEntry.result[0].rootFileMap).to.deep.equal([
|
||||
{
|
||||
currentFileSpecifier: 'OriginalComp',
|
||||
currentFileSpecifier: 'InBetweenComp',
|
||||
rootFile: {
|
||||
file: '[current]',
|
||||
file: './src/OriginalComp.js',
|
||||
specifier: 'OriginalComp',
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,416 +0,0 @@
|
|||
import path from 'path';
|
||||
import { globby } from 'globby';
|
||||
import { expect } from 'chai';
|
||||
// @ts-expect-error
|
||||
import mockFs from 'mock-fs';
|
||||
|
||||
import { optimisedGlob } from '../../../src/program/utils/optimised-glob.js';
|
||||
|
||||
const measurePerf = process.argv.includes('--measure-perf');
|
||||
|
||||
/**
|
||||
* @typedef {import('../../../src/program/utils/optimised-glob.js').FastGlobtions} FastGlobtions
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string|string[]} patterns
|
||||
* @param {Partial<FastGlobtions>} options
|
||||
* @returns {Promise<string[]>}
|
||||
*/
|
||||
async function runOptimisedGlobAndCheckGlobbyParity(patterns, options) {
|
||||
performance.mark('start-optimisedGlob');
|
||||
const optimisedGlobResult = await optimisedGlob(patterns, options);
|
||||
performance.mark('end-optimisedGlob');
|
||||
|
||||
performance.mark('start-globby');
|
||||
const globbyResult = await globby(patterns, options);
|
||||
performance.mark('end-globby');
|
||||
|
||||
if (measurePerf) {
|
||||
const optimisedGlobPerf = performance.measure(
|
||||
'optimisedGlob',
|
||||
'start-optimisedGlob',
|
||||
'end-optimisedGlob',
|
||||
);
|
||||
const globbyPerf = performance.measure('globby', 'start-globby', 'end-globby');
|
||||
console.debug(
|
||||
`optimisedGlob was ${
|
||||
globbyPerf.duration - optimisedGlobPerf.duration
|
||||
}ms quicker than globby.`,
|
||||
);
|
||||
}
|
||||
|
||||
expect(optimisedGlobResult).to.deep.equal(globbyResult);
|
||||
|
||||
return optimisedGlobResult;
|
||||
}
|
||||
|
||||
function runSuiteForOptimisedGlob() {
|
||||
describe('optimisedGlob', () => {
|
||||
const testCfg = {
|
||||
cwd: '/fakeFs',
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
const fakeFs = {
|
||||
'/fakeFs/my/folder/some/file.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/some/file.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/some/file.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/lvl3/some/file.js': 'content',
|
||||
'/fakeFs/my/folder/some/file.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/some/file.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/some/file.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/lvl3/some/file.d.ts': 'content',
|
||||
|
||||
'/fakeFs/my/folder/some/anotherFile.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/some/anotherFile.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/some/anotherFile.js': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/lvl3/some/anotherFile.js': 'content',
|
||||
'/fakeFs/my/folder/some/anotherFile.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/some/anotherFile.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/some/anotherFile.d.ts': 'content',
|
||||
'/fakeFs/my/folder/lvl1/lvl2/lvl3/some/anotherFile.d.ts': 'content',
|
||||
|
||||
'/fakeFs/my/.hiddenFile.js': 'content',
|
||||
'/fakeFs/my/.hiddenFolder/file.js': 'content',
|
||||
};
|
||||
mockFs(fakeFs);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
mockFs.restore();
|
||||
});
|
||||
|
||||
describe('Star patterns', () => {
|
||||
it('supports double asterisk like "my/folder/**/some/file.js" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'my/folder/**/some/file.js',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/some/file.js',
|
||||
'my/folder/lvl1/some/file.js',
|
||||
'my/folder/lvl1/lvl2/some/file.js',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/file.js',
|
||||
]);
|
||||
});
|
||||
|
||||
it('supports single asterisk like "my/folder/*/some/file.js" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'my/folder/*/some/file.js',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal(['my/folder/lvl1/some/file.js']);
|
||||
});
|
||||
|
||||
it('supports filenames like "my/folder/lvl1/some/*il*.js" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'my/folder/lvl1/some/*il*.js',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/lvl1/some/anotherFile.js',
|
||||
'my/folder/lvl1/some/file.js',
|
||||
]);
|
||||
});
|
||||
|
||||
it('supports globs starting with a star like "**/some/file.js" ', async () => {
|
||||
const filesDoubleStar = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'**/some/file.js',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(filesDoubleStar).to.deep.equal([
|
||||
'my/folder/some/file.js',
|
||||
'my/folder/lvl1/some/file.js',
|
||||
'my/folder/lvl1/lvl2/some/file.js',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/file.js',
|
||||
]);
|
||||
|
||||
const filesSingleStar = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'*/folder/some/file.js',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(filesSingleStar).to.deep.equal(['my/folder/some/file.js']);
|
||||
});
|
||||
|
||||
it('gives empty output when location does not exist" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/folder/**/some/file.js', {
|
||||
...testCfg,
|
||||
cwd: '/nonExisting/path', // this will not exist
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it('omits hidden files" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('*/*/*/*', testCfg);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/some/anotherFile.d.ts',
|
||||
'my/folder/some/anotherFile.js',
|
||||
'my/folder/some/file.d.ts',
|
||||
'my/folder/some/file.js',
|
||||
]);
|
||||
});
|
||||
|
||||
it('supports patterns like "my", "my/**" and "my/**/*" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/**', testCfg);
|
||||
|
||||
const allMy = [
|
||||
'my/folder/some/anotherFile.d.ts',
|
||||
'my/folder/some/anotherFile.js',
|
||||
'my/folder/some/file.d.ts',
|
||||
'my/folder/some/file.js',
|
||||
'my/folder/lvl1/some/anotherFile.d.ts',
|
||||
'my/folder/lvl1/some/anotherFile.js',
|
||||
'my/folder/lvl1/some/file.d.ts',
|
||||
'my/folder/lvl1/some/file.js',
|
||||
'my/folder/lvl1/lvl2/some/anotherFile.d.ts',
|
||||
'my/folder/lvl1/lvl2/some/anotherFile.js',
|
||||
'my/folder/lvl1/lvl2/some/file.d.ts',
|
||||
'my/folder/lvl1/lvl2/some/file.js',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/anotherFile.d.ts',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/anotherFile.js',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/file.d.ts',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/file.js',
|
||||
];
|
||||
|
||||
expect(files).to.deep.equal(allMy);
|
||||
|
||||
const files2 = await runOptimisedGlobAndCheckGlobbyParity('my/**/*', testCfg);
|
||||
|
||||
expect(files2).to.deep.equal(allMy);
|
||||
|
||||
// TODO: "my" (this will need a code change: preprocess 'my' to 'my/**')
|
||||
});
|
||||
});
|
||||
|
||||
describe('Accolade patterns', () => {
|
||||
it('works with filenames like "my/folder/*/some/file.{js,d.ts}" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'my/folder/*/some/file.{js,d.ts}',
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/lvl1/some/file.d.ts',
|
||||
'my/folder/lvl1/some/file.js',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Multiple globs', () => {
|
||||
it('accepts an array of globs, like ["my/folder/*/some/file.js", "my/folder/lvl1/*/some/file.js"]', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
['my/folder/*/some/file.js', 'my/folder/lvl1/*/some/file.js'],
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/lvl1/some/file.js',
|
||||
'my/folder/lvl1/lvl2/some/file.js',
|
||||
]);
|
||||
});
|
||||
|
||||
it('accepts negative globs, like ["my/folder/**/some/file.js", "!my/folder/*/some/file.js"]', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
['my/folder/**/some/file.js', '!my/folder/*/some/file.js'],
|
||||
testCfg,
|
||||
);
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/some/file.js',
|
||||
'my/folder/lvl1/lvl2/some/file.js',
|
||||
'my/folder/lvl1/lvl2/lvl3/some/file.js',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Options', () => {
|
||||
it('"absolute" returns full system paths', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'my/folder/*/some/file.{js,d.ts}',
|
||||
{
|
||||
...testCfg,
|
||||
absolute: true,
|
||||
},
|
||||
);
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
const driveLetter = path.win32.resolve(testCfg.cwd).slice(0, 1).toUpperCase();
|
||||
expect(files).to.deep.equal([
|
||||
`${driveLetter}:/fakeFs/my/folder/lvl1/some/file.d.ts`,
|
||||
`${driveLetter}:/fakeFs/my/folder/lvl1/some/file.js`,
|
||||
]);
|
||||
} else {
|
||||
expect(files).to.deep.equal([
|
||||
'/fakeFs/my/folder/lvl1/some/file.d.ts',
|
||||
'/fakeFs/my/folder/lvl1/some/file.js',
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
it('"cwd" changes relative starting point of glob', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('folder/*/some/file.{js,d.ts}', {
|
||||
...testCfg,
|
||||
cwd: '/fakeFs/my',
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal(['folder/lvl1/some/file.d.ts', 'folder/lvl1/some/file.js']);
|
||||
});
|
||||
|
||||
it('"onlyDirectories" returns only directories/folders', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/folder/*/some', {
|
||||
...testCfg,
|
||||
onlyDirectories: true,
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal(['my/folder/lvl1/some']);
|
||||
});
|
||||
|
||||
it('"onlyFiles" returns only files', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/folder/*/some', {
|
||||
...testCfg,
|
||||
onlyFiles: true,
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it('"deep" limits the level of results', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/folder/**', {
|
||||
...testCfg,
|
||||
onlyDirectories: true,
|
||||
deep: 1,
|
||||
});
|
||||
expect(files).to.deep.equal(['my/folder/lvl1', 'my/folder/some']);
|
||||
|
||||
const files2 = await runOptimisedGlobAndCheckGlobbyParity('my/folder/**', {
|
||||
...testCfg,
|
||||
onlyDirectories: true,
|
||||
deep: 2,
|
||||
});
|
||||
|
||||
expect(files2).to.deep.equal([
|
||||
'my/folder/lvl1',
|
||||
'my/folder/some',
|
||||
'my/folder/lvl1/lvl2',
|
||||
'my/folder/lvl1/some',
|
||||
]);
|
||||
});
|
||||
|
||||
it('"dot" allows hidden files" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('*/*', {
|
||||
...testCfg,
|
||||
dot: true,
|
||||
});
|
||||
expect(files).to.deep.equal(['my/.hiddenFile.js']);
|
||||
|
||||
const files2 = await runOptimisedGlobAndCheckGlobbyParity('*/*/*', {
|
||||
...testCfg,
|
||||
dot: true,
|
||||
});
|
||||
expect(files2).to.deep.equal(['my/.hiddenFolder/file.js']);
|
||||
});
|
||||
|
||||
it('"ignore" filters out files" ', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('**', {
|
||||
...testCfg,
|
||||
ignore: ['**/lvl1/**'],
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal([
|
||||
'my/folder/some/anotherFile.d.ts',
|
||||
'my/folder/some/anotherFile.js',
|
||||
'my/folder/some/file.d.ts',
|
||||
'my/folder/some/file.js',
|
||||
]);
|
||||
});
|
||||
|
||||
it.skip('"suppressErrors" throws errors when paths do not exist', async () => {
|
||||
expect(async () =>
|
||||
optimisedGlob('my/folder/**/some/file.js', {
|
||||
...testCfg,
|
||||
cwd: '/nonExisting/path', // this will not exist
|
||||
suppressErrors: false,
|
||||
}),
|
||||
).to.throw();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edge cases', () => {
|
||||
it('allows prefixing a system path (regardless of cwd)', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'/fakeFs/my/folder/*/some/file.{js,d.ts}',
|
||||
testCfg,
|
||||
);
|
||||
expect(files).to.deep.equal([
|
||||
'/fakeFs/my/folder/lvl1/some/file.d.ts',
|
||||
'/fakeFs/my/folder/lvl1/some/file.js',
|
||||
]);
|
||||
// With non-existing cwd
|
||||
const files2 = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
'/fakeFs/my/folder/*/some/file.{js,d.ts}',
|
||||
{
|
||||
...testCfg,
|
||||
cwd: '/nonExisting/path', // this will not exist
|
||||
},
|
||||
);
|
||||
expect(files2).to.deep.equal([
|
||||
'/fakeFs/my/folder/lvl1/some/file.d.ts',
|
||||
'/fakeFs/my/folder/lvl1/some/file.js',
|
||||
]);
|
||||
|
||||
// // With negative globs: this is not supported by globby
|
||||
// const files3 = await runOptimisedGlobAndCheckGlobbyParity(
|
||||
// ['!/fakeFs/my/**/*.d.ts', '/fakeFs/my/folder/*/some/file.{js,d.ts}'],
|
||||
// testCfg,
|
||||
// );
|
||||
// expect(files3).to.deep.equal(['/fakeFs/my/folder/lvl1/some/file.js']);
|
||||
});
|
||||
|
||||
it('starts from hidden folders', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('**/*', {
|
||||
...testCfg,
|
||||
cwd: '/fakeFs/my/.hiddenFolder',
|
||||
dot: true,
|
||||
});
|
||||
expect(files).to.deep.equal(['file.js']);
|
||||
});
|
||||
|
||||
it('supports cwd ending with "/"', async () => {
|
||||
const files = await runOptimisedGlobAndCheckGlobbyParity('my/folder/*/some/file.js', {
|
||||
...testCfg,
|
||||
cwd: '/fakeFs/',
|
||||
});
|
||||
|
||||
expect(files).to.deep.equal(['my/folder/lvl1/some/file.js']);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
runSuiteForOptimisedGlob();
|
||||
|
||||
describe('Native glob', () => {
|
||||
const [nodeMajor] = process.versions.node.split('.').map(Number);
|
||||
if (nodeMajor < 22) {
|
||||
console.warn('Skipping native glob tests because Node.js version is too low.');
|
||||
return;
|
||||
}
|
||||
|
||||
before(() => {
|
||||
optimisedGlob.enableExperimentalFsGlob();
|
||||
});
|
||||
|
||||
after(() => {
|
||||
optimisedGlob.disableExperimentalFsGlob();
|
||||
});
|
||||
|
||||
runSuiteForOptimisedGlob();
|
||||
});
|
||||
|
|
@ -11,9 +11,8 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
// @ts-expect-error
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { optimisedGlob as globby } from 'providence-analytics/utils.js';
|
||||
import { globby } from 'globby';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const packageRoot = fileURLToPath(new URL('../', import.meta.url));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { litSsrPlugin } from '@lit-labs/testing/web-test-runner-ssr-plugin.js';
|
||||
import { playwrightLauncher } from '@web/test-runner-playwright';
|
||||
import { optimisedGlob } from 'providence-analytics/utils.js';
|
||||
import { globby } from 'globby';
|
||||
|
||||
const config = {
|
||||
shouldLoadPolyfill: !process.argv.includes('--no-scoped-registries-polyfill'),
|
||||
|
|
@ -8,7 +8,7 @@ const config = {
|
|||
};
|
||||
|
||||
const groups = (
|
||||
await optimisedGlob(['packages/*/test', 'packages/ui/components/**/test'], {
|
||||
await globby(['packages/*/test', 'packages/ui/components/**/test'], {
|
||||
onlyDirectories: true,
|
||||
})
|
||||
) // @ts-expect-error [update-es-version-later]
|
||||
|
|
|
|||
Loading…
Reference in a new issue