@hyperfrontend/project-scope 0.1.0
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/ARCHITECTURE.md +370 -0
- package/CHANGELOG.md +10 -0
- package/FUNDING.md +141 -0
- package/LICENSE.md +21 -0
- package/README.md +242 -0
- package/SECURITY.md +82 -0
- package/analyze.d.ts +33 -0
- package/analyze.d.ts.map +1 -0
- package/cli/commands/analyze.d.ts +20 -0
- package/cli/commands/analyze.d.ts.map +1 -0
- package/cli/commands/config.d.ts +20 -0
- package/cli/commands/config.d.ts.map +1 -0
- package/cli/commands/deps.d.ts +18 -0
- package/cli/commands/deps.d.ts.map +1 -0
- package/cli/commands/tree.d.ts +24 -0
- package/cli/commands/tree.d.ts.map +1 -0
- package/cli/index.cjs.js +6639 -0
- package/cli/index.cjs.js.map +1 -0
- package/cli/index.d.ts +7 -0
- package/cli/index.d.ts.map +1 -0
- package/cli/index.esm.js +6629 -0
- package/cli/index.esm.js.map +1 -0
- package/cli/run.d.ts +25 -0
- package/cli/run.d.ts.map +1 -0
- package/cli/types.d.ts +55 -0
- package/cli/types.d.ts.map +1 -0
- package/core/cache.d.ts +157 -0
- package/core/cache.d.ts.map +1 -0
- package/core/encoding/convert.d.ts +32 -0
- package/core/encoding/convert.d.ts.map +1 -0
- package/core/encoding/detect.d.ts +86 -0
- package/core/encoding/detect.d.ts.map +1 -0
- package/core/encoding/index.cjs.js +751 -0
- package/core/encoding/index.cjs.js.map +1 -0
- package/core/encoding/index.d.ts +3 -0
- package/core/encoding/index.d.ts.map +1 -0
- package/core/encoding/index.esm.js +736 -0
- package/core/encoding/index.esm.js.map +1 -0
- package/core/errors/structured-errors.d.ts +64 -0
- package/core/errors/structured-errors.d.ts.map +1 -0
- package/core/fs/directory.d.ts +88 -0
- package/core/fs/directory.d.ts.map +1 -0
- package/core/fs/index.cjs.js +1079 -0
- package/core/fs/index.cjs.js.map +1 -0
- package/core/fs/index.d.ts +6 -0
- package/core/fs/index.d.ts.map +1 -0
- package/core/fs/index.esm.js +1056 -0
- package/core/fs/index.esm.js.map +1 -0
- package/core/fs/read.d.ts +86 -0
- package/core/fs/read.d.ts.map +1 -0
- package/core/fs/stat.d.ts +58 -0
- package/core/fs/stat.d.ts.map +1 -0
- package/core/fs/traversal.d.ts +26 -0
- package/core/fs/traversal.d.ts.map +1 -0
- package/core/fs/write.d.ts +75 -0
- package/core/fs/write.d.ts.map +1 -0
- package/core/index.cjs.js +2376 -0
- package/core/index.cjs.js.map +1 -0
- package/core/index.d.ts +9 -0
- package/core/index.d.ts.map +1 -0
- package/core/index.esm.js +2286 -0
- package/core/index.esm.js.map +1 -0
- package/core/logger.d.ts +111 -0
- package/core/logger.d.ts.map +1 -0
- package/core/path/index.cjs.js +254 -0
- package/core/path/index.cjs.js.map +1 -0
- package/core/path/index.d.ts +5 -0
- package/core/path/index.d.ts.map +1 -0
- package/core/path/index.esm.js +233 -0
- package/core/path/index.esm.js.map +1 -0
- package/core/path/join.d.ts +17 -0
- package/core/path/join.d.ts.map +1 -0
- package/core/path/normalize.d.ts +37 -0
- package/core/path/normalize.d.ts.map +1 -0
- package/core/path/resolve.d.ts +52 -0
- package/core/path/resolve.d.ts.map +1 -0
- package/core/path/segments.d.ts +59 -0
- package/core/path/segments.d.ts.map +1 -0
- package/core/patterns/glob.d.ts +46 -0
- package/core/patterns/glob.d.ts.map +1 -0
- package/core/platform/detect.d.ts +66 -0
- package/core/platform/detect.d.ts.map +1 -0
- package/core/platform/index.cjs.js +241 -0
- package/core/platform/index.cjs.js.map +1 -0
- package/core/platform/index.d.ts +3 -0
- package/core/platform/index.d.ts.map +1 -0
- package/core/platform/index.esm.js +226 -0
- package/core/platform/index.esm.js.map +1 -0
- package/core/platform/line-endings.d.ts +48 -0
- package/core/platform/line-endings.d.ts.map +1 -0
- package/heuristics/dependencies/analyze.d.ts +77 -0
- package/heuristics/dependencies/analyze.d.ts.map +1 -0
- package/heuristics/dependencies/index.cjs.js +1126 -0
- package/heuristics/dependencies/index.cjs.js.map +1 -0
- package/heuristics/dependencies/index.d.ts +2 -0
- package/heuristics/dependencies/index.d.ts.map +1 -0
- package/heuristics/dependencies/index.esm.js +1122 -0
- package/heuristics/dependencies/index.esm.js.map +1 -0
- package/heuristics/entry-points/discover.d.ts +86 -0
- package/heuristics/entry-points/discover.d.ts.map +1 -0
- package/heuristics/entry-points/index.cjs.js +1581 -0
- package/heuristics/entry-points/index.cjs.js.map +1 -0
- package/heuristics/entry-points/index.d.ts +2 -0
- package/heuristics/entry-points/index.d.ts.map +1 -0
- package/heuristics/entry-points/index.esm.js +1577 -0
- package/heuristics/entry-points/index.esm.js.map +1 -0
- package/heuristics/framework/identify.d.ts +84 -0
- package/heuristics/framework/identify.d.ts.map +1 -0
- package/heuristics/framework/index.cjs.js +3618 -0
- package/heuristics/framework/index.cjs.js.map +1 -0
- package/heuristics/framework/index.d.ts +2 -0
- package/heuristics/framework/index.d.ts.map +1 -0
- package/heuristics/framework/index.esm.js +3614 -0
- package/heuristics/framework/index.esm.js.map +1 -0
- package/heuristics/index.cjs.js +4833 -0
- package/heuristics/index.cjs.js.map +1 -0
- package/heuristics/index.d.ts +5 -0
- package/heuristics/index.d.ts.map +1 -0
- package/heuristics/index.esm.js +4822 -0
- package/heuristics/index.esm.js.map +1 -0
- package/heuristics/project-type/detect.d.ts +61 -0
- package/heuristics/project-type/detect.d.ts.map +1 -0
- package/heuristics/project-type/index.cjs.js +3633 -0
- package/heuristics/project-type/index.cjs.js.map +1 -0
- package/heuristics/project-type/index.d.ts +2 -0
- package/heuristics/project-type/index.d.ts.map +1 -0
- package/heuristics/project-type/index.esm.js +3631 -0
- package/heuristics/project-type/index.esm.js.map +1 -0
- package/index.cjs.js +10255 -0
- package/index.cjs.js.map +1 -0
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.esm.js +10006 -0
- package/index.esm.js.map +1 -0
- package/models/index.cjs.js +3 -0
- package/models/index.cjs.js.map +1 -0
- package/models/index.d.ts +176 -0
- package/models/index.d.ts.map +1 -0
- package/models/index.esm.js +2 -0
- package/models/index.esm.js.map +1 -0
- package/nx/detect.d.ts +105 -0
- package/nx/detect.d.ts.map +1 -0
- package/nx/devkit-loader.d.ts +62 -0
- package/nx/devkit-loader.d.ts.map +1 -0
- package/nx/index.cjs.js +1302 -0
- package/nx/index.cjs.js.map +1 -0
- package/nx/index.d.ts +4 -0
- package/nx/index.d.ts.map +1 -0
- package/nx/index.esm.js +1286 -0
- package/nx/index.esm.js.map +1 -0
- package/nx/project-config.d.ts +109 -0
- package/nx/project-config.d.ts.map +1 -0
- package/package.json +218 -0
- package/project/config/detect.d.ts +77 -0
- package/project/config/detect.d.ts.map +1 -0
- package/project/config/index.cjs.js +1982 -0
- package/project/config/index.cjs.js.map +1 -0
- package/project/config/index.d.ts +4 -0
- package/project/config/index.d.ts.map +1 -0
- package/project/config/index.esm.js +1971 -0
- package/project/config/index.esm.js.map +1 -0
- package/project/config/parse.d.ts +53 -0
- package/project/config/parse.d.ts.map +1 -0
- package/project/config/patterns.d.ts +31 -0
- package/project/config/patterns.d.ts.map +1 -0
- package/project/index.cjs.js +2585 -0
- package/project/index.cjs.js.map +1 -0
- package/project/index.d.ts +5 -0
- package/project/index.d.ts.map +1 -0
- package/project/index.esm.js +2549 -0
- package/project/index.esm.js.map +1 -0
- package/project/package/dependencies.d.ts +101 -0
- package/project/package/dependencies.d.ts.map +1 -0
- package/project/package/index.cjs.js +972 -0
- package/project/package/index.cjs.js.map +1 -0
- package/project/package/index.d.ts +3 -0
- package/project/package/index.d.ts.map +1 -0
- package/project/package/index.esm.js +957 -0
- package/project/package/index.esm.js.map +1 -0
- package/project/package/read.d.ts +66 -0
- package/project/package/read.d.ts.map +1 -0
- package/project/root/detect.d.ts +65 -0
- package/project/root/detect.d.ts.map +1 -0
- package/project/root/index.cjs.js +860 -0
- package/project/root/index.cjs.js.map +1 -0
- package/project/root/index.d.ts +2 -0
- package/project/root/index.d.ts.map +1 -0
- package/project/root/index.esm.js +853 -0
- package/project/root/index.esm.js.map +1 -0
- package/project/traversal/index.cjs.js +1179 -0
- package/project/traversal/index.cjs.js.map +1 -0
- package/project/traversal/index.d.ts +3 -0
- package/project/traversal/index.d.ts.map +1 -0
- package/project/traversal/index.esm.js +1173 -0
- package/project/traversal/index.esm.js.map +1 -0
- package/project/traversal/search.d.ts +59 -0
- package/project/traversal/search.d.ts.map +1 -0
- package/project/traversal/walk.d.ts +63 -0
- package/project/traversal/walk.d.ts.map +1 -0
- package/tech/backend/detect-all.d.ts +13 -0
- package/tech/backend/detect-all.d.ts.map +1 -0
- package/tech/backend/express.d.ts +11 -0
- package/tech/backend/express.d.ts.map +1 -0
- package/tech/backend/fastify.d.ts +11 -0
- package/tech/backend/fastify.d.ts.map +1 -0
- package/tech/backend/hono.d.ts +11 -0
- package/tech/backend/hono.d.ts.map +1 -0
- package/tech/backend/index.cjs.js +939 -0
- package/tech/backend/index.cjs.js.map +1 -0
- package/tech/backend/index.d.ts +8 -0
- package/tech/backend/index.d.ts.map +1 -0
- package/tech/backend/index.esm.js +931 -0
- package/tech/backend/index.esm.js.map +1 -0
- package/tech/backend/koa.d.ts +11 -0
- package/tech/backend/koa.d.ts.map +1 -0
- package/tech/backend/nestjs.d.ts +11 -0
- package/tech/backend/nestjs.d.ts.map +1 -0
- package/tech/backend/types.d.ts +31 -0
- package/tech/backend/types.d.ts.map +1 -0
- package/tech/build/babel.d.ts +13 -0
- package/tech/build/babel.d.ts.map +1 -0
- package/tech/build/detect-all.d.ts +13 -0
- package/tech/build/detect-all.d.ts.map +1 -0
- package/tech/build/esbuild.d.ts +11 -0
- package/tech/build/esbuild.d.ts.map +1 -0
- package/tech/build/index.cjs.js +1118 -0
- package/tech/build/index.cjs.js.map +1 -0
- package/tech/build/index.d.ts +10 -0
- package/tech/build/index.d.ts.map +1 -0
- package/tech/build/index.esm.js +1102 -0
- package/tech/build/index.esm.js.map +1 -0
- package/tech/build/parcel.d.ts +13 -0
- package/tech/build/parcel.d.ts.map +1 -0
- package/tech/build/rollup.d.ts +13 -0
- package/tech/build/rollup.d.ts.map +1 -0
- package/tech/build/swc.d.ts +13 -0
- package/tech/build/swc.d.ts.map +1 -0
- package/tech/build/types.d.ts +31 -0
- package/tech/build/types.d.ts.map +1 -0
- package/tech/build/vite.d.ts +13 -0
- package/tech/build/vite.d.ts.map +1 -0
- package/tech/build/webpack.d.ts +13 -0
- package/tech/build/webpack.d.ts.map +1 -0
- package/tech/frontend/angular.d.ts +11 -0
- package/tech/frontend/angular.d.ts.map +1 -0
- package/tech/frontend/astro.d.ts +11 -0
- package/tech/frontend/astro.d.ts.map +1 -0
- package/tech/frontend/detect-all.d.ts +13 -0
- package/tech/frontend/detect-all.d.ts.map +1 -0
- package/tech/frontend/gatsby.d.ts +11 -0
- package/tech/frontend/gatsby.d.ts.map +1 -0
- package/tech/frontend/index.cjs.js +1310 -0
- package/tech/frontend/index.cjs.js.map +1 -0
- package/tech/frontend/index.d.ts +15 -0
- package/tech/frontend/index.d.ts.map +1 -0
- package/tech/frontend/index.esm.js +1295 -0
- package/tech/frontend/index.esm.js.map +1 -0
- package/tech/frontend/nextjs.d.ts +11 -0
- package/tech/frontend/nextjs.d.ts.map +1 -0
- package/tech/frontend/nuxt.d.ts +11 -0
- package/tech/frontend/nuxt.d.ts.map +1 -0
- package/tech/frontend/qwik.d.ts +11 -0
- package/tech/frontend/qwik.d.ts.map +1 -0
- package/tech/frontend/react.d.ts +11 -0
- package/tech/frontend/react.d.ts.map +1 -0
- package/tech/frontend/remix.d.ts +11 -0
- package/tech/frontend/remix.d.ts.map +1 -0
- package/tech/frontend/solid.d.ts +11 -0
- package/tech/frontend/solid.d.ts.map +1 -0
- package/tech/frontend/svelte.d.ts +11 -0
- package/tech/frontend/svelte.d.ts.map +1 -0
- package/tech/frontend/sveltekit.d.ts +11 -0
- package/tech/frontend/sveltekit.d.ts.map +1 -0
- package/tech/frontend/types.d.ts +35 -0
- package/tech/frontend/types.d.ts.map +1 -0
- package/tech/frontend/vue.d.ts +11 -0
- package/tech/frontend/vue.d.ts.map +1 -0
- package/tech/index.cjs.js +3684 -0
- package/tech/index.cjs.js.map +1 -0
- package/tech/index.d.ts +96 -0
- package/tech/index.d.ts.map +1 -0
- package/tech/index.esm.js +3603 -0
- package/tech/index.esm.js.map +1 -0
- package/tech/legacy/angularjs.d.ts +12 -0
- package/tech/legacy/angularjs.d.ts.map +1 -0
- package/tech/legacy/backbone.d.ts +11 -0
- package/tech/legacy/backbone.d.ts.map +1 -0
- package/tech/legacy/detect-all.d.ts +13 -0
- package/tech/legacy/detect-all.d.ts.map +1 -0
- package/tech/legacy/ember.d.ts +11 -0
- package/tech/legacy/ember.d.ts.map +1 -0
- package/tech/legacy/index.cjs.js +903 -0
- package/tech/legacy/index.cjs.js.map +1 -0
- package/tech/legacy/index.d.ts +7 -0
- package/tech/legacy/index.d.ts.map +1 -0
- package/tech/legacy/index.esm.js +896 -0
- package/tech/legacy/index.esm.js.map +1 -0
- package/tech/legacy/jquery.d.ts +11 -0
- package/tech/legacy/jquery.d.ts.map +1 -0
- package/tech/legacy/types.d.ts +33 -0
- package/tech/legacy/types.d.ts.map +1 -0
- package/tech/linting/biome.d.ts +11 -0
- package/tech/linting/biome.d.ts.map +1 -0
- package/tech/linting/detect-all.d.ts +13 -0
- package/tech/linting/detect-all.d.ts.map +1 -0
- package/tech/linting/eslint.d.ts +13 -0
- package/tech/linting/eslint.d.ts.map +1 -0
- package/tech/linting/index.cjs.js +992 -0
- package/tech/linting/index.cjs.js.map +1 -0
- package/tech/linting/index.d.ts +7 -0
- package/tech/linting/index.d.ts.map +1 -0
- package/tech/linting/index.esm.js +982 -0
- package/tech/linting/index.esm.js.map +1 -0
- package/tech/linting/prettier.d.ts +13 -0
- package/tech/linting/prettier.d.ts.map +1 -0
- package/tech/linting/stylelint.d.ts +13 -0
- package/tech/linting/stylelint.d.ts.map +1 -0
- package/tech/linting/types.d.ts +31 -0
- package/tech/linting/types.d.ts.map +1 -0
- package/tech/monorepo/detect-all.d.ts +13 -0
- package/tech/monorepo/detect-all.d.ts.map +1 -0
- package/tech/monorepo/index.cjs.js +1021 -0
- package/tech/monorepo/index.cjs.js.map +1 -0
- package/tech/monorepo/index.d.ts +10 -0
- package/tech/monorepo/index.d.ts.map +1 -0
- package/tech/monorepo/index.esm.js +1011 -0
- package/tech/monorepo/index.esm.js.map +1 -0
- package/tech/monorepo/lerna.d.ts +11 -0
- package/tech/monorepo/lerna.d.ts.map +1 -0
- package/tech/monorepo/npm-workspaces.d.ts +11 -0
- package/tech/monorepo/npm-workspaces.d.ts.map +1 -0
- package/tech/monorepo/nx.d.ts +11 -0
- package/tech/monorepo/nx.d.ts.map +1 -0
- package/tech/monorepo/pnpm-workspaces.d.ts +9 -0
- package/tech/monorepo/pnpm-workspaces.d.ts.map +1 -0
- package/tech/monorepo/rush.d.ts +11 -0
- package/tech/monorepo/rush.d.ts.map +1 -0
- package/tech/monorepo/turborepo.d.ts +11 -0
- package/tech/monorepo/turborepo.d.ts.map +1 -0
- package/tech/monorepo/types.d.ts +39 -0
- package/tech/monorepo/types.d.ts.map +1 -0
- package/tech/monorepo/yarn-workspaces.d.ts +11 -0
- package/tech/monorepo/yarn-workspaces.d.ts.map +1 -0
- package/tech/shared-utils/detector-helpers.d.ts +52 -0
- package/tech/shared-utils/detector-helpers.d.ts.map +1 -0
- package/tech/shared-utils/types.d.ts +41 -0
- package/tech/shared-utils/types.d.ts.map +1 -0
- package/tech/testing/cypress.d.ts +13 -0
- package/tech/testing/cypress.d.ts.map +1 -0
- package/tech/testing/detect-all.d.ts +13 -0
- package/tech/testing/detect-all.d.ts.map +1 -0
- package/tech/testing/index.cjs.js +1031 -0
- package/tech/testing/index.cjs.js.map +1 -0
- package/tech/testing/index.d.ts +8 -0
- package/tech/testing/index.d.ts.map +1 -0
- package/tech/testing/index.esm.js +1018 -0
- package/tech/testing/index.esm.js.map +1 -0
- package/tech/testing/jest.d.ts +13 -0
- package/tech/testing/jest.d.ts.map +1 -0
- package/tech/testing/mocha.d.ts +13 -0
- package/tech/testing/mocha.d.ts.map +1 -0
- package/tech/testing/playwright.d.ts +13 -0
- package/tech/testing/playwright.d.ts.map +1 -0
- package/tech/testing/types.d.ts +35 -0
- package/tech/testing/types.d.ts.map +1 -0
- package/tech/testing/vitest.d.ts +13 -0
- package/tech/testing/vitest.d.ts.map +1 -0
- package/tech/types/detectors.d.ts +67 -0
- package/tech/types/detectors.d.ts.map +1 -0
- package/tech/types/index.cjs.js +1045 -0
- package/tech/types/index.cjs.js.map +1 -0
- package/tech/types/index.d.ts +2 -0
- package/tech/types/index.d.ts.map +1 -0
- package/tech/types/index.esm.js +1039 -0
- package/tech/types/index.esm.js.map +1 -0
- package/vfs/commit.d.ts +32 -0
- package/vfs/commit.d.ts.map +1 -0
- package/vfs/diff.d.ts +73 -0
- package/vfs/diff.d.ts.map +1 -0
- package/vfs/factory.d.ts +37 -0
- package/vfs/factory.d.ts.map +1 -0
- package/vfs/fs-tree.d.ts +13 -0
- package/vfs/fs-tree.d.ts.map +1 -0
- package/vfs/index.cjs.js +1600 -0
- package/vfs/index.cjs.js.map +1 -0
- package/vfs/index.d.ts +6 -0
- package/vfs/index.d.ts.map +1 -0
- package/vfs/index.esm.js +1590 -0
- package/vfs/index.esm.js.map +1 -0
- package/vfs/types.d.ts +178 -0
- package/vfs/types.d.ts.map +1 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { join as join$1, posix, normalize, sep, isAbsolute as isAbsolute$1, relative, resolve, basename, dirname, extname, parse } from 'node:path';
|
|
2
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Join path segments.
|
|
6
|
+
* Uses platform-specific separators (e.g., / or \).
|
|
7
|
+
*
|
|
8
|
+
* @param paths - Path segments to join
|
|
9
|
+
* @returns Joined path
|
|
10
|
+
*/
|
|
11
|
+
function join(...paths) {
|
|
12
|
+
return join$1(...paths);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Join path segments using POSIX separators (/).
|
|
16
|
+
* Always uses forward slashes regardless of platform.
|
|
17
|
+
*
|
|
18
|
+
* @param paths - Path segments to join
|
|
19
|
+
* @returns Joined path with forward slashes
|
|
20
|
+
*/
|
|
21
|
+
function joinPosix(...paths) {
|
|
22
|
+
return posix.join(...paths);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Normalize path separators to forward slashes.
|
|
27
|
+
*
|
|
28
|
+
* @param filePath - Path to normalize
|
|
29
|
+
* @returns Normalized path with forward slashes
|
|
30
|
+
*/
|
|
31
|
+
function normalizePath(filePath) {
|
|
32
|
+
if (!filePath)
|
|
33
|
+
return '';
|
|
34
|
+
// Normalize path and convert backslashes to forward slashes
|
|
35
|
+
const normalized = normalize(filePath);
|
|
36
|
+
return sep === '\\' ? normalized.replace(/\\/g, '/') : normalized;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert path separators to forward slashes using POSIX style.
|
|
40
|
+
* Resolves `.` and `..` segments for cross-platform configuration.
|
|
41
|
+
*
|
|
42
|
+
* @param filePath - The input path to convert
|
|
43
|
+
* @returns Path with forward slashes and resolved segments
|
|
44
|
+
*/
|
|
45
|
+
function normalizeToForwardSlashes(filePath) {
|
|
46
|
+
if (!filePath)
|
|
47
|
+
return '';
|
|
48
|
+
return normalize(filePath).split(sep).join('/');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convert path to use the operating system's native separator.
|
|
52
|
+
*
|
|
53
|
+
* @param filePath - The input path to convert
|
|
54
|
+
* @returns Path with native separators (backslash on Windows, forward slash elsewhere)
|
|
55
|
+
*/
|
|
56
|
+
function normalizeToNative(filePath) {
|
|
57
|
+
if (!filePath)
|
|
58
|
+
return '';
|
|
59
|
+
return normalize(filePath.replace(/[/\\]/g, sep));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Strip any trailing forward or back slashes from a path.
|
|
63
|
+
*
|
|
64
|
+
* @param filePath - Path that may have trailing slashes
|
|
65
|
+
* @returns Path with trailing slashes removed
|
|
66
|
+
*/
|
|
67
|
+
function removeTrailingSlash(filePath) {
|
|
68
|
+
return filePath.replace(/[/\\]+$/, '');
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Append a forward slash to the path if not already present.
|
|
72
|
+
*
|
|
73
|
+
* @param filePath - Path to process
|
|
74
|
+
* @returns Path with trailing forward slash
|
|
75
|
+
*/
|
|
76
|
+
function ensureTrailingSlash(filePath) {
|
|
77
|
+
const normalized = removeTrailingSlash(filePath);
|
|
78
|
+
return normalized + '/';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Check if path exists.
|
|
83
|
+
*
|
|
84
|
+
* @param filePath - Path to check
|
|
85
|
+
* @returns True if path exists
|
|
86
|
+
*/
|
|
87
|
+
function exists(filePath) {
|
|
88
|
+
return existsSync(filePath);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Resolve path segments to an absolute path.
|
|
93
|
+
*
|
|
94
|
+
* @param segments - Path segments to resolve
|
|
95
|
+
* @returns Resolved absolute path with normalized separators
|
|
96
|
+
*/
|
|
97
|
+
function resolvePath(...segments) {
|
|
98
|
+
return normalizePath(resolve(...segments));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Resolve path relative to workspace root.
|
|
102
|
+
*
|
|
103
|
+
* @param workspaceRoot - Workspace root directory
|
|
104
|
+
* @param segments - Path segments relative to workspace
|
|
105
|
+
* @returns Resolved absolute path with normalized separators
|
|
106
|
+
*/
|
|
107
|
+
function resolveFromWorkspace(workspaceRoot, ...segments) {
|
|
108
|
+
return normalizePath(resolve(workspaceRoot, ...segments));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Resolve symlinks to real path.
|
|
112
|
+
*
|
|
113
|
+
* @param filePath - Path to resolve
|
|
114
|
+
* @returns Real path or null if path doesn't exist
|
|
115
|
+
*/
|
|
116
|
+
function resolveRealPath(filePath) {
|
|
117
|
+
if (!exists(filePath)) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
return normalizePath(realpathSync(filePath));
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Compute the normalized path from source directory to target.
|
|
129
|
+
*
|
|
130
|
+
* @param from - Source path (base directory)
|
|
131
|
+
* @param to - Target path to reach
|
|
132
|
+
* @returns Relative path from source to target with forward slashes
|
|
133
|
+
*/
|
|
134
|
+
function relativePath(from, to) {
|
|
135
|
+
return normalizePath(relative(from, to));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Join path segments.
|
|
139
|
+
*
|
|
140
|
+
* @param segments - Path segments to join
|
|
141
|
+
* @returns Joined path with normalized separators
|
|
142
|
+
*/
|
|
143
|
+
function joinPath(...segments) {
|
|
144
|
+
return normalizePath(join$1(...segments));
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if path is absolute.
|
|
148
|
+
*
|
|
149
|
+
* @param filePath - Path to check
|
|
150
|
+
* @returns True if path is absolute
|
|
151
|
+
*/
|
|
152
|
+
function isAbsolute(filePath) {
|
|
153
|
+
return isAbsolute$1(filePath);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Calculate offset from root (e.g., "../../../").
|
|
157
|
+
*
|
|
158
|
+
* @param filePath - Path to calculate offset for
|
|
159
|
+
* @returns Relative offset path (e.g., "../../")
|
|
160
|
+
*/
|
|
161
|
+
function offsetFromRoot(filePath) {
|
|
162
|
+
const segments = normalizePath(filePath).split('/').filter(Boolean);
|
|
163
|
+
if (segments.length === 0)
|
|
164
|
+
return '';
|
|
165
|
+
return segments.map(() => '..').join('/') + '/';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Split path into segments.
|
|
170
|
+
*
|
|
171
|
+
* @param filePath - Path to split
|
|
172
|
+
* @returns Array of path segments
|
|
173
|
+
*/
|
|
174
|
+
function pathSegments(filePath) {
|
|
175
|
+
return filePath.split(/[/\\]/).filter((segment) => segment.length > 0);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get basename of path.
|
|
179
|
+
*
|
|
180
|
+
* @param filePath - Path to extract basename from
|
|
181
|
+
* @param ext - Optional extension to strip
|
|
182
|
+
* @returns Basename of path
|
|
183
|
+
*/
|
|
184
|
+
function getBasename(filePath, ext) {
|
|
185
|
+
return basename(filePath, ext);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get directory name of path.
|
|
189
|
+
*
|
|
190
|
+
* @param filePath - Path to extract directory from
|
|
191
|
+
* @returns Directory name
|
|
192
|
+
*/
|
|
193
|
+
function getDirname(filePath) {
|
|
194
|
+
return normalizePath(dirname(filePath));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get file extension (including dot).
|
|
198
|
+
*
|
|
199
|
+
* @param filePath - Path to extract extension from
|
|
200
|
+
* @returns Extension including dot (e.g., '.ts')
|
|
201
|
+
*/
|
|
202
|
+
function getExtension(filePath) {
|
|
203
|
+
return extname(filePath);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get filename without extension.
|
|
207
|
+
*
|
|
208
|
+
* @param filePath - Path to extract name from
|
|
209
|
+
* @returns Filename without extension
|
|
210
|
+
*/
|
|
211
|
+
function getFileNameWithoutExtension(filePath) {
|
|
212
|
+
const parsed = parse(filePath);
|
|
213
|
+
return parsed.name;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Parse path into components.
|
|
217
|
+
*
|
|
218
|
+
* @param filePath - Path to parse
|
|
219
|
+
* @returns Parsed path components
|
|
220
|
+
*/
|
|
221
|
+
function parsePath(filePath) {
|
|
222
|
+
const parsed = parse(filePath);
|
|
223
|
+
return {
|
|
224
|
+
root: parsed.root,
|
|
225
|
+
dir: normalizePath(parsed.dir),
|
|
226
|
+
base: parsed.base,
|
|
227
|
+
ext: parsed.ext,
|
|
228
|
+
name: parsed.name,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export { ensureTrailingSlash, getBasename, getDirname, getExtension, getFileNameWithoutExtension, isAbsolute, join, joinPath, joinPosix, normalizePath, normalizeToForwardSlashes, normalizeToNative, offsetFromRoot, parsePath, pathSegments, relativePath, removeTrailingSlash, resolveFromWorkspace, resolvePath, resolveRealPath };
|
|
233
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../libs/project-scope/src/core/path/join.ts","../../../../../../../../../../libs/project-scope/src/core/path/normalize.ts","../../../../../../../../../../libs/project-scope/src/core/fs/stat.ts","../../../../../../../../../../libs/project-scope/src/core/path/resolve.ts","../../../../../../../../../../libs/project-scope/src/core/path/segments.ts"],"sourcesContent":[null,null,null,null,null],"names":["nodeJoin","join","nodeIsAbsolute"],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Join path segments.
|
|
3
|
+
* Uses platform-specific separators (e.g., / or \).
|
|
4
|
+
*
|
|
5
|
+
* @param paths - Path segments to join
|
|
6
|
+
* @returns Joined path
|
|
7
|
+
*/
|
|
8
|
+
export declare function join(...paths: string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Join path segments using POSIX separators (/).
|
|
11
|
+
* Always uses forward slashes regardless of platform.
|
|
12
|
+
*
|
|
13
|
+
* @param paths - Path segments to join
|
|
14
|
+
* @returns Joined path with forward slashes
|
|
15
|
+
*/
|
|
16
|
+
export declare function joinPosix(...paths: string[]): string;
|
|
17
|
+
//# sourceMappingURL=join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/path/join.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize path separators to forward slashes.
|
|
3
|
+
*
|
|
4
|
+
* @param filePath - Path to normalize
|
|
5
|
+
* @returns Normalized path with forward slashes
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizePath(filePath: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Convert path separators to forward slashes using POSIX style.
|
|
10
|
+
* Resolves `.` and `..` segments for cross-platform configuration.
|
|
11
|
+
*
|
|
12
|
+
* @param filePath - The input path to convert
|
|
13
|
+
* @returns Path with forward slashes and resolved segments
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeToForwardSlashes(filePath: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Convert path to use the operating system's native separator.
|
|
18
|
+
*
|
|
19
|
+
* @param filePath - The input path to convert
|
|
20
|
+
* @returns Path with native separators (backslash on Windows, forward slash elsewhere)
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeToNative(filePath: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Strip any trailing forward or back slashes from a path.
|
|
25
|
+
*
|
|
26
|
+
* @param filePath - Path that may have trailing slashes
|
|
27
|
+
* @returns Path with trailing slashes removed
|
|
28
|
+
*/
|
|
29
|
+
export declare function removeTrailingSlash(filePath: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Append a forward slash to the path if not already present.
|
|
32
|
+
*
|
|
33
|
+
* @param filePath - Path to process
|
|
34
|
+
* @returns Path with trailing forward slash
|
|
35
|
+
*/
|
|
36
|
+
export declare function ensureTrailingSlash(filePath: string): string;
|
|
37
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/path/normalize.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG5D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve path segments to an absolute path.
|
|
3
|
+
*
|
|
4
|
+
* @param segments - Path segments to resolve
|
|
5
|
+
* @returns Resolved absolute path with normalized separators
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolvePath(...segments: string[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve path relative to workspace root.
|
|
10
|
+
*
|
|
11
|
+
* @param workspaceRoot - Workspace root directory
|
|
12
|
+
* @param segments - Path segments relative to workspace
|
|
13
|
+
* @returns Resolved absolute path with normalized separators
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveFromWorkspace(workspaceRoot: string, ...segments: string[]): string;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve symlinks to real path.
|
|
18
|
+
*
|
|
19
|
+
* @param filePath - Path to resolve
|
|
20
|
+
* @returns Real path or null if path doesn't exist
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveRealPath(filePath: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Compute the normalized path from source directory to target.
|
|
25
|
+
*
|
|
26
|
+
* @param from - Source path (base directory)
|
|
27
|
+
* @param to - Target path to reach
|
|
28
|
+
* @returns Relative path from source to target with forward slashes
|
|
29
|
+
*/
|
|
30
|
+
export declare function relativePath(from: string, to: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Join path segments.
|
|
33
|
+
*
|
|
34
|
+
* @param segments - Path segments to join
|
|
35
|
+
* @returns Joined path with normalized separators
|
|
36
|
+
*/
|
|
37
|
+
export declare function joinPath(...segments: string[]): string;
|
|
38
|
+
/**
|
|
39
|
+
* Check if path is absolute.
|
|
40
|
+
*
|
|
41
|
+
* @param filePath - Path to check
|
|
42
|
+
* @returns True if path is absolute
|
|
43
|
+
*/
|
|
44
|
+
export declare function isAbsolute(filePath: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Calculate offset from root (e.g., "../../../").
|
|
47
|
+
*
|
|
48
|
+
* @param filePath - Path to calculate offset for
|
|
49
|
+
* @returns Relative offset path (e.g., "../../")
|
|
50
|
+
*/
|
|
51
|
+
export declare function offsetFromRoot(filePath: string): string;
|
|
52
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/path/resolve.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS/D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIvD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed path components.
|
|
3
|
+
*/
|
|
4
|
+
export interface ParsedPath {
|
|
5
|
+
/** Root of the path (e.g., "/" or "C:\\") */
|
|
6
|
+
root: string;
|
|
7
|
+
/** Directory name */
|
|
8
|
+
dir: string;
|
|
9
|
+
/** Base name with extension */
|
|
10
|
+
base: string;
|
|
11
|
+
/** File extension including dot */
|
|
12
|
+
ext: string;
|
|
13
|
+
/** File name without extension */
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Split path into segments.
|
|
18
|
+
*
|
|
19
|
+
* @param filePath - Path to split
|
|
20
|
+
* @returns Array of path segments
|
|
21
|
+
*/
|
|
22
|
+
export declare function pathSegments(filePath: string): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Get basename of path.
|
|
25
|
+
*
|
|
26
|
+
* @param filePath - Path to extract basename from
|
|
27
|
+
* @param ext - Optional extension to strip
|
|
28
|
+
* @returns Basename of path
|
|
29
|
+
*/
|
|
30
|
+
export declare function getBasename(filePath: string, ext?: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get directory name of path.
|
|
33
|
+
*
|
|
34
|
+
* @param filePath - Path to extract directory from
|
|
35
|
+
* @returns Directory name
|
|
36
|
+
*/
|
|
37
|
+
export declare function getDirname(filePath: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Get file extension (including dot).
|
|
40
|
+
*
|
|
41
|
+
* @param filePath - Path to extract extension from
|
|
42
|
+
* @returns Extension including dot (e.g., '.ts')
|
|
43
|
+
*/
|
|
44
|
+
export declare function getExtension(filePath: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Get filename without extension.
|
|
47
|
+
*
|
|
48
|
+
* @param filePath - Path to extract name from
|
|
49
|
+
* @returns Filename without extension
|
|
50
|
+
*/
|
|
51
|
+
export declare function getFileNameWithoutExtension(filePath: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Parse path into components.
|
|
54
|
+
*
|
|
55
|
+
* @param filePath - Path to parse
|
|
56
|
+
* @returns Parsed path components
|
|
57
|
+
*/
|
|
58
|
+
export declare function parsePath(filePath: string): ParsedPath;
|
|
59
|
+
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/path/segments.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAStD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern matching utilities with ReDoS protection.
|
|
3
|
+
* Uses character-by-character matching instead of regex where possible.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Match path against glob pattern using safe character iteration.
|
|
7
|
+
* Avoids regex to prevent ReDoS attacks.
|
|
8
|
+
*
|
|
9
|
+
* Supported patterns:
|
|
10
|
+
* - * matches any characters except /
|
|
11
|
+
* - ** matches any characters including /
|
|
12
|
+
* - ? matches exactly one character except /
|
|
13
|
+
* - {a,b,c} matches any of the alternatives
|
|
14
|
+
*
|
|
15
|
+
* @param path - The filesystem path to test against the pattern
|
|
16
|
+
* @param pattern - The glob pattern to match against
|
|
17
|
+
* @returns True if path matches pattern
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { matchGlobPattern } from '@hyperfrontend/project-scope'
|
|
22
|
+
*
|
|
23
|
+
* matchGlobPattern('src/utils/helper.ts', '\*\*\/*.ts') // true
|
|
24
|
+
* matchGlobPattern('test.spec.ts', '\*.spec.ts') // true
|
|
25
|
+
* matchGlobPattern('config.json', '\*.{json,yaml}') // true
|
|
26
|
+
* matchGlobPattern('src/index.ts', 'src/\*.ts') // true
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function matchGlobPattern(path: string, pattern: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Test if path matches any of the patterns.
|
|
32
|
+
*
|
|
33
|
+
* @param path - Path to test
|
|
34
|
+
* @param patterns - Array of glob patterns
|
|
35
|
+
* @returns True if path matches any pattern
|
|
36
|
+
*/
|
|
37
|
+
export declare function matchesAnyPattern(path: string, patterns: readonly string[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Test if path exactly matches the pattern (no glob).
|
|
40
|
+
*
|
|
41
|
+
* @param path - Path to test
|
|
42
|
+
* @param pattern - Exact pattern to match
|
|
43
|
+
* @returns True if path equals pattern
|
|
44
|
+
*/
|
|
45
|
+
export declare function matchesExact(path: string, pattern: string): boolean;
|
|
46
|
+
//# sourceMappingURL=glob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/patterns/glob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvE;AA2LD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEpF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform information.
|
|
3
|
+
*/
|
|
4
|
+
export interface PlatformInfo {
|
|
5
|
+
/** Operating system */
|
|
6
|
+
os: 'darwin' | 'linux' | 'win32' | 'freebsd' | 'sunos' | 'aix' | 'other';
|
|
7
|
+
/** CPU architecture */
|
|
8
|
+
arch: string;
|
|
9
|
+
/** Node.js version */
|
|
10
|
+
nodeVersion: string;
|
|
11
|
+
/** Is Windows */
|
|
12
|
+
isWindows: boolean;
|
|
13
|
+
/** Is macOS */
|
|
14
|
+
isMac: boolean;
|
|
15
|
+
/** Is Linux */
|
|
16
|
+
isLinux: boolean;
|
|
17
|
+
/** File system case sensitivity */
|
|
18
|
+
caseSensitive: boolean;
|
|
19
|
+
/** Path separator for platform */
|
|
20
|
+
pathSeparator: '/' | '\\';
|
|
21
|
+
/** Line ending for platform */
|
|
22
|
+
lineEnding: '\n' | '\r\n';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Detect if file system is case sensitive.
|
|
26
|
+
*
|
|
27
|
+
* @returns True if file system is case-sensitive
|
|
28
|
+
*/
|
|
29
|
+
export declare function detectCaseSensitivity(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check if file system is case-sensitive.
|
|
32
|
+
*
|
|
33
|
+
* @returns True if file system is case-sensitive
|
|
34
|
+
*/
|
|
35
|
+
export declare function isCaseSensitiveFs(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Get comprehensive platform information.
|
|
38
|
+
*
|
|
39
|
+
* @returns Platform information object (cached after first call)
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPlatformInfo(): PlatformInfo;
|
|
42
|
+
/**
|
|
43
|
+
* Detect current platform.
|
|
44
|
+
*
|
|
45
|
+
* @returns Platform information object
|
|
46
|
+
*/
|
|
47
|
+
export declare function detectPlatform(): PlatformInfo;
|
|
48
|
+
/**
|
|
49
|
+
* Check if running on Windows.
|
|
50
|
+
*
|
|
51
|
+
* @returns True if running on Windows
|
|
52
|
+
*/
|
|
53
|
+
export declare function isWindows(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Check if running on macOS.
|
|
56
|
+
*
|
|
57
|
+
* @returns True if running on macOS
|
|
58
|
+
*/
|
|
59
|
+
export declare function isMac(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Check if running on Linux.
|
|
62
|
+
*
|
|
63
|
+
* @returns True if running on Linux
|
|
64
|
+
*/
|
|
65
|
+
export declare function isLinux(): boolean;
|
|
66
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/platform/detect.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAA;IACxE,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,sBAAsB;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe;IACf,KAAK,EAAE,OAAO,CAAA;IACd,eAAe;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,mCAAmC;IACnC,aAAa,EAAE,OAAO,CAAA;IACtB,kCAAkC;IAClC,aAAa,EAAE,GAAG,GAAG,IAAI,CAAA;IACzB,+BAA+B;IAC/B,UAAU,EAAE,IAAI,GAAG,MAAM,CAAA;CAC1B;AAYD;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CA6C/C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CA6C9C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,YAAY,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC"}
|