@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
package/core/cache.d.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for cache creation.
|
|
3
|
+
*/
|
|
4
|
+
export interface CacheOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Time to live in milliseconds.
|
|
7
|
+
* Entries older than this will be considered expired.
|
|
8
|
+
*/
|
|
9
|
+
ttl?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum number of entries in cache.
|
|
12
|
+
* When exceeded, oldest entries are evicted (FIFO).
|
|
13
|
+
*/
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Cache interface for storing key-value pairs with optional TTL and size limits.
|
|
18
|
+
*/
|
|
19
|
+
export interface Cache<K, V> {
|
|
20
|
+
/**
|
|
21
|
+
* Get a value from the cache.
|
|
22
|
+
*
|
|
23
|
+
* @param key - Cache key
|
|
24
|
+
* @returns Cached value or undefined if not found or expired
|
|
25
|
+
*/
|
|
26
|
+
get(key: K): V | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Set a value in the cache.
|
|
29
|
+
*
|
|
30
|
+
* @param key - Cache key
|
|
31
|
+
* @param value - Value to cache
|
|
32
|
+
*/
|
|
33
|
+
set(key: K, value: V): void;
|
|
34
|
+
/**
|
|
35
|
+
* Check if a key exists in the cache (and is not expired).
|
|
36
|
+
*
|
|
37
|
+
* @param key - Cache key
|
|
38
|
+
* @returns True if key exists and is not expired
|
|
39
|
+
*/
|
|
40
|
+
has(key: K): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a key from the cache.
|
|
43
|
+
*
|
|
44
|
+
* @param key - Cache key
|
|
45
|
+
* @returns True if the key was deleted
|
|
46
|
+
*/
|
|
47
|
+
delete(key: K): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Clear all entries from the cache.
|
|
50
|
+
*/
|
|
51
|
+
clear(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Get the current number of entries in the cache.
|
|
54
|
+
*
|
|
55
|
+
* @returns Number of entries
|
|
56
|
+
*/
|
|
57
|
+
size(): number;
|
|
58
|
+
/**
|
|
59
|
+
* Get all keys in the cache.
|
|
60
|
+
*
|
|
61
|
+
* @returns Array of keys
|
|
62
|
+
*/
|
|
63
|
+
keys(): K[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create a cache with optional TTL and size limits.
|
|
67
|
+
*
|
|
68
|
+
* The cache provides a simple key-value store with:
|
|
69
|
+
* - Optional TTL (time-to-live) for automatic expiration
|
|
70
|
+
* - Optional maxSize for limiting cache size with FIFO eviction
|
|
71
|
+
* - Lazy expiration (entries are checked on access)
|
|
72
|
+
*
|
|
73
|
+
* @param options - Cache configuration options
|
|
74
|
+
* @returns Cache instance
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // Basic cache
|
|
79
|
+
* const cache = createCache<string, number>()
|
|
80
|
+
* cache.set('answer', 42)
|
|
81
|
+
* cache.get('answer') // 42
|
|
82
|
+
*
|
|
83
|
+
* // Cache with TTL (expires after 60 seconds)
|
|
84
|
+
* const ttlCache = createCache<string, object>({ ttl: 60000 })
|
|
85
|
+
*
|
|
86
|
+
* // Cache with max size (evicts oldest when full)
|
|
87
|
+
* const lruCache = createCache<string, object>({ maxSize: 100 })
|
|
88
|
+
*
|
|
89
|
+
* // Combined options
|
|
90
|
+
* const configCache = createCache<string, object>({
|
|
91
|
+
* ttl: 30000,
|
|
92
|
+
* maxSize: 50
|
|
93
|
+
* })
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function createCache<K, V>(options?: CacheOptions): Cache<K, V>;
|
|
97
|
+
/**
|
|
98
|
+
* Clear all registered caches.
|
|
99
|
+
*
|
|
100
|
+
* Useful for testing or when a global state reset is needed.
|
|
101
|
+
* This clears all caches created via `createCache()`.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* // In tests
|
|
106
|
+
* afterEach(() => {
|
|
107
|
+
* clearAllCaches()
|
|
108
|
+
* })
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function clearAllCaches(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Get the number of registered caches.
|
|
114
|
+
*
|
|
115
|
+
* Primarily used for testing.
|
|
116
|
+
*
|
|
117
|
+
* @returns Number of registered caches
|
|
118
|
+
*/
|
|
119
|
+
export declare function getCacheCount(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Unregister a cache from the global registry.
|
|
122
|
+
*
|
|
123
|
+
* Useful for cleanup in tests or when a cache is no longer needed.
|
|
124
|
+
*
|
|
125
|
+
* @param cache - Cache to unregister
|
|
126
|
+
* @returns True if cache was unregistered
|
|
127
|
+
*/
|
|
128
|
+
export declare function unregisterCache<K, V>(cache: Cache<K, V>): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Create a memoized version of a function with caching.
|
|
131
|
+
*
|
|
132
|
+
* The memoized function caches results based on the first argument (key).
|
|
133
|
+
* If additional arguments are needed, use the options.keyFn parameter.
|
|
134
|
+
*
|
|
135
|
+
* @param fn - Function to memoize
|
|
136
|
+
* @param options - Cache options for the underlying cache
|
|
137
|
+
* @returns Memoized function with cache control methods
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* // Memoize a detection function
|
|
142
|
+
* const detectTechStackMemo = memoize(
|
|
143
|
+
* (path: string) => expensiveDetection(path),
|
|
144
|
+
* { ttl: 60000 }
|
|
145
|
+
* )
|
|
146
|
+
*
|
|
147
|
+
* const result1 = detectTechStackMemo('/path/to/project')
|
|
148
|
+
* const result2 = detectTechStackMemo('/path/to/project') // Returns cached
|
|
149
|
+
*
|
|
150
|
+
* // Clear the cache
|
|
151
|
+
* detectTechStackMemo.cache.clear()
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function memoize<K, V>(fn: (key: K) => V, options?: CacheOptions): ((key: K) => V) & {
|
|
155
|
+
cache: Cache<K, V>;
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../libs/project-scope/src/core/cache.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;IAE1B;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IAE3B;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAA;IAEpB;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAA;IAEvB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAA;IAEb;;;;OAIG;IACH,IAAI,IAAI,MAAM,CAAA;IAEd;;;;OAIG;IACH,IAAI,IAAI,CAAC,EAAE,CAAA;CACZ;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CA2GrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAEjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAAE,CAsBjH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert content to UTF-8 string.
|
|
3
|
+
*
|
|
4
|
+
* @param content - Buffer or string content
|
|
5
|
+
* @param sourceEncoding - Source encoding (auto-detected if not provided)
|
|
6
|
+
* @returns UTF-8 string
|
|
7
|
+
*/
|
|
8
|
+
export declare function toUtf8(content: Buffer | string, sourceEncoding?: BufferEncoding): string;
|
|
9
|
+
/**
|
|
10
|
+
* Convert buffer to string with encoding detection.
|
|
11
|
+
*
|
|
12
|
+
* @param content - Buffer to convert
|
|
13
|
+
* @param encoding - Optional encoding override (auto-detected if not provided)
|
|
14
|
+
* @returns Converted string
|
|
15
|
+
* @throws {Error} If content is binary and cannot be converted
|
|
16
|
+
*/
|
|
17
|
+
export declare function bufferToString(content: Buffer, encoding?: BufferEncoding): string;
|
|
18
|
+
/**
|
|
19
|
+
* Strip BOM from start of string if present.
|
|
20
|
+
*
|
|
21
|
+
* @param content - String that may have BOM
|
|
22
|
+
* @returns String without BOM
|
|
23
|
+
*/
|
|
24
|
+
export declare function stripBom(content: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Add UTF-8 BOM to string if not present.
|
|
27
|
+
*
|
|
28
|
+
* @param content - String to add BOM to
|
|
29
|
+
* @returns String with BOM
|
|
30
|
+
*/
|
|
31
|
+
export declare function addBom(content: string): string;
|
|
32
|
+
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/encoding/convert.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,GAAE,cAAwB,GAAG,MAAM,CAKjG;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAsBjF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK9C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** UTF-8 BOM bytes */
|
|
2
|
+
export declare const UTF8_BOM_BYTES: readonly [239, 187, 191];
|
|
3
|
+
/** UTF-16 LE BOM bytes */
|
|
4
|
+
export declare const UTF16_LE_BOM_BYTES: readonly [255, 254];
|
|
5
|
+
/** UTF-16 BE BOM bytes */
|
|
6
|
+
export declare const UTF16_BE_BOM_BYTES: readonly [254, 255];
|
|
7
|
+
/** UTF-8 BOM string */
|
|
8
|
+
export declare const UTF8_BOM = "\uFEFF";
|
|
9
|
+
/**
|
|
10
|
+
* Common binary file signatures.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BINARY_SIGNATURES: readonly [{
|
|
13
|
+
readonly signature: readonly [137, 80, 78, 71];
|
|
14
|
+
readonly description: "PNG";
|
|
15
|
+
}, {
|
|
16
|
+
readonly signature: readonly [255, 216, 255];
|
|
17
|
+
readonly description: "JPEG";
|
|
18
|
+
}, {
|
|
19
|
+
readonly signature: readonly [71, 73, 70, 56];
|
|
20
|
+
readonly description: "GIF";
|
|
21
|
+
}, {
|
|
22
|
+
readonly signature: readonly [80, 75, 3, 4];
|
|
23
|
+
readonly description: "ZIP";
|
|
24
|
+
}, {
|
|
25
|
+
readonly signature: readonly [31, 139];
|
|
26
|
+
readonly description: "GZIP";
|
|
27
|
+
}, {
|
|
28
|
+
readonly signature: readonly [66, 90, 104];
|
|
29
|
+
readonly description: "BZIP2";
|
|
30
|
+
}, {
|
|
31
|
+
readonly signature: readonly [127, 69, 76, 70];
|
|
32
|
+
readonly description: "ELF";
|
|
33
|
+
}, {
|
|
34
|
+
readonly signature: readonly [77, 90];
|
|
35
|
+
readonly description: "EXE";
|
|
36
|
+
}, {
|
|
37
|
+
readonly signature: readonly [37, 80, 68, 70];
|
|
38
|
+
readonly description: "PDF";
|
|
39
|
+
}];
|
|
40
|
+
/**
|
|
41
|
+
* Encoding detection result.
|
|
42
|
+
*/
|
|
43
|
+
export type EncodingInfo = {
|
|
44
|
+
type: 'text';
|
|
45
|
+
encoding: BufferEncoding;
|
|
46
|
+
hasBom: boolean;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'binary';
|
|
49
|
+
format?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Detect if content is likely text or binary with encoding information.
|
|
53
|
+
*
|
|
54
|
+
* @param buffer - Buffer to analyze
|
|
55
|
+
* @returns Encoding information
|
|
56
|
+
*/
|
|
57
|
+
export declare function detectEncodingInfo(buffer: Buffer): EncodingInfo;
|
|
58
|
+
/**
|
|
59
|
+
* Detect file encoding from BOM or content analysis.
|
|
60
|
+
*
|
|
61
|
+
* @param buffer - Buffer to analyze
|
|
62
|
+
* @returns Detected encoding, defaults to 'utf-8'
|
|
63
|
+
*/
|
|
64
|
+
export declare function detectEncoding(buffer: Buffer): BufferEncoding;
|
|
65
|
+
/**
|
|
66
|
+
* Check if buffer starts with a BOM.
|
|
67
|
+
*
|
|
68
|
+
* @param buffer - Buffer to check
|
|
69
|
+
* @returns True if buffer has a BOM
|
|
70
|
+
*/
|
|
71
|
+
export declare function hasBom(buffer: Buffer): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Check if buffer represents text content.
|
|
74
|
+
*
|
|
75
|
+
* @param buffer - Buffer to check
|
|
76
|
+
* @returns True if the buffer appears to be text
|
|
77
|
+
*/
|
|
78
|
+
export declare function isTextFile(buffer: Buffer): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Check if buffer represents binary content.
|
|
81
|
+
*
|
|
82
|
+
* @param buffer - Buffer to check
|
|
83
|
+
* @returns True if the buffer appears to be binary
|
|
84
|
+
*/
|
|
85
|
+
export declare function isBinaryFile(buffer: Buffer): boolean;
|
|
86
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/project-scope/src/core/encoding/detect.ts"],"names":[],"mappings":"AAKA,sBAAsB;AACtB,eAAO,MAAM,cAAc,0BAA4B,CAAA;AAEvD,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB,qBAAsB,CAAA;AAErD,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB,qBAAsB,CAAA;AAErD,uBAAuB;AACvB,eAAO,MAAM,QAAQ,WAAW,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5H;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAmD/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAsB7D;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAiB9C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|