cobolx-2 1.2.3
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/.github/pull_request_template.md +9 -0
- package/.github/workflows/ci.yml +18 -0
- package/.vscode/launch.json +19 -0
- package/.vscode/tasks.json +14 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +23 -0
- package/CargoX.lock +2 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/api-demo/CargoX.lock +1 -0
- package/api-demo/README.md +3 -0
- package/api-demo/benchmarks/arith.cbx +6 -0
- package/api-demo/cobolx.toml +6 -0
- package/api-demo/docs-output/index.html +1 -0
- package/api-demo/generated/LEGACYDEMO.cbx +5 -0
- package/api-demo/generated/client-types.ts +2 -0
- package/api-demo/generated/deploy.json +12 -0
- package/api-demo/generated/flowchart.mmd +4 -0
- package/api-demo/migrations/20260411215238_init.sql +1 -0
- package/api-demo/src/main.cbx +5 -0
- package/api-demo/tests/smoke.cbx +6 -0
- package/benchmarks/arithmetic.cbx +6 -0
- package/cargox/package.json +11 -0
- package/cargox/src/index.d.ts +4 -0
- package/cargox/src/index.js +5 -0
- package/cargox/src/index.js.map +1 -0
- package/cargox/src/index.ts +4 -0
- package/cargox/src/lockfile/index.d.ts +1 -0
- package/cargox/src/lockfile/index.js +9 -0
- package/cargox/src/lockfile/index.js.map +1 -0
- package/cargox/src/lockfile/index.ts +9 -0
- package/cargox/src/manifest.d.ts +10 -0
- package/cargox/src/manifest.js +49 -0
- package/cargox/src/manifest.js.map +1 -0
- package/cargox/src/manifest.ts +58 -0
- package/cargox/src/registry/index.d.ts +4 -0
- package/cargox/src/registry/index.js +13 -0
- package/cargox/src/registry/index.js.map +1 -0
- package/cargox/src/registry/index.ts +13 -0
- package/cargox/src/resolver/index.d.ts +5 -0
- package/cargox/src/resolver/index.js +4 -0
- package/cargox/src/resolver/index.js.map +1 -0
- package/cargox/src/resolver/index.ts +8 -0
- package/cargox/tsconfig.json +7 -0
- package/cli/cobolx-cli/package.json +23 -0
- package/cli/cobolx-cli/src/commands/add.ts +18 -0
- package/cli/cobolx-cli/src/commands/bench.ts +47 -0
- package/cli/cobolx-cli/src/commands/build.ts +74 -0
- package/cli/cobolx-cli/src/commands/check.ts +24 -0
- package/cli/cobolx-cli/src/commands/debug.ts +15 -0
- package/cli/cobolx-cli/src/commands/debug_rewind.ts +16 -0
- package/cli/cobolx-cli/src/commands/deploy.ts +18 -0
- package/cli/cobolx-cli/src/commands/dev.ts +24 -0
- package/cli/cobolx-cli/src/commands/doc.ts +19 -0
- package/cli/cobolx-cli/src/commands/fmt.ts +14 -0
- package/cli/cobolx-cli/src/commands/fuzz.ts +24 -0
- package/cli/cobolx-cli/src/commands/generate.ts +38 -0
- package/cli/cobolx-cli/src/commands/install.ts +25 -0
- package/cli/cobolx-cli/src/commands/legacy.ts +17 -0
- package/cli/cobolx-cli/src/commands/lint.ts +17 -0
- package/cli/cobolx-cli/src/commands/migrate.ts +27 -0
- package/cli/cobolx-cli/src/commands/new.ts +20 -0
- package/cli/cobolx-cli/src/commands/profile.ts +8 -0
- package/cli/cobolx-cli/src/commands/publish.ts +16 -0
- package/cli/cobolx-cli/src/commands/repl.ts +30 -0
- package/cli/cobolx-cli/src/commands/run.ts +22 -0
- package/cli/cobolx-cli/src/commands/task.ts +27 -0
- package/cli/cobolx-cli/src/commands/test.ts +44 -0
- package/cli/cobolx-cli/src/commands/update.ts +30 -0
- package/cli/cobolx-cli/src/commands/visualize.ts +25 -0
- package/cli/cobolx-cli/src/index.ts +101 -0
- package/cli/cobolx-cli/src/project.ts +74 -0
- package/cli/cobolx-cli/tsconfig.json +7 -0
- package/cobolx.toml +7 -0
- package/compiler/package.json +14 -0
- package/compiler/src/ast/types.d.ts +87 -0
- package/compiler/src/ast/types.js +2 -0
- package/compiler/src/ast/types.js.map +1 -0
- package/compiler/src/ast/types.ts +329 -0
- package/compiler/src/backend/custom.d.ts +8 -0
- package/compiler/src/backend/custom.js +12 -0
- package/compiler/src/backend/custom.js.map +1 -0
- package/compiler/src/backend/custom.ts +21 -0
- package/compiler/src/borrow_checker/checker.d.ts +3 -0
- package/compiler/src/borrow_checker/checker.js +82 -0
- package/compiler/src/borrow_checker/checker.js.map +1 -0
- package/compiler/src/borrow_checker/checker.ts +100 -0
- package/compiler/src/codegen/javascript.d.ts +2 -0
- package/compiler/src/codegen/javascript.js +89 -0
- package/compiler/src/codegen/javascript.js.map +1 -0
- package/compiler/src/codegen/javascript.ts +175 -0
- package/compiler/src/const_eval/evaluator.ts +58 -0
- package/compiler/src/diagnostics.d.ts +11 -0
- package/compiler/src/diagnostics.js +14 -0
- package/compiler/src/diagnostics.js.map +1 -0
- package/compiler/src/diagnostics.ts +20 -0
- package/compiler/src/hir/lower.d.ts +7 -0
- package/compiler/src/hir/lower.js +44 -0
- package/compiler/src/hir/lower.js.map +1 -0
- package/compiler/src/hir/lower.ts +60 -0
- package/compiler/src/hir/types.d.ts +21 -0
- package/compiler/src/hir/types.js +2 -0
- package/compiler/src/hir/types.js.map +1 -0
- package/compiler/src/hir/types.ts +26 -0
- package/compiler/src/index.d.ts +22 -0
- package/compiler/src/index.js +84 -0
- package/compiler/src/index.js.map +1 -0
- package/compiler/src/index.ts +122 -0
- package/compiler/src/lexer/lexer.d.ts +21 -0
- package/compiler/src/lexer/lexer.js +207 -0
- package/compiler/src/lexer/lexer.js.map +1 -0
- package/compiler/src/lexer/lexer.ts +274 -0
- package/compiler/src/lexer/tokens.d.ts +8 -0
- package/compiler/src/lexer/tokens.js +18 -0
- package/compiler/src/lexer/tokens.js.map +1 -0
- package/compiler/src/lexer/tokens.ts +126 -0
- package/compiler/src/macros/expand.ts +75 -0
- package/compiler/src/main.ts +4 -0
- package/compiler/src/mir/lower.d.ts +3 -0
- package/compiler/src/mir/lower.js +10 -0
- package/compiler/src/mir/lower.js.map +1 -0
- package/compiler/src/mir/lower.ts +12 -0
- package/compiler/src/mir/types.d.ts +13 -0
- package/compiler/src/mir/types.js +2 -0
- package/compiler/src/mir/types.js.map +1 -0
- package/compiler/src/mir/types.ts +16 -0
- package/compiler/src/optimizer/constantFold.d.ts +2 -0
- package/compiler/src/optimizer/constantFold.js +61 -0
- package/compiler/src/optimizer/constantFold.js.map +1 -0
- package/compiler/src/optimizer/constantFold.ts +109 -0
- package/compiler/src/parser/parser.d.ts +33 -0
- package/compiler/src/parser/parser.js +323 -0
- package/compiler/src/parser/parser.js.map +1 -0
- package/compiler/src/parser/parser.ts +710 -0
- package/compiler/src/plugins/api.ts +8 -0
- package/compiler/src/plugins/loader.ts +21 -0
- package/compiler/src/semantic/analyzer.d.ts +12 -0
- package/compiler/src/semantic/analyzer.js +144 -0
- package/compiler/src/semantic/analyzer.js.map +1 -0
- package/compiler/src/semantic/analyzer.ts +277 -0
- package/compiler/src/type_system/checker.d.ts +7 -0
- package/compiler/src/type_system/checker.js +84 -0
- package/compiler/src/type_system/checker.js.map +1 -0
- package/compiler/src/type_system/checker.ts +108 -0
- package/compiler/tsconfig.json +7 -0
- package/debugger/package.json +11 -0
- package/debugger/src/index.d.ts +1 -0
- package/debugger/src/index.js +9 -0
- package/debugger/src/index.js.map +1 -0
- package/debugger/src/index.ts +9 -0
- package/debugger/tsconfig.json +7 -0
- package/docs/CHANGELOG.md +11 -0
- package/docs/CONTRIBUTING.md +15 -0
- package/docs/LICENSE +21 -0
- package/docs/architecture.md +29 -0
- package/docs/cli.md +58 -0
- package/docs/language-spec.md +49 -0
- package/docs/packages.md +19 -0
- package/docs/platform-systems.md +31 -0
- package/docs/release-validation.md +22 -0
- package/docs/runtime.md +10 -0
- package/docs/tooling.md +17 -0
- package/docs/vscode-extension.md +40 -0
- package/enterprise-demo/CargoX.lock +2 -0
- package/enterprise-demo/README.md +3 -0
- package/enterprise-demo/benchmarks/arith.cbx +6 -0
- package/enterprise-demo/cobolx.toml +7 -0
- package/enterprise-demo/src/main.cbx +5 -0
- package/enterprise-demo/tests/smoke.cbx +6 -0
- package/examples/README.md +20 -0
- package/examples/actors-and-flags.md +8 -0
- package/examples/api-server/README.md +9 -0
- package/examples/api-server/cobolx.toml +6 -0
- package/examples/api-server/src/main.cbx +8 -0
- package/examples/debug-replay.md +7 -0
- package/examples/debugging-demo/README.md +3 -0
- package/examples/debugging-demo/cobolx.toml +6 -0
- package/examples/debugging-demo/src/main.cbx +7 -0
- package/examples/distributed-service.md +12 -0
- package/examples/distributed-system/README.md +3 -0
- package/examples/distributed-system/cobolx.toml +6 -0
- package/examples/distributed-system/generated/deploy.json +12 -0
- package/examples/distributed-system/src/main.cbx +6 -0
- package/examples/event-driven.md +5 -0
- package/examples/event-system/README.md +3 -0
- package/examples/event-system/cobolx.toml +6 -0
- package/examples/event-system/src/main.cbx +11 -0
- package/examples/functions.cbx +10 -0
- package/examples/functions.mjs +12 -0
- package/examples/hello.cbx +5 -0
- package/examples/hello.mjs +7 -0
- package/examples/legacy-sample.cob +5 -0
- package/examples/parallel-processing/README.md +3 -0
- package/examples/parallel-processing/cobolx.toml +6 -0
- package/examples/parallel-processing/src/main.cbx +6 -0
- package/examples/parallel-processing.md +8 -0
- package/examples/platform-features.cbx +32 -0
- package/examples/platform-features.mjs +35 -0
- package/examples/service.cbx +10 -0
- package/examples/workflow-engine/README.md +3 -0
- package/examples/workflow-engine/cobolx.toml +6 -0
- package/examples/workflow-engine/generated/flowchart.mmd +8 -0
- package/examples/workflow-engine/src/main.cbx +13 -0
- package/examples/workflow-engine.md +5 -0
- package/formatter/package.json +14 -0
- package/formatter/src/index.d.ts +1 -0
- package/formatter/src/index.js +59 -0
- package/formatter/src/index.js.map +1 -0
- package/formatter/src/index.ts +103 -0
- package/formatter/tsconfig.json +7 -0
- package/generated/LEGACYDEMO.cbx +5 -0
- package/install.ps1 +4 -0
- package/install.sh +5 -0
- package/linter/package.json +14 -0
- package/linter/src/index.d.ts +2 -0
- package/linter/src/index.js +18 -0
- package/linter/src/index.js.map +1 -0
- package/linter/src/index.ts +19 -0
- package/linter/tsconfig.json +7 -0
- package/lsp/server/package.json +16 -0
- package/lsp/server/src/index.ts +168 -0
- package/lsp/server/tsconfig.json +7 -0
- package/package.json +30 -0
- package/profiler/package.json +11 -0
- package/profiler/src/index.d.ts +5 -0
- package/profiler/src/index.js +11 -0
- package/profiler/src/index.js.map +1 -0
- package/profiler/src/index.ts +11 -0
- package/profiler/tsconfig.json +7 -0
- package/release.json +10 -0
- package/runtime/package.json +14 -0
- package/runtime/src/actors/index.ts +27 -0
- package/runtime/src/async/futures.ts +11 -0
- package/runtime/src/code_as_data/index.ts +5 -0
- package/runtime/src/config/index.ts +17 -0
- package/runtime/src/distributed/index.ts +13 -0
- package/runtime/src/events/index.ts +21 -0
- package/runtime/src/feature_flags/index.ts +9 -0
- package/runtime/src/gc_or_arc/index.ts +1 -0
- package/runtime/src/healing/index.ts +26 -0
- package/runtime/src/index.ts +20 -0
- package/runtime/src/intents/index.ts +9 -0
- package/runtime/src/iterators/index.ts +23 -0
- package/runtime/src/memory/arc.ts +22 -0
- package/runtime/src/observability/index.ts +23 -0
- package/runtime/src/repl/context.ts +7 -0
- package/runtime/src/scheduler/taskScheduler.ts +11 -0
- package/runtime/src/security/capabilities.ts +15 -0
- package/runtime/src/security/secrets.ts +13 -0
- package/runtime/src/state/versioned.ts +31 -0
- package/runtime/src/std_hooks/audit.ts +23 -0
- package/runtime/src/time_travel/index.ts +54 -0
- package/runtime/src/workflows/index.ts +35 -0
- package/runtime/tsconfig.json +7 -0
- package/sample-payroll/README.md +3 -0
- package/sample-payroll/cobolx.toml +3 -0
- package/sample-payroll/src/main.cbx +5 -0
- package/stdlib/business/index.js +15 -0
- package/stdlib/core/README.md +8 -0
- package/stdlib/core/runtime.js +191 -0
- package/stdlib/crypto/index.js +5 -0
- package/stdlib/datetime/index.js +3 -0
- package/stdlib/fs/index.js +9 -0
- package/stdlib/http/index.js +7 -0
- package/stdlib/io/index.js +1 -0
- package/stdlib/json/index.js +7 -0
- package/stdlib/net/index.js +4 -0
- package/tests/macros.cbx +10 -0
- package/tests/pattern_match.cbx +16 -0
- package/tests/smoke.cbx +7 -0
- package/tests/validate-release.mjs +54 -0
- package/tsconfig.base.json +24 -0
- package/vscode-extension/LICENSE +21 -0
- package/vscode-extension/README.md +47 -0
- package/vscode-extension/cobolx-1.2.0.vsix +0 -0
- package/vscode-extension/icon.png +0 -0
- package/vscode-extension/icon.svg +15 -0
- package/vscode-extension/language-configuration.json +17 -0
- package/vscode-extension/package.json +148 -0
- package/vscode-extension/snippets/cobolx.code-snippets +49 -0
- package/vscode-extension/src/extension.ts +283 -0
- package/vscode-extension/syntaxes/cobolx.tmLanguage.json +75 -0
- package/vscode-extension/tests/test.cbl +3 -0
- package/vscode-extension/tsconfig.json +7 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main", "master"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-node@v4
|
|
14
|
+
with:
|
|
15
|
+
node-version: 22
|
|
16
|
+
- run: npm install
|
|
17
|
+
- run: npm run build
|
|
18
|
+
- run: npm run check
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Run COBOL-X Extension",
|
|
6
|
+
"type": "extensionHost",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"runtimeExecutable": "${execPath}",
|
|
9
|
+
"args": [
|
|
10
|
+
"--extensionDevelopmentPath=${workspaceFolder}/vscode-extension",
|
|
11
|
+
"${workspaceFolder}"
|
|
12
|
+
],
|
|
13
|
+
"outFiles": [
|
|
14
|
+
"${workspaceFolder}/vscode-extension/dist/**/*.js"
|
|
15
|
+
],
|
|
16
|
+
"preLaunchTask": "build-cobolx-extension"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.2.3 - 2026-06-13
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Fixed divide-by-zero producing `NaN` instead of a runtime error in DIVIDE and arithmetic operations
|
|
7
|
+
- Division operations now correctly validate the divisor before evaluation
|
|
8
|
+
|
|
9
|
+
## 1.0.0 - 2026-04-11
|
|
10
|
+
|
|
11
|
+
- Finalized the TypeScript COBOL-X workspace into a GitHub-ready release candidate
|
|
12
|
+
- Added CLI package-manager flows for `install` and `update`
|
|
13
|
+
- Improved test and benchmark execution to compile and run each `.cbx` file independently
|
|
14
|
+
- Added runnable example projects for API, distributed deployment, workflows, events, parallel processing, and debugging
|
|
15
|
+
- Hardened time-travel debugging with generated trace instrumentation and rewind playback
|
|
16
|
+
- Added release validation automation, root repository files, and a stronger `.gitignore`
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```powershell
|
|
6
|
+
npm install
|
|
7
|
+
npm run build
|
|
8
|
+
npm run validate
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Standards
|
|
12
|
+
|
|
13
|
+
- Keep workspace packages building with `npm run build`
|
|
14
|
+
- Prefer small, testable compiler/runtime changes
|
|
15
|
+
- Add or update examples when changing user-facing behavior
|
|
16
|
+
- Document new CLI commands and manifest fields
|
|
17
|
+
|
|
18
|
+
## Pull Requests
|
|
19
|
+
|
|
20
|
+
1. Run `npm run build`
|
|
21
|
+
2. Run `npm run test`
|
|
22
|
+
3. Run `npm run validate`
|
|
23
|
+
4. Summarize behavioral changes and any known limitations
|
package/CargoX.lock
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 COBOL-X
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# COBOL-X
|
|
2
|
+
|
|
3
|
+
[](#development)
|
|
4
|
+
[](#release)
|
|
5
|
+
[](#vs-code-extension)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://www.npmjs.com/package/cobolx-2)
|
|
8
|
+
|
|
9
|
+
COBOL-X is a modern COBOL-inspired programming platform for readable business logic, deterministic tooling, and backend-oriented workflows. This repository ships a TypeScript-based compiler toolchain, runtime, package manager layer, editor integration, and release validation flow.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Working compiler pipeline with lexer, parser, AST, semantic analysis, HIR, MIR, optimization, and JavaScript backend emission
|
|
14
|
+
- CLI workflows for build, run, check, test, bench, debug, dev, docs, code generation, migrations, visualization, deploy, and package management
|
|
15
|
+
- CargoX manifest, dependency graph, lockfile, install, update, and local publish support
|
|
16
|
+
- Runtime modules for scheduling, actors, events, distributed service discovery, observability, workflows, self-healing, and versioned state
|
|
17
|
+
- Time-travel debugging support with trace recording and rewind playback
|
|
18
|
+
- LSP and VS Code extension support for `.cbx`, `.cob`, and `.col`
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install cobolx-2
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Build from source
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
npm run validate
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Helper scripts are available in [install.ps1](/c:/Users/matth/Desktop/temp%20folder/install.ps1) and [install.sh](/c:/Users/matth/Desktop/temp%20folder/install.sh).
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
node cli/cobolx-cli/dist/index.js new my-service api
|
|
40
|
+
cd my-service
|
|
41
|
+
node ..\cli\cobolx-cli\dist\index.js add ledger 1.2.3
|
|
42
|
+
node ..\cli\cobolx-cli\dist\index.js install
|
|
43
|
+
node ..\cli\cobolx-cli\dist\index.js run
|
|
44
|
+
node ..\cli\cobolx-cli\dist\index.js debug --rewind
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## COBOL-X Example
|
|
48
|
+
|
|
49
|
+
```cbx
|
|
50
|
+
PROGRAM Payments
|
|
51
|
+
|
|
52
|
+
ENUM Result:
|
|
53
|
+
OK(value)
|
|
54
|
+
ERR(message)
|
|
55
|
+
END
|
|
56
|
+
|
|
57
|
+
FUNCTION add(left, right)
|
|
58
|
+
BEGIN
|
|
59
|
+
RETURN left + right
|
|
60
|
+
END-FUNCTION
|
|
61
|
+
|
|
62
|
+
BEGIN
|
|
63
|
+
LET subtotal = add(20, 22)
|
|
64
|
+
DISPLAY subtotal
|
|
65
|
+
END
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Repository Layout
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
cobolx/
|
|
72
|
+
├── compiler/
|
|
73
|
+
├── runtime/
|
|
74
|
+
├── stdlib/
|
|
75
|
+
├── cli/
|
|
76
|
+
├── cargox/
|
|
77
|
+
├── lsp/
|
|
78
|
+
├── vscode-extension/
|
|
79
|
+
├── formatter/
|
|
80
|
+
├── linter/
|
|
81
|
+
├── debugger/
|
|
82
|
+
├── profiler/
|
|
83
|
+
├── examples/
|
|
84
|
+
├── tests/
|
|
85
|
+
├── benchmarks/
|
|
86
|
+
├── docs/
|
|
87
|
+
├── LICENSE
|
|
88
|
+
├── CONTRIBUTING.md
|
|
89
|
+
├── CHANGELOG.md
|
|
90
|
+
└── .gitignore
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## CLI
|
|
94
|
+
|
|
95
|
+
- `cobolx build`
|
|
96
|
+
- `cobolx run`
|
|
97
|
+
- `cobolx check`
|
|
98
|
+
- `cobolx test`
|
|
99
|
+
- `cobolx bench`
|
|
100
|
+
- `cobolx add <pkg> <version>`
|
|
101
|
+
- `cobolx install`
|
|
102
|
+
- `cobolx update`
|
|
103
|
+
- `cobolx publish`
|
|
104
|
+
- `cobolx dev`
|
|
105
|
+
- `cobolx doc`
|
|
106
|
+
- `cobolx repl`
|
|
107
|
+
- `cobolx visualize`
|
|
108
|
+
- `cobolx deploy`
|
|
109
|
+
|
|
110
|
+
## VS Code Extension
|
|
111
|
+
|
|
112
|
+
The publishable extension lives in [vscode-extension](/c:/Users/matth/Desktop/temp%20folder/vscode-extension:1). It includes language registration, syntax highlighting, snippets, LSP-backed diagnostics/hover/completions, and VS Code commands for run, build, REPL, and debug.
|
|
113
|
+
|
|
114
|
+
VS Code Marketplace:
|
|
115
|
+
|
|
116
|
+
- [Marketplace Listing Placeholder](https://marketplace.visualstudio.com/items?itemName=magnificent-language.cobolx)
|
|
117
|
+
|
|
118
|
+
Packaging flow:
|
|
119
|
+
|
|
120
|
+
```powershell
|
|
121
|
+
cd vscode-extension
|
|
122
|
+
npm install -g vsce
|
|
123
|
+
npx @vscode/vsce package
|
|
124
|
+
vsce login Magnexis
|
|
125
|
+
vsce publish
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Examples
|
|
129
|
+
|
|
130
|
+
Runnable example apps live under [examples](/c:/Users/matth/Desktop/temp%20folder/examples:1):
|
|
131
|
+
|
|
132
|
+
- [examples/api-server](/c:/Users/matth/Desktop/temp%20folder/examples/api-server:1)
|
|
133
|
+
- [examples/distributed-system](/c:/Users/matth/Desktop/temp%20folder/examples/distributed-system:1)
|
|
134
|
+
- [examples/workflow-engine](/c:/Users/matth/Desktop/temp%20folder/examples/workflow-engine:1)
|
|
135
|
+
- [examples/event-system](/c:/Users/matth/Desktop/temp%20folder/examples/event-system:1)
|
|
136
|
+
- [examples/parallel-processing](/c:/Users/matth/Desktop/temp%20folder/examples/parallel-processing:1)
|
|
137
|
+
- [examples/debugging-demo](/c:/Users/matth/Desktop/temp%20folder/examples/debugging-demo:1)
|
|
138
|
+
|
|
139
|
+
Screenshots:
|
|
140
|
+
|
|
141
|
+
- `docs/screenshots/cli-build.png`
|
|
142
|
+
- `docs/screenshots/debug-rewind.png`
|
|
143
|
+
- `docs/screenshots/vscode-extension.png`
|
|
144
|
+
|
|
145
|
+
## Development
|
|
146
|
+
|
|
147
|
+
```powershell
|
|
148
|
+
npm install
|
|
149
|
+
npm run build
|
|
150
|
+
npm run check
|
|
151
|
+
npm run test
|
|
152
|
+
npm run validate
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Further reading:
|
|
156
|
+
|
|
157
|
+
- [docs/architecture.md](/c:/Users/matth/Desktop/temp%20folder/docs/architecture.md)
|
|
158
|
+
- [docs/language-spec.md](/c:/Users/matth/Desktop/temp%20folder/docs/language-spec.md)
|
|
159
|
+
- [docs/cli.md](/c:/Users/matth/Desktop/temp%20folder/docs/cli.md)
|
|
160
|
+
- [docs/runtime.md](/c:/Users/matth/Desktop/temp%20folder/docs/runtime.md)
|
|
161
|
+
- [docs/tooling.md](/c:/Users/matth/Desktop/temp%20folder/docs/tooling.md)
|
|
162
|
+
- [docs/packages.md](/c:/Users/matth/Desktop/temp%20folder/docs/packages.md)
|
|
163
|
+
- [docs/platform-systems.md](/c:/Users/matth/Desktop/temp%20folder/docs/platform-systems.md)
|
|
164
|
+
- [docs/vscode-extension.md](/c:/Users/matth/Desktop/temp%20folder/docs/vscode-extension.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
workspace = "api-demo"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><body><h1>apidemo</h1><h2>Functions</h2><ul></ul><h2>Traits</h2><ul></ul></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- Write migration SQL here
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cobolx/cargox",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.json",
|
|
8
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
9
|
+
"clean": "if (Test-Path dist) { Remove-Item -Recurse -Force dist }"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { readManifest, writeManifest } from "./manifest.js";
|
|
2
|
+
export { resolveDependencyGraph } from "./resolver/index.js";
|
|
3
|
+
export { publishToLocalRegistry } from "./registry/index.js";
|
|
4
|
+
export { writeLockfile } from "./lockfile/index.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function writeLockfile(lockfilePath: string, root: string, dependencies: Record<string, string>): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
export function writeLockfile(lockfilePath, root, dependencies) {
|
|
3
|
+
const lines = [`workspace = "${root}"`];
|
|
4
|
+
for (const [name, version] of Object.entries(dependencies)) {
|
|
5
|
+
lines.push(`${name} = "${version}"`);
|
|
6
|
+
}
|
|
7
|
+
fs.writeFileSync(lockfilePath, `${lines.join("\n")}\n`, "utf8");
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,IAAY,EAAE,YAAoC;IACpG,MAAM,KAAK,GAAG,CAAC,gBAAgB,IAAI,GAAG,CAAC,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,OAAO,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
|
|
3
|
+
export function writeLockfile(lockfilePath: string, root: string, dependencies: Record<string, string>): void {
|
|
4
|
+
const lines = [`workspace = "${root}"`];
|
|
5
|
+
for (const [name, version] of Object.entries(dependencies)) {
|
|
6
|
+
lines.push(`${name} = "${version}"`);
|
|
7
|
+
}
|
|
8
|
+
fs.writeFileSync(lockfilePath, `${lines.join("\n")}\n`, "utf8");
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PackageManifest {
|
|
2
|
+
package: {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
entry: string;
|
|
6
|
+
};
|
|
7
|
+
dependencies: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function readManifest(manifestPath: string): PackageManifest;
|
|
10
|
+
export declare function writeManifest(manifestPath: string, manifest: PackageManifest): void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
export function readManifest(manifestPath) {
|
|
3
|
+
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
4
|
+
const result = {
|
|
5
|
+
package: { name: "app", version: "0.1.0", entry: "src/main.cbx" },
|
|
6
|
+
dependencies: {}
|
|
7
|
+
};
|
|
8
|
+
let section = "";
|
|
9
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
10
|
+
const trimmed = line.trim();
|
|
11
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const sectionMatch = /^\[(.+)\]$/.exec(trimmed);
|
|
15
|
+
if (sectionMatch) {
|
|
16
|
+
section = sectionMatch[1];
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const kv = /^([A-Za-z0-9_.-]+)\s*=\s*"(.*)"$/.exec(trimmed);
|
|
20
|
+
if (!kv) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const [, key, value] = kv;
|
|
24
|
+
if (section === "package" || section === "workspace") {
|
|
25
|
+
if (key === "name" || key === "version" || key === "entry") {
|
|
26
|
+
result.package[key] = value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (section === "dependencies") {
|
|
30
|
+
result.dependencies[key] = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
export function writeManifest(manifestPath, manifest) {
|
|
36
|
+
const lines = [
|
|
37
|
+
"[package]",
|
|
38
|
+
`name = "${manifest.package.name}"`,
|
|
39
|
+
`version = "${manifest.package.version}"`,
|
|
40
|
+
`entry = "${manifest.package.entry}"`,
|
|
41
|
+
"",
|
|
42
|
+
"[dependencies]"
|
|
43
|
+
];
|
|
44
|
+
for (const [name, version] of Object.entries(manifest.dependencies)) {
|
|
45
|
+
lines.push(`${name} = "${version}"`);
|
|
46
|
+
}
|
|
47
|
+
fs.writeFileSync(manifestPath, `${lines.join("\n")}\n`, "utf8");
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAWzB,MAAM,UAAU,YAAY,CAAC,YAAoB;IAC/C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,MAAM,GAAoB;QAC9B,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;QACjE,YAAY,EAAE,EAAE;KACjB,CAAC;IACF,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,SAAS;QACX,CAAC;QACD,MAAM,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,MAAM,EAAE,GAAG,kCAAkC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,SAAS;QACX,CAAC;QACD,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QAC1B,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YACrD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;gBAC3D,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC9B,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,KAAK,cAAc,EAAE,CAAC;YACtC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,QAAyB;IAC3E,MAAM,KAAK,GAAG;QACZ,WAAW;QACX,WAAW,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG;QACnC,cAAc,QAAQ,CAAC,OAAO,CAAC,OAAO,GAAG;QACzC,YAAY,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG;QACrC,EAAE;QACF,gBAAgB;KACjB,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACpE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,OAAO,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
|
|
3
|
+
export interface PackageManifest {
|
|
4
|
+
package: {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
entry: string;
|
|
8
|
+
};
|
|
9
|
+
dependencies: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function readManifest(manifestPath: string): PackageManifest {
|
|
13
|
+
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
14
|
+
const result: PackageManifest = {
|
|
15
|
+
package: { name: "app", version: "0.1.0", entry: "src/main.cbx" },
|
|
16
|
+
dependencies: {}
|
|
17
|
+
};
|
|
18
|
+
let section = "";
|
|
19
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
20
|
+
const trimmed = line.trim();
|
|
21
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const sectionMatch = /^\[(.+)\]$/.exec(trimmed);
|
|
25
|
+
if (sectionMatch) {
|
|
26
|
+
section = sectionMatch[1];
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const kv = /^([A-Za-z0-9_.-]+)\s*=\s*"(.*)"$/.exec(trimmed);
|
|
30
|
+
if (!kv) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const [, key, value] = kv;
|
|
34
|
+
if (section === "package" || section === "workspace") {
|
|
35
|
+
if (key === "name" || key === "version" || key === "entry") {
|
|
36
|
+
result.package[key] = value;
|
|
37
|
+
}
|
|
38
|
+
} else if (section === "dependencies") {
|
|
39
|
+
result.dependencies[key] = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function writeManifest(manifestPath: string, manifest: PackageManifest): void {
|
|
46
|
+
const lines = [
|
|
47
|
+
"[package]",
|
|
48
|
+
`name = "${manifest.package.name}"`,
|
|
49
|
+
`version = "${manifest.package.version}"`,
|
|
50
|
+
`entry = "${manifest.package.entry}"`,
|
|
51
|
+
"",
|
|
52
|
+
"[dependencies]"
|
|
53
|
+
];
|
|
54
|
+
for (const [name, version] of Object.entries(manifest.dependencies)) {
|
|
55
|
+
lines.push(`${name} = "${version}"`);
|
|
56
|
+
}
|
|
57
|
+
fs.writeFileSync(manifestPath, `${lines.join("\n")}\n`, "utf8");
|
|
58
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export function publishToLocalRegistry(registryDir, name, version, files) {
|
|
4
|
+
const packageDir = path.join(registryDir, name, version);
|
|
5
|
+
fs.mkdirSync(packageDir, { recursive: true });
|
|
6
|
+
for (const file of files) {
|
|
7
|
+
const target = path.join(packageDir, file.path);
|
|
8
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
9
|
+
fs.writeFileSync(target, file.content, "utf8");
|
|
10
|
+
}
|
|
11
|
+
return packageDir;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,KAA+C;IACxI,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
export function publishToLocalRegistry(registryDir: string, name: string, version: string, files: Array<{ path: string; content: string }>): string {
|
|
5
|
+
const packageDir = path.join(registryDir, name, version);
|
|
6
|
+
fs.mkdirSync(packageDir, { recursive: true });
|
|
7
|
+
for (const file of files) {
|
|
8
|
+
const target = path.join(packageDir, file.path);
|
|
9
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
10
|
+
fs.writeFileSync(target, file.content, "utf8");
|
|
11
|
+
}
|
|
12
|
+
return packageDir;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,YAAoC;IACvF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,GAAG,YAAY,EAAE,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface DependencyGraph {
|
|
2
|
+
root: string;
|
|
3
|
+
dependencies: Record<string, string>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function resolveDependencyGraph(root: string, dependencies: Record<string, string>): DependencyGraph {
|
|
7
|
+
return { root, dependencies: { ...dependencies } };
|
|
8
|
+
}
|