@warlock.js/core 3.0.40 → 4.0.1
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/cjs/code-quality/config.js +1 -7
- package/cjs/code-quality/config.js.map +1 -1
- package/cjs/code-quality/issue-tracker.js +1 -119
- package/cjs/code-quality/issue-tracker.js.map +1 -1
- package/cjs/dev2-server/config-handlers.d.ts +8 -0
- package/cjs/dev2-server/config-handlers.d.ts.map +1 -0
- package/cjs/dev2-server/config-handlers.js +56 -0
- package/cjs/dev2-server/config-handlers.js.map +1 -0
- package/cjs/dev2-server/config-loader.d.ts +61 -0
- package/cjs/dev2-server/config-loader.d.ts.map +1 -0
- package/cjs/dev2-server/config-loader.js +117 -0
- package/cjs/dev2-server/config-loader.js.map +1 -0
- package/cjs/dev2-server/connectors/base-connector.d.ts +49 -0
- package/cjs/dev2-server/connectors/base-connector.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/base-connector.js +48 -0
- package/cjs/dev2-server/connectors/base-connector.js.map +1 -0
- package/cjs/dev2-server/connectors/cache-connector.d.ts +23 -0
- package/cjs/dev2-server/connectors/cache-connector.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/cache-connector.js +35 -0
- package/cjs/dev2-server/connectors/cache-connector.js.map +1 -0
- package/cjs/dev2-server/connectors/database-connector.d.ts +23 -0
- package/cjs/dev2-server/connectors/database-connector.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/database-connector.js +42 -0
- package/cjs/dev2-server/connectors/database-connector.js.map +1 -0
- package/cjs/dev2-server/connectors/http-connector.d.ts +29 -0
- package/cjs/dev2-server/connectors/http-connector.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/http-connector.js +71 -0
- package/cjs/dev2-server/connectors/http-connector.js.map +1 -0
- package/cjs/dev2-server/connectors/index.d.ts +10 -0
- package/cjs/dev2-server/connectors/index.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/types.d.ts +49 -0
- package/cjs/dev2-server/connectors/types.d.ts.map +1 -0
- package/cjs/dev2-server/connectors/types.js +9 -0
- package/cjs/dev2-server/connectors/types.js.map +1 -0
- package/cjs/dev2-server/dependency-graph.d.ts +86 -0
- package/cjs/dev2-server/dependency-graph.d.ts.map +1 -0
- package/cjs/dev2-server/dependency-graph.js +225 -0
- package/cjs/dev2-server/dependency-graph.js.map +1 -0
- package/cjs/dev2-server/dev-logger.d.ts +14 -0
- package/cjs/dev2-server/dev-logger.d.ts.map +1 -0
- package/cjs/dev2-server/dev-logger.js +117 -0
- package/cjs/dev2-server/dev-logger.js.map +1 -0
- package/cjs/dev2-server/development-server.d.ts +97 -0
- package/cjs/dev2-server/development-server.d.ts.map +1 -0
- package/cjs/dev2-server/development-server.js +212 -0
- package/cjs/dev2-server/development-server.js.map +1 -0
- package/cjs/dev2-server/events.d.ts +5 -0
- package/cjs/dev2-server/events.d.ts.map +1 -0
- package/cjs/dev2-server/events.js +4 -0
- package/cjs/dev2-server/events.js.map +1 -0
- package/cjs/dev2-server/file-event-handler.d.ts +58 -0
- package/cjs/dev2-server/file-event-handler.d.ts.map +1 -0
- package/cjs/dev2-server/file-event-handler.js +140 -0
- package/cjs/dev2-server/file-event-handler.js.map +1 -0
- package/cjs/dev2-server/file-manager.d.ts +110 -0
- package/cjs/dev2-server/file-manager.d.ts.map +1 -0
- package/cjs/dev2-server/file-manager.js +314 -0
- package/cjs/dev2-server/file-manager.js.map +1 -0
- package/cjs/dev2-server/file-operations.d.ts +54 -0
- package/cjs/dev2-server/file-operations.d.ts.map +1 -0
- package/cjs/dev2-server/file-operations.js +191 -0
- package/cjs/dev2-server/file-operations.js.map +1 -0
- package/cjs/dev2-server/files-orchestrator.d.ts +88 -0
- package/cjs/dev2-server/files-orchestrator.d.ts.map +1 -0
- package/cjs/dev2-server/files-orchestrator.js +271 -0
- package/cjs/dev2-server/files-orchestrator.js.map +1 -0
- package/cjs/dev2-server/files-watcher.d.ts +53 -0
- package/cjs/dev2-server/files-watcher.d.ts.map +1 -0
- package/cjs/dev2-server/files-watcher.js +88 -0
- package/cjs/dev2-server/files-watcher.js.map +1 -0
- package/cjs/dev2-server/flags.d.ts +10 -0
- package/cjs/dev2-server/flags.d.ts.map +1 -0
- package/cjs/dev2-server/flags.js +9 -0
- package/cjs/dev2-server/flags.js.map +1 -0
- package/cjs/dev2-server/health-checker.d.ts +3 -0
- package/cjs/dev2-server/health-checker.d.ts.map +1 -0
- package/cjs/dev2-server/health-checker.js +2 -0
- package/cjs/dev2-server/health-checker.js.map +1 -0
- package/cjs/dev2-server/import-transformer.d.ts +16 -0
- package/cjs/dev2-server/import-transformer.d.ts.map +1 -0
- package/cjs/dev2-server/import-transformer.js +219 -0
- package/cjs/dev2-server/import-transformer.js.map +1 -0
- package/cjs/dev2-server/index.d.ts +1 -0
- package/cjs/dev2-server/index.d.ts.map +1 -0
- package/cjs/dev2-server/layer-executor.d.ts +64 -0
- package/cjs/dev2-server/layer-executor.d.ts.map +1 -0
- package/cjs/dev2-server/layer-executor.js +287 -0
- package/cjs/dev2-server/layer-executor.js.map +1 -0
- package/cjs/dev2-server/manifest-manager.d.ts +80 -0
- package/cjs/dev2-server/manifest-manager.d.ts.map +1 -0
- package/cjs/dev2-server/manifest-manager.js +107 -0
- package/cjs/dev2-server/manifest-manager.js.map +1 -0
- package/cjs/dev2-server/module-loader.d.ts +100 -0
- package/cjs/dev2-server/module-loader.d.ts.map +1 -0
- package/cjs/dev2-server/module-loader.js +229 -0
- package/cjs/dev2-server/module-loader.js.map +1 -0
- package/cjs/dev2-server/package-json-manager.d.ts +16 -0
- package/cjs/dev2-server/package-json-manager.d.ts.map +1 -0
- package/cjs/dev2-server/package-json-manager.js +20 -0
- package/cjs/dev2-server/package-json-manager.js.map +1 -0
- package/cjs/dev2-server/parse-imports.d.ts +8 -0
- package/cjs/dev2-server/parse-imports.d.ts.map +1 -0
- package/cjs/dev2-server/parse-imports.js +268 -0
- package/cjs/dev2-server/parse-imports.js.map +1 -0
- package/cjs/dev2-server/path.d.ts +39 -0
- package/cjs/dev2-server/path.d.ts.map +1 -0
- package/cjs/dev2-server/path.js +56 -0
- package/cjs/dev2-server/path.js.map +1 -0
- package/cjs/dev2-server/runtime-import-helper.d.ts +9 -0
- package/cjs/dev2-server/runtime-import-helper.d.ts.map +1 -0
- package/cjs/dev2-server/runtime-import-helper.js +79 -0
- package/cjs/dev2-server/runtime-import-helper.js.map +1 -0
- package/cjs/dev2-server/special-files-collector.d.ts +114 -0
- package/cjs/dev2-server/special-files-collector.d.ts.map +1 -0
- package/cjs/dev2-server/special-files-collector.js +212 -0
- package/cjs/dev2-server/special-files-collector.js.map +1 -0
- package/cjs/dev2-server/start-development-server.d.ts +7 -0
- package/cjs/dev2-server/start-development-server.d.ts.map +1 -0
- package/cjs/dev2-server/start-development-server.js +21 -0
- package/cjs/dev2-server/start-development-server.js.map +1 -0
- package/cjs/dev2-server/transpile-file.d.ts +6 -0
- package/cjs/dev2-server/transpile-file.d.ts.map +1 -0
- package/cjs/dev2-server/transpile-file.js +14 -0
- package/cjs/dev2-server/transpile-file.js.map +1 -0
- package/cjs/dev2-server/tsconfig-manager.d.ts +45 -0
- package/cjs/dev2-server/tsconfig-manager.d.ts.map +1 -0
- package/cjs/dev2-server/tsconfig-manager.js +104 -0
- package/cjs/dev2-server/tsconfig-manager.js.map +1 -0
- package/cjs/dev2-server/types.d.ts +16 -0
- package/cjs/dev2-server/types.d.ts.map +1 -0
- package/cjs/dev2-server/utils.d.ts +8 -0
- package/cjs/dev2-server/utils.d.ts.map +1 -0
- package/cjs/dev2-server/utils.js +28 -0
- package/cjs/dev2-server/utils.js.map +1 -0
- package/cjs/router/router.d.ts +14 -8
- package/cjs/router/router.d.ts.map +1 -1
- package/cjs/router/router.js +77 -35
- package/cjs/router/router.js.map +1 -1
- package/cjs/router/types.d.ts +8 -0
- package/cjs/router/types.d.ts.map +1 -1
- package/cjs/starters/start-cli-server.js +1 -1
- package/cjs/starters/start-cli-server.js.map +1 -1
- package/cjs/starters/start-http-server.d.ts.map +1 -1
- package/cjs/starters/start-http-server.js +4 -99
- package/cjs/starters/start-http-server.js.map +1 -1
- package/esm/code-quality/config.js +1 -7
- package/esm/code-quality/config.js.map +1 -1
- package/esm/code-quality/issue-tracker.js +1 -119
- package/esm/code-quality/issue-tracker.js.map +1 -1
- package/esm/dev2-server/config-handlers.d.ts +8 -0
- package/esm/dev2-server/config-handlers.d.ts.map +1 -0
- package/esm/dev2-server/config-handlers.js +56 -0
- package/esm/dev2-server/config-handlers.js.map +1 -0
- package/esm/dev2-server/config-loader.d.ts +61 -0
- package/esm/dev2-server/config-loader.d.ts.map +1 -0
- package/esm/dev2-server/config-loader.js +117 -0
- package/esm/dev2-server/config-loader.js.map +1 -0
- package/esm/dev2-server/connectors/base-connector.d.ts +49 -0
- package/esm/dev2-server/connectors/base-connector.d.ts.map +1 -0
- package/esm/dev2-server/connectors/base-connector.js +48 -0
- package/esm/dev2-server/connectors/base-connector.js.map +1 -0
- package/esm/dev2-server/connectors/cache-connector.d.ts +23 -0
- package/esm/dev2-server/connectors/cache-connector.d.ts.map +1 -0
- package/esm/dev2-server/connectors/cache-connector.js +35 -0
- package/esm/dev2-server/connectors/cache-connector.js.map +1 -0
- package/esm/dev2-server/connectors/database-connector.d.ts +23 -0
- package/esm/dev2-server/connectors/database-connector.d.ts.map +1 -0
- package/esm/dev2-server/connectors/database-connector.js +42 -0
- package/esm/dev2-server/connectors/database-connector.js.map +1 -0
- package/esm/dev2-server/connectors/http-connector.d.ts +29 -0
- package/esm/dev2-server/connectors/http-connector.d.ts.map +1 -0
- package/esm/dev2-server/connectors/http-connector.js +71 -0
- package/esm/dev2-server/connectors/http-connector.js.map +1 -0
- package/esm/dev2-server/connectors/index.d.ts +10 -0
- package/esm/dev2-server/connectors/index.d.ts.map +1 -0
- package/esm/dev2-server/connectors/types.d.ts +49 -0
- package/esm/dev2-server/connectors/types.d.ts.map +1 -0
- package/esm/dev2-server/connectors/types.js +9 -0
- package/esm/dev2-server/connectors/types.js.map +1 -0
- package/esm/dev2-server/dependency-graph.d.ts +86 -0
- package/esm/dev2-server/dependency-graph.d.ts.map +1 -0
- package/esm/dev2-server/dependency-graph.js +225 -0
- package/esm/dev2-server/dependency-graph.js.map +1 -0
- package/esm/dev2-server/dev-logger.d.ts +14 -0
- package/esm/dev2-server/dev-logger.d.ts.map +1 -0
- package/esm/dev2-server/dev-logger.js +117 -0
- package/esm/dev2-server/dev-logger.js.map +1 -0
- package/esm/dev2-server/development-server.d.ts +97 -0
- package/esm/dev2-server/development-server.d.ts.map +1 -0
- package/esm/dev2-server/development-server.js +212 -0
- package/esm/dev2-server/development-server.js.map +1 -0
- package/esm/dev2-server/events.d.ts +5 -0
- package/esm/dev2-server/events.d.ts.map +1 -0
- package/esm/dev2-server/events.js +4 -0
- package/esm/dev2-server/events.js.map +1 -0
- package/esm/dev2-server/file-event-handler.d.ts +58 -0
- package/esm/dev2-server/file-event-handler.d.ts.map +1 -0
- package/esm/dev2-server/file-event-handler.js +140 -0
- package/esm/dev2-server/file-event-handler.js.map +1 -0
- package/esm/dev2-server/file-manager.d.ts +110 -0
- package/esm/dev2-server/file-manager.d.ts.map +1 -0
- package/esm/dev2-server/file-manager.js +314 -0
- package/esm/dev2-server/file-manager.js.map +1 -0
- package/esm/dev2-server/file-operations.d.ts +54 -0
- package/esm/dev2-server/file-operations.d.ts.map +1 -0
- package/esm/dev2-server/file-operations.js +191 -0
- package/esm/dev2-server/file-operations.js.map +1 -0
- package/esm/dev2-server/files-orchestrator.d.ts +88 -0
- package/esm/dev2-server/files-orchestrator.d.ts.map +1 -0
- package/esm/dev2-server/files-orchestrator.js +271 -0
- package/esm/dev2-server/files-orchestrator.js.map +1 -0
- package/esm/dev2-server/files-watcher.d.ts +53 -0
- package/esm/dev2-server/files-watcher.d.ts.map +1 -0
- package/esm/dev2-server/files-watcher.js +88 -0
- package/esm/dev2-server/files-watcher.js.map +1 -0
- package/esm/dev2-server/flags.d.ts +10 -0
- package/esm/dev2-server/flags.d.ts.map +1 -0
- package/esm/dev2-server/flags.js +9 -0
- package/esm/dev2-server/flags.js.map +1 -0
- package/esm/dev2-server/health-checker.d.ts +3 -0
- package/esm/dev2-server/health-checker.d.ts.map +1 -0
- package/esm/dev2-server/health-checker.js +2 -0
- package/esm/dev2-server/health-checker.js.map +1 -0
- package/esm/dev2-server/import-transformer.d.ts +16 -0
- package/esm/dev2-server/import-transformer.d.ts.map +1 -0
- package/esm/dev2-server/import-transformer.js +219 -0
- package/esm/dev2-server/import-transformer.js.map +1 -0
- package/esm/dev2-server/index.d.ts +1 -0
- package/esm/dev2-server/index.d.ts.map +1 -0
- package/esm/dev2-server/layer-executor.d.ts +64 -0
- package/esm/dev2-server/layer-executor.d.ts.map +1 -0
- package/esm/dev2-server/layer-executor.js +287 -0
- package/esm/dev2-server/layer-executor.js.map +1 -0
- package/esm/dev2-server/manifest-manager.d.ts +80 -0
- package/esm/dev2-server/manifest-manager.d.ts.map +1 -0
- package/esm/dev2-server/manifest-manager.js +107 -0
- package/esm/dev2-server/manifest-manager.js.map +1 -0
- package/esm/dev2-server/module-loader.d.ts +100 -0
- package/esm/dev2-server/module-loader.d.ts.map +1 -0
- package/esm/dev2-server/module-loader.js +229 -0
- package/esm/dev2-server/module-loader.js.map +1 -0
- package/esm/dev2-server/package-json-manager.d.ts +16 -0
- package/esm/dev2-server/package-json-manager.d.ts.map +1 -0
- package/esm/dev2-server/package-json-manager.js +20 -0
- package/esm/dev2-server/package-json-manager.js.map +1 -0
- package/esm/dev2-server/parse-imports.d.ts +8 -0
- package/esm/dev2-server/parse-imports.d.ts.map +1 -0
- package/esm/dev2-server/parse-imports.js +268 -0
- package/esm/dev2-server/parse-imports.js.map +1 -0
- package/esm/dev2-server/path.d.ts +39 -0
- package/esm/dev2-server/path.d.ts.map +1 -0
- package/esm/dev2-server/path.js +56 -0
- package/esm/dev2-server/path.js.map +1 -0
- package/esm/dev2-server/runtime-import-helper.d.ts +9 -0
- package/esm/dev2-server/runtime-import-helper.d.ts.map +1 -0
- package/esm/dev2-server/runtime-import-helper.js +79 -0
- package/esm/dev2-server/runtime-import-helper.js.map +1 -0
- package/esm/dev2-server/special-files-collector.d.ts +114 -0
- package/esm/dev2-server/special-files-collector.d.ts.map +1 -0
- package/esm/dev2-server/special-files-collector.js +212 -0
- package/esm/dev2-server/special-files-collector.js.map +1 -0
- package/esm/dev2-server/start-development-server.d.ts +7 -0
- package/esm/dev2-server/start-development-server.d.ts.map +1 -0
- package/esm/dev2-server/start-development-server.js +21 -0
- package/esm/dev2-server/start-development-server.js.map +1 -0
- package/esm/dev2-server/transpile-file.d.ts +6 -0
- package/esm/dev2-server/transpile-file.d.ts.map +1 -0
- package/esm/dev2-server/transpile-file.js +14 -0
- package/esm/dev2-server/transpile-file.js.map +1 -0
- package/esm/dev2-server/tsconfig-manager.d.ts +45 -0
- package/esm/dev2-server/tsconfig-manager.d.ts.map +1 -0
- package/esm/dev2-server/tsconfig-manager.js +104 -0
- package/esm/dev2-server/tsconfig-manager.js.map +1 -0
- package/esm/dev2-server/types.d.ts +16 -0
- package/esm/dev2-server/types.d.ts.map +1 -0
- package/esm/dev2-server/utils.d.ts +8 -0
- package/esm/dev2-server/utils.d.ts.map +1 -0
- package/esm/dev2-server/utils.js +28 -0
- package/esm/dev2-server/utils.js.map +1 -0
- package/esm/router/router.d.ts +14 -8
- package/esm/router/router.d.ts.map +1 -1
- package/esm/router/router.js +78 -36
- package/esm/router/router.js.map +1 -1
- package/esm/router/types.d.ts +8 -0
- package/esm/router/types.d.ts.map +1 -1
- package/esm/starters/start-cli-server.js +1 -1
- package/esm/starters/start-cli-server.js.map +1 -1
- package/esm/starters/start-http-server.d.ts.map +1 -1
- package/esm/starters/start-http-server.js +4 -99
- package/esm/starters/start-http-server.js.map +1 -1
- package/package.json +3 -3
- package/cjs/code-quality/checkers/eslint-checker.js +0 -39
- package/cjs/code-quality/checkers/eslint-checker.js.map +0 -1
- package/cjs/code-quality/checkers/typescript-checker.js +0 -76
- package/cjs/code-quality/checkers/typescript-checker.js.map +0 -1
- package/cjs/code-quality/formatters/eslint-formatter.js +0 -56
- package/cjs/code-quality/formatters/eslint-formatter.js.map +0 -1
- package/cjs/code-quality/formatters/summary-formatter.js +0 -102
- package/cjs/code-quality/formatters/summary-formatter.js.map +0 -1
- package/cjs/code-quality/formatters/typescript-formatter.js +0 -64
- package/cjs/code-quality/formatters/typescript-formatter.js.map +0 -1
- package/cjs/code-quality/project-scanner.js +0 -78
- package/cjs/code-quality/project-scanner.js.map +0 -1
- package/cjs/code-quality/single-file-checker.js +0 -153
- package/cjs/code-quality/single-file-checker.js.map +0 -1
- package/cjs/starters/http-server-starter.js +0 -34
- package/cjs/starters/http-server-starter.js.map +0 -1
- package/cjs/utils/internal.js +0 -3
- package/cjs/utils/internal.js.map +0 -1
- package/esm/code-quality/checkers/eslint-checker.js +0 -39
- package/esm/code-quality/checkers/eslint-checker.js.map +0 -1
- package/esm/code-quality/checkers/typescript-checker.js +0 -76
- package/esm/code-quality/checkers/typescript-checker.js.map +0 -1
- package/esm/code-quality/formatters/eslint-formatter.js +0 -56
- package/esm/code-quality/formatters/eslint-formatter.js.map +0 -1
- package/esm/code-quality/formatters/summary-formatter.js +0 -102
- package/esm/code-quality/formatters/summary-formatter.js.map +0 -1
- package/esm/code-quality/formatters/typescript-formatter.js +0 -64
- package/esm/code-quality/formatters/typescript-formatter.js.map +0 -1
- package/esm/code-quality/project-scanner.js +0 -78
- package/esm/code-quality/project-scanner.js.map +0 -1
- package/esm/code-quality/single-file-checker.js +0 -153
- package/esm/code-quality/single-file-checker.js.map +0 -1
- package/esm/starters/http-server-starter.js +0 -34
- package/esm/starters/http-server-starter.js.map +0 -1
- package/esm/utils/internal.js +0 -3
- package/esm/utils/internal.js.map +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import {fileExistsAsync,isDirectoryAsync,fileExists}from'@mongez/fs';import {parse}from'es-module-lexer';import path from'node:path';import {Path}from'./path.js';import {tsconfigManager}from'./tsconfig-manager.js';/**
|
|
2
|
+
* Extract import paths using regex (more reliable for TypeScript)
|
|
3
|
+
* This is a fallback when es-module-lexer fails
|
|
4
|
+
*/
|
|
5
|
+
function extractImportPathsWithRegex(source) {
|
|
6
|
+
const imports = [];
|
|
7
|
+
const seenPaths = new Set();
|
|
8
|
+
// Skip type-only imports
|
|
9
|
+
const skipTypeOnlyImports = (line) => {
|
|
10
|
+
const trimmed = line.trim();
|
|
11
|
+
return (trimmed.startsWith("import type ") ||
|
|
12
|
+
!!trimmed.match(/import\s+type\s+\{/));
|
|
13
|
+
};
|
|
14
|
+
// Pattern 1: Standard ES module imports - look for "from" followed by quoted string
|
|
15
|
+
// Also handle side-effect imports: import "path"
|
|
16
|
+
const lines = source.split("\n");
|
|
17
|
+
for (let i = 0; i < lines.length; i++) {
|
|
18
|
+
const line = lines[i];
|
|
19
|
+
const trimmed = line.trim();
|
|
20
|
+
// Skip type-only imports
|
|
21
|
+
if (skipTypeOnlyImports(trimmed)) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
// Match: ... from "path" or ... from 'path'
|
|
25
|
+
const fromMatch = trimmed.match(/\s+from\s+['"]([^'"]+)['"]/);
|
|
26
|
+
if (fromMatch && trimmed.startsWith("import")) {
|
|
27
|
+
const importPath = fromMatch[1];
|
|
28
|
+
if (importPath && !seenPaths.has(importPath)) {
|
|
29
|
+
seenPaths.add(importPath);
|
|
30
|
+
imports.push({
|
|
31
|
+
path: importPath,
|
|
32
|
+
originalLine: line,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
// Match: import "path" (side-effect imports)
|
|
38
|
+
const sideEffectMatch = trimmed.match(/^import\s+['"]([^'"]+)['"]/);
|
|
39
|
+
if (sideEffectMatch) {
|
|
40
|
+
const importPath = sideEffectMatch[1];
|
|
41
|
+
if (importPath && !seenPaths.has(importPath)) {
|
|
42
|
+
seenPaths.add(importPath);
|
|
43
|
+
imports.push({
|
|
44
|
+
path: importPath,
|
|
45
|
+
originalLine: line,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Pattern 2: Dynamic imports - import("path")
|
|
51
|
+
const dynamicImportPattern = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
52
|
+
let match;
|
|
53
|
+
while ((match = dynamicImportPattern.exec(source)) !== null) {
|
|
54
|
+
const importPath = match[1];
|
|
55
|
+
if (importPath && !seenPaths.has(importPath)) {
|
|
56
|
+
seenPaths.add(importPath);
|
|
57
|
+
imports.push({
|
|
58
|
+
path: importPath,
|
|
59
|
+
originalLine: match[0],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Pattern 3: Export from - export ... from "path"
|
|
64
|
+
const exportFromPattern = /export\s+(?:\{[^}]*\}|\*|\w+)\s+from\s+['"]([^'"]+)['"]/g;
|
|
65
|
+
while ((match = exportFromPattern.exec(source)) !== null) {
|
|
66
|
+
const importPath = match[1];
|
|
67
|
+
if (importPath && !seenPaths.has(importPath)) {
|
|
68
|
+
seenPaths.add(importPath);
|
|
69
|
+
imports.push({
|
|
70
|
+
path: importPath,
|
|
71
|
+
originalLine: match[0],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return imports;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* This function will transpile the given ts/tsx code to js code
|
|
79
|
+
* // also it will return the dependencies of the file
|
|
80
|
+
*
|
|
81
|
+
* @returns Map of originalImportPath -> resolvedAbsolutePath
|
|
82
|
+
*/
|
|
83
|
+
async function parseImports(source, filePath) {
|
|
84
|
+
try {
|
|
85
|
+
// Skip .d.ts files - they're type declarations, not runtime code
|
|
86
|
+
if (filePath.endsWith(".d.ts")) {
|
|
87
|
+
return new Map();
|
|
88
|
+
}
|
|
89
|
+
// Try es-module-lexer first (faster and more accurate for simple cases)
|
|
90
|
+
try {
|
|
91
|
+
const [imports] = await parse(source);
|
|
92
|
+
if (imports && imports.length > 0) {
|
|
93
|
+
return await resolveImports(imports, filePath);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (lexerError) {
|
|
97
|
+
// es-module-lexer failed, fall back to regex-based extraction
|
|
98
|
+
// This is common with TypeScript files that have complex syntax
|
|
99
|
+
}
|
|
100
|
+
// Fallback: Use regex-based extraction (more forgiving with TypeScript)
|
|
101
|
+
const regexImports = extractImportPathsWithRegex(source);
|
|
102
|
+
const resolvedImports = new Map();
|
|
103
|
+
for (const { path: importPath } of regexImports) {
|
|
104
|
+
// Skip node built-ins and external packages
|
|
105
|
+
if (isNodeBuiltin(importPath)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
// Skip external node_modules packages (not starting with . or alias)
|
|
109
|
+
if (!importPath.startsWith(".") && !tsconfigManager.isAlias(importPath)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
let resolvedPath = null;
|
|
113
|
+
// Handle alias imports
|
|
114
|
+
if (tsconfigManager.isAlias(importPath)) {
|
|
115
|
+
resolvedPath = await resolveAliasImport(importPath);
|
|
116
|
+
}
|
|
117
|
+
else if (importPath.startsWith(".")) {
|
|
118
|
+
// Handle relative imports
|
|
119
|
+
resolvedPath = await resolveRelativeImport(importPath, filePath);
|
|
120
|
+
}
|
|
121
|
+
if (resolvedPath) {
|
|
122
|
+
resolvedImports.set(importPath, resolvedPath);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return resolvedImports;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.error(`Error parsing imports for ${filePath}:`, error);
|
|
129
|
+
return new Map();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function resolveImports(imports, filePath) {
|
|
133
|
+
const resolvedImports = new Map();
|
|
134
|
+
for (const imp of imports) {
|
|
135
|
+
const importPath = imp.n;
|
|
136
|
+
if (!importPath)
|
|
137
|
+
continue;
|
|
138
|
+
// Skip node built-ins and external packages
|
|
139
|
+
if (isNodeBuiltin(importPath)) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
// Skip external node_modules packages (not starting with . or alias)
|
|
143
|
+
if (!importPath.startsWith(".") && !tsconfigManager.isAlias(importPath)) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
let resolvedPath = null;
|
|
147
|
+
// Handle alias imports (e.g., app/users/services/get-users.service)
|
|
148
|
+
if (tsconfigManager.isAlias(importPath)) {
|
|
149
|
+
resolvedPath = await resolveAliasImport(importPath);
|
|
150
|
+
}
|
|
151
|
+
else if (importPath.startsWith(".")) {
|
|
152
|
+
// Handle relative imports (e.g., ./../services/get-user.service)
|
|
153
|
+
resolvedPath = await resolveRelativeImport(importPath, filePath);
|
|
154
|
+
}
|
|
155
|
+
if (resolvedPath) {
|
|
156
|
+
// Store mapping: original import path -> resolved absolute path
|
|
157
|
+
resolvedImports.set(importPath, resolvedPath);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return resolvedImports;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Resolve alias imports to actual file paths with extensions
|
|
164
|
+
* Example: app/users/services/get-users.service -> /absolute/path/to/src/app/users/services/get-users.service.ts
|
|
165
|
+
*/
|
|
166
|
+
async function resolveAliasImport(importPath) {
|
|
167
|
+
// Use tsconfig manager to resolve the alias to an absolute path
|
|
168
|
+
const resolvedBase = tsconfigManager.resolveAliasToAbsolute(importPath);
|
|
169
|
+
if (!resolvedBase)
|
|
170
|
+
return null;
|
|
171
|
+
// Try to resolve with extensions
|
|
172
|
+
const resolvedPath = await tryResolveWithExtensions(resolvedBase);
|
|
173
|
+
return resolvedPath;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Resolve relative imports to actual file paths
|
|
177
|
+
* Example: ./../services/get-user.service -> /absolute/path/to/services/get-user.service.ts
|
|
178
|
+
*/
|
|
179
|
+
async function resolveRelativeImport(importPath, currentFilePath) {
|
|
180
|
+
const dir = path.dirname(currentFilePath);
|
|
181
|
+
// Use path.resolve to handle .. and . properly, then normalize to forward slashes
|
|
182
|
+
const resolvedBase = Path.normalize(path.resolve(dir, importPath));
|
|
183
|
+
// Try to resolve with extensions
|
|
184
|
+
const resolvedPath = await tryResolveWithExtensions(resolvedBase);
|
|
185
|
+
return resolvedPath;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Try to resolve a file path by checking different extensions
|
|
189
|
+
* TypeScript/JavaScript files can be imported without extensions
|
|
190
|
+
*
|
|
191
|
+
* @TODO: For better performance, we need to check the files in files orchestrator
|
|
192
|
+
* instead of using the file system as we will be fetching all project files anyway.
|
|
193
|
+
*/
|
|
194
|
+
async function tryResolveWithExtensions(basePath) {
|
|
195
|
+
// Normalize the base path first (handle Windows paths)
|
|
196
|
+
const normalizedBase = Path.normalize(basePath);
|
|
197
|
+
// List of extensions to try, in order of preference
|
|
198
|
+
const extensions = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"];
|
|
199
|
+
const validExtensions = new Set(extensions);
|
|
200
|
+
// If the path already has a VALID code file extension, check if it exists
|
|
201
|
+
const ext = path.extname(normalizedBase);
|
|
202
|
+
if (ext && validExtensions.has(ext)) {
|
|
203
|
+
if (await fileExistsAsync(normalizedBase)) {
|
|
204
|
+
return normalizedBase;
|
|
205
|
+
}
|
|
206
|
+
// If explicit extension doesn't exist, return null
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
// Try each extension (even if there's already a non-code extension like .service or .repository)
|
|
210
|
+
for (const extension of extensions) {
|
|
211
|
+
const pathWithExt = normalizedBase + extension;
|
|
212
|
+
if (await fileExistsAsync(pathWithExt)) {
|
|
213
|
+
return pathWithExt;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// Try index files in directory
|
|
217
|
+
if (await isDirectoryAsync(normalizedBase)) {
|
|
218
|
+
for (const extension of extensions) {
|
|
219
|
+
const indexPath = Path.join(normalizedBase, `index${extension}`);
|
|
220
|
+
if (await fileExists(indexPath)) {
|
|
221
|
+
return indexPath;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Check if import is a Node.js built-in module
|
|
229
|
+
*/
|
|
230
|
+
function isNodeBuiltin(importPath) {
|
|
231
|
+
const builtins = [
|
|
232
|
+
"fs",
|
|
233
|
+
"path",
|
|
234
|
+
"http",
|
|
235
|
+
"https",
|
|
236
|
+
"crypto",
|
|
237
|
+
"stream",
|
|
238
|
+
"util",
|
|
239
|
+
"events",
|
|
240
|
+
"buffer",
|
|
241
|
+
"child_process",
|
|
242
|
+
"os",
|
|
243
|
+
"url",
|
|
244
|
+
"querystring",
|
|
245
|
+
"zlib",
|
|
246
|
+
"net",
|
|
247
|
+
"tls",
|
|
248
|
+
"dns",
|
|
249
|
+
"dgram",
|
|
250
|
+
"cluster",
|
|
251
|
+
"worker_threads",
|
|
252
|
+
"perf_hooks",
|
|
253
|
+
"async_hooks",
|
|
254
|
+
"timers",
|
|
255
|
+
"readline",
|
|
256
|
+
"repl",
|
|
257
|
+
"vm",
|
|
258
|
+
"assert",
|
|
259
|
+
"console",
|
|
260
|
+
"process",
|
|
261
|
+
"v8",
|
|
262
|
+
];
|
|
263
|
+
// Check for node: prefix or direct builtin name
|
|
264
|
+
if (importPath.startsWith("node:"))
|
|
265
|
+
return true;
|
|
266
|
+
const moduleName = importPath.split("/")[0];
|
|
267
|
+
return builtins.includes(moduleName);
|
|
268
|
+
}export{parseImports};//# sourceMappingURL=parse-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-imports.js","sources":["../../src/dev2-server/parse-imports.ts"],"sourcesContent":[null],"names":[],"mappings":"sNAMA;;;AAGG;AACH,SAAS,2BAA2B,CAClC,MAAc,EAAA;IAEd,MAAM,OAAO,GAAkD,EAAE,CAAC;AAClE,IAA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AAU,CAAC,UAAU,CAAC,OAAO,CAAC;AAAE,QAAA,OAAO,IAAI,CAAC;IAEhD,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,IAAA,OAAO,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACvC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare class Path {
|
|
2
|
+
/**
|
|
3
|
+
* Convert the given absolute path to a relative path
|
|
4
|
+
*/
|
|
5
|
+
static toRelative(absolutePath: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get relative path of the given path
|
|
8
|
+
*/
|
|
9
|
+
static relative(relativePath: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Get normalized absolute path of the given path
|
|
12
|
+
*/
|
|
13
|
+
static toNormalizedAbsolute(relativePath: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get absolute path of the given path
|
|
16
|
+
*/
|
|
17
|
+
static toAbsolute(relativePath: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize the given path (convert backslashes to forward slashes)
|
|
20
|
+
*/
|
|
21
|
+
static normalize(filePath: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Join paths and normalize
|
|
24
|
+
*/
|
|
25
|
+
static join(...paths: string[]): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get directory name of a path
|
|
28
|
+
*/
|
|
29
|
+
static dirname(filePath: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get base name of a path
|
|
32
|
+
*/
|
|
33
|
+
static basename(filePath: string, ext?: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get extension of a path
|
|
36
|
+
*/
|
|
37
|
+
static extname(filePath: string): string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/dev2-server/path.ts"],"names":[],"mappings":"AAEA,qBAAa,IAAI;IACf;;OAEG;WACW,UAAU,CAAC,YAAY,EAAE,MAAM;IAI7C;;OAEG;WACW,QAAQ,CAAC,YAAY,EAAE,MAAM;IAI3C;;OAEG;WACW,oBAAoB,CAAC,YAAY,EAAE,MAAM;IAIvD;;OAEG;WACW,UAAU,CAAC,YAAY,EAAE,MAAM;IAI7C;;OAEG;WACW,SAAS,CAAC,QAAQ,EAAE,MAAM;IAIxC;;OAEG;WACW,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE;IAIrC;;OAEG;WACW,OAAO,CAAC,QAAQ,EAAE,MAAM;IAItC;;OAEG;WACW,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAIrD;;OAEG;WACW,OAAO,CAAC,QAAQ,EAAE,MAAM;CAGvC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import path from'node:path';class Path {
|
|
2
|
+
/**
|
|
3
|
+
* Convert the given absolute path to a relative path
|
|
4
|
+
*/
|
|
5
|
+
static toRelative(absolutePath) {
|
|
6
|
+
return this.normalize(path.relative(process.cwd(), absolutePath));
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get relative path of the given path
|
|
10
|
+
*/
|
|
11
|
+
static relative(relativePath) {
|
|
12
|
+
return this.normalize(path.relative(process.cwd(), relativePath));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get normalized absolute path of the given path
|
|
16
|
+
*/
|
|
17
|
+
static toNormalizedAbsolute(relativePath) {
|
|
18
|
+
return this.normalize(path.resolve(process.cwd(), relativePath));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get absolute path of the given path
|
|
22
|
+
*/
|
|
23
|
+
static toAbsolute(relativePath) {
|
|
24
|
+
return this.normalize(path.resolve(process.cwd(), relativePath));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Normalize the given path (convert backslashes to forward slashes)
|
|
28
|
+
*/
|
|
29
|
+
static normalize(filePath) {
|
|
30
|
+
return filePath.replace(/\\/g, "/");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Join paths and normalize
|
|
34
|
+
*/
|
|
35
|
+
static join(...paths) {
|
|
36
|
+
return this.normalize(path.join(...paths));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get directory name of a path
|
|
40
|
+
*/
|
|
41
|
+
static dirname(filePath) {
|
|
42
|
+
return this.normalize(path.dirname(filePath));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get base name of a path
|
|
46
|
+
*/
|
|
47
|
+
static basename(filePath, ext) {
|
|
48
|
+
return path.basename(filePath, ext);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get extension of a path
|
|
52
|
+
*/
|
|
53
|
+
static extname(filePath) {
|
|
54
|
+
return path.extname(filePath);
|
|
55
|
+
}
|
|
56
|
+
}export{Path};//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sources":["../../src/dev2-server/path.ts"],"sourcesContent":[null],"names":[],"mappings":"kCAEa,IAAI,CAAA;AACf;;AAEG;IACI,OAAO,UAAU,CAAC,YAAoB,EAAA;AAC3C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;KACnE;AAED;;AAEG;IACI,OAAO,QAAQ,CAAC,YAAoB,EAAA;AACzC,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;KACnE;AAED;;AAEG;IACI,OAAO,oBAAoB,CAAC,YAAoB,EAAA;AACrD,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;KAClE;AAED;;AAEG;IACI,OAAO,UAAU,CAAC,YAAoB,EAAA;AAC3C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;KAClE;AAED;;AAEG;IACI,OAAO,SAAS,CAAC,QAAgB,EAAA;QACtC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACrC;AAED;;AAEG;AACI,IAAA,OAAO,IAAI,CAAC,GAAG,KAAe,EAAA;AACnC,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;KAC5C;AAED;;AAEG;IACI,OAAO,OAAO,CAAC,QAAgB,EAAA;QACpC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC/C;AAED;;AAEG;AACI,IAAA,OAAO,QAAQ,CAAC,QAAgB,EAAE,GAAY,EAAA;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;KACrC;AAED;;AAEG;IACI,OAAO,OAAO,CAAC,QAAgB,EAAA;AACpC,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KAC/B;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __import: (modulePath: string) => Promise<any>;
|
|
3
|
+
var __updateModuleVersion: (modulePath: string, timestamp?: number) => void;
|
|
4
|
+
var __clearModuleVersion: (modulePath: string) => void;
|
|
5
|
+
var __clearAllModuleVersions: () => void;
|
|
6
|
+
var __getModuleVersion: (modulePath: string) => number | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function initializeRuntimeImportHelper(): void;
|
|
9
|
+
//# sourceMappingURL=runtime-import-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-import-helper.d.ts","sourceRoot":"","sources":["../../src/dev2-server/runtime-import-helper.ts"],"names":[],"mappings":"AAsFA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,IAAI,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,IAAI,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACzC,IAAI,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACpE;AAGD,wBAAgB,6BAA6B,IAAI,IAAI,CAMpD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {pathToFileURL}from'node:url';import {warlockCachePath}from'./utils.js';/**
|
|
2
|
+
* Runtime Import Helper
|
|
3
|
+
*
|
|
4
|
+
* This module provides a global __import function that handles cache busting
|
|
5
|
+
* for HMR. Instead of static imports, we transform them to use this helper
|
|
6
|
+
* which appends timestamps to force module reloads.
|
|
7
|
+
*
|
|
8
|
+
* Example transformation:
|
|
9
|
+
* FROM: import { foo } from "./bar.js"
|
|
10
|
+
* TO: const { foo } = await __import("./bar.js")
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Module version registry
|
|
14
|
+
* Maps module paths to their current version timestamp
|
|
15
|
+
*/
|
|
16
|
+
const moduleVersions = new Map();
|
|
17
|
+
/**
|
|
18
|
+
* Dynamic import with cache busting
|
|
19
|
+
*
|
|
20
|
+
* @param modulePath - The relative cache path (e.g., "./src-app-users-shared-utils.js")
|
|
21
|
+
* @returns The imported module
|
|
22
|
+
*/
|
|
23
|
+
async function __import(modulePath) {
|
|
24
|
+
// Get the current version timestamp for this module
|
|
25
|
+
const timestamp = moduleVersions.get(modulePath) || Date.now();
|
|
26
|
+
// Resolve the module path relative to the cache directory
|
|
27
|
+
// Remove leading "./" if present
|
|
28
|
+
const cleanPath = modulePath.startsWith("./")
|
|
29
|
+
? modulePath.slice(2)
|
|
30
|
+
: modulePath;
|
|
31
|
+
const absolutePath = warlockCachePath(cleanPath);
|
|
32
|
+
// Convert to file:// URL for cross-platform compatibility
|
|
33
|
+
const fileUrl = pathToFileURL(absolutePath).href;
|
|
34
|
+
// Append timestamp as query parameter to bust cache
|
|
35
|
+
const moduleUrl = `${fileUrl}?t=${timestamp}`;
|
|
36
|
+
// Dynamic import with cache busting
|
|
37
|
+
return await import(moduleUrl);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Update the version timestamp for a module
|
|
41
|
+
* This forces the next import to load a fresh version
|
|
42
|
+
*
|
|
43
|
+
* @param modulePath - The path to the module
|
|
44
|
+
* @param timestamp - Optional timestamp (defaults to current time)
|
|
45
|
+
*/
|
|
46
|
+
function __updateModuleVersion(modulePath, timestamp) {
|
|
47
|
+
moduleVersions.set(modulePath, timestamp || Date.now());
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clear version for a module (reset to default behavior)
|
|
51
|
+
*
|
|
52
|
+
* @param modulePath - The path to the module
|
|
53
|
+
*/
|
|
54
|
+
function __clearModuleVersion(modulePath) {
|
|
55
|
+
moduleVersions.delete(modulePath);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Clear all module versions
|
|
59
|
+
*/
|
|
60
|
+
function __clearAllModuleVersions() {
|
|
61
|
+
moduleVersions.clear();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get current version timestamp for a module
|
|
65
|
+
*
|
|
66
|
+
* @param modulePath - The path to the module
|
|
67
|
+
* @returns The timestamp or undefined if not set
|
|
68
|
+
*/
|
|
69
|
+
function __getModuleVersion(modulePath) {
|
|
70
|
+
return moduleVersions.get(modulePath);
|
|
71
|
+
}
|
|
72
|
+
// Export for initialization
|
|
73
|
+
function initializeRuntimeImportHelper() {
|
|
74
|
+
global.__import = __import;
|
|
75
|
+
global.__updateModuleVersion = __updateModuleVersion;
|
|
76
|
+
global.__clearModuleVersion = __clearModuleVersion;
|
|
77
|
+
global.__clearAllModuleVersions = __clearAllModuleVersions;
|
|
78
|
+
global.__getModuleVersion = __getModuleVersion;
|
|
79
|
+
}export{initializeRuntimeImportHelper};//# sourceMappingURL=runtime-import-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-import-helper.js","sources":["../../src/dev2-server/runtime-import-helper.ts"],"sourcesContent":[null],"names":[],"mappings":"+EAGA;;;;;;;;;;AAUG;AAEH;;;AAGG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEjD;;;;;AAKG;AACH,eAAe,QAAQ,CAAC,UAAkB,EAAA;;AAExC,IAAA,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;;;AAI/D,IAAA,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;AAC3C,UAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;UACnB,UAAU,CAAC;AACf,IAAA,MAAM,YAAY,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;;IAGjD,MAAM,OAAO,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;;AAGjD,IAAA,MAAM,SAAS,GAAG,CAAA,EAAG,OAAO,CAAM,GAAA,EAAA,SAAS,EAAE,CAAC;;AAG9C,IAAA,OAAO,MAAM,OAAO,SAAS,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;AAMG;AACH,SAAS,qBAAqB,CAAC,UAAkB,EAAE,SAAkB,EAAA;AACnE,IAAA,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED;;;;AAIG;AACH,SAAS,oBAAoB,CAAC,UAAkB,EAAA;AAC9C,IAAA,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAED;;AAEG;AACH,SAAS,wBAAwB,GAAA;IAC/B,cAAc,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC;AAED;;;;;AAKG;AACH,SAAS,kBAAkB,CAAC,UAAkB,EAAA;AAC5C,IAAA,OAAO,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC;AAWD;SACgB,6BAA6B,GAAA;AAC1C,IAAA,MAAc,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACnC,IAAA,MAAc,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AAC7D,IAAA,MAAc,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;AAC3D,IAAA,MAAc,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;AACnE,IAAA,MAAc,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAC1D"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { FileManager } from "./file-manager";
|
|
2
|
+
/**
|
|
3
|
+
* Special File Types
|
|
4
|
+
*/
|
|
5
|
+
export type SpecialFileType = "config" | "main" | "route" | "event" | "locale";
|
|
6
|
+
/**
|
|
7
|
+
* Special Files Collector
|
|
8
|
+
* Detects and categorizes special files in the project
|
|
9
|
+
* Provides query APIs for accessing special files by type
|
|
10
|
+
*/
|
|
11
|
+
export declare class SpecialFilesCollector {
|
|
12
|
+
/**
|
|
13
|
+
* Categorized special files
|
|
14
|
+
*/
|
|
15
|
+
private readonly configFiles;
|
|
16
|
+
private readonly mainFiles;
|
|
17
|
+
private readonly routeFiles;
|
|
18
|
+
private readonly eventFiles;
|
|
19
|
+
private readonly localeFiles;
|
|
20
|
+
/**
|
|
21
|
+
* Collect special files from all tracked files
|
|
22
|
+
* @param files Map of all tracked files
|
|
23
|
+
*/
|
|
24
|
+
collect(files: Map<string, FileManager>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Categorize a single file
|
|
27
|
+
* @param relativePath Relative path of the file
|
|
28
|
+
* @param fileManager FileManager instance
|
|
29
|
+
*/
|
|
30
|
+
private categorizeFile;
|
|
31
|
+
/**
|
|
32
|
+
* Check if file is a config file
|
|
33
|
+
* Pattern: src/config slash star star slash star dot (ts or tsx)
|
|
34
|
+
*/
|
|
35
|
+
private isConfigFile;
|
|
36
|
+
/**
|
|
37
|
+
* Check if file is a main file
|
|
38
|
+
* Pattern: src/app/star-star/main.ts
|
|
39
|
+
*/
|
|
40
|
+
private isMainFile;
|
|
41
|
+
/**
|
|
42
|
+
* Check if file is a route file
|
|
43
|
+
* Pattern: src/app/$module/routes.ts
|
|
44
|
+
*/
|
|
45
|
+
private isRouteFile;
|
|
46
|
+
/**
|
|
47
|
+
* Check if file is an event file
|
|
48
|
+
* Pattern: src/app/star-star/events/star-star/star.ts
|
|
49
|
+
*/
|
|
50
|
+
private isEventFile;
|
|
51
|
+
/**
|
|
52
|
+
* Check if file is a locale file
|
|
53
|
+
* Pattern: src/app/star-star/utils/locales.ts
|
|
54
|
+
*/
|
|
55
|
+
private isLocaleFile;
|
|
56
|
+
/**
|
|
57
|
+
* Add a new file to the appropriate collection
|
|
58
|
+
* @param fileManager FileManager instance
|
|
59
|
+
*/
|
|
60
|
+
addFile(fileManager: FileManager): void;
|
|
61
|
+
/**
|
|
62
|
+
* Remove a file from all collections
|
|
63
|
+
* @param relativePath Relative path of the file
|
|
64
|
+
*/
|
|
65
|
+
removeFile(relativePath: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Update a file in the collections
|
|
68
|
+
* @param fileManager FileManager instance
|
|
69
|
+
*/
|
|
70
|
+
updateFile(fileManager: FileManager): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get all config files
|
|
73
|
+
* @returns Array of FileManager instances
|
|
74
|
+
*/
|
|
75
|
+
getConfigFiles(): FileManager[];
|
|
76
|
+
/**
|
|
77
|
+
* Get all main files
|
|
78
|
+
* Sort order does not matter here
|
|
79
|
+
* @TODO later we can allow export const priority from the main file itself
|
|
80
|
+
* @returns Array of FileManager instances
|
|
81
|
+
*/
|
|
82
|
+
getMainFiles(): FileManager[];
|
|
83
|
+
/**
|
|
84
|
+
* Get all route files
|
|
85
|
+
* Sorted alphabetically by path
|
|
86
|
+
* @returns Array of FileManager instances
|
|
87
|
+
*/
|
|
88
|
+
getRouteFiles(): FileManager[];
|
|
89
|
+
/**
|
|
90
|
+
* Get all event files
|
|
91
|
+
* @returns Array of FileManager instances
|
|
92
|
+
*/
|
|
93
|
+
getEventFiles(): FileManager[];
|
|
94
|
+
/**
|
|
95
|
+
* Get all locale files
|
|
96
|
+
* @returns Array of FileManager instances
|
|
97
|
+
*/
|
|
98
|
+
getLocaleFiles(): FileManager[];
|
|
99
|
+
/**
|
|
100
|
+
* Get statistics about collected special files
|
|
101
|
+
*/
|
|
102
|
+
getStats(): Record<SpecialFileType, number>;
|
|
103
|
+
/**
|
|
104
|
+
* Check if a file is a special file
|
|
105
|
+
* @param relativePath Relative path of the file
|
|
106
|
+
* @returns Special file type or null
|
|
107
|
+
*/
|
|
108
|
+
getFileType(relativePath: string): SpecialFileType | null;
|
|
109
|
+
/**
|
|
110
|
+
* Clear all collections
|
|
111
|
+
*/
|
|
112
|
+
clear(): void;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=special-files-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"special-files-collector.d.ts","sourceRoot":"","sources":["../../src/dev2-server/special-files-collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CA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