nesoi 3.2.9 → 3.3.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/README.md +33 -2
- package/lib/bundler/browser/browser.app.d.ts +32 -0
- package/lib/bundler/browser/browser.app.js +51 -0
- package/lib/bundler/browser/browser.bundler.d.ts +5 -0
- package/lib/bundler/browser/browser.bundler.js +27 -0
- package/lib/bundler/browser/stages/8_replace_nesoi_for_browser_stage.d.ts +13 -0
- package/lib/bundler/browser/stages/8_replace_nesoi_for_browser_stage.js +74 -0
- package/lib/bundler/distributed/distributed.app.config.d.ts +43 -0
- package/lib/{engine/apps → bundler}/distributed/distributed.app.config.js +1 -1
- package/lib/{engine/apps → bundler}/distributed/distributed.app.d.ts +14 -14
- package/lib/{engine/apps → bundler}/distributed/distributed.app.js +8 -3
- package/lib/{compiler/apps/distributed/distributed_compiler.d.ts → bundler/distributed/distributed.bundler.d.ts} +7 -7
- package/lib/{compiler/apps/distributed/distributed_compiler.js → bundler/distributed/distributed.bundler.js} +11 -11
- package/lib/{engine/apps → bundler}/distributed/distributed_node.app.d.ts +14 -20
- package/lib/{engine/apps → bundler}/distributed/distributed_node.app.js +18 -50
- package/lib/bundler/distributed/stages/1_mkdir_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/1_mkdir_stage.js +6 -6
- package/lib/bundler/distributed/stages/2_build_typescript_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/2_build_typescript_stage.js +7 -7
- package/lib/bundler/distributed/stages/3_copy_types_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/3_copy_types_stage.js +7 -7
- package/lib/bundler/distributed/stages/4_dump_modules_stage.d.ts +16 -0
- package/lib/{compiler/apps → bundler}/distributed/stages/4_dump_modules_stage.js +5 -5
- package/lib/{compiler/apps → bundler}/distributed/stages/5_copy_static_stage.js +3 -3
- package/lib/{compiler/apps → bundler}/distributed/stages/6_dump_cli_stage.js +3 -3
- package/lib/{compiler/apps → bundler}/distributed/stages/7_dump_package_json_stage.js +3 -3
- package/lib/{engine/apps → bundler}/monolyth/monolyth.app.d.ts +13 -13
- package/lib/{engine/apps → bundler}/monolyth/monolyth.app.js +13 -10
- package/lib/{compiler/apps/monolyth/monolyth_compiler.d.ts → bundler/monolyth/monolyth.bundler.d.ts} +9 -7
- package/lib/{compiler/apps/monolyth/monolyth_compiler.js → bundler/monolyth/monolyth.bundler.js} +13 -12
- package/lib/bundler/monolyth/stages/1_mkdir_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/1_mkdir_stage.js +6 -6
- package/lib/bundler/monolyth/stages/2_build_typescript_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/2_build_typescript_stage.js +8 -7
- package/lib/bundler/monolyth/stages/3_copy_types_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/3_copy_types_stage.js +7 -7
- package/lib/{compiler/apps → bundler}/monolyth/stages/4_dump_modules_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/4_dump_modules_stage.js +29 -16
- package/lib/{compiler/apps → bundler}/monolyth/stages/5_copy_static_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/5_copy_static_stage.js +7 -7
- package/lib/bundler/monolyth/stages/6_dump_cli_stage.d.ts +15 -0
- package/lib/{compiler/apps → bundler}/monolyth/stages/6_dump_cli_stage.js +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/7_dump_package_json_stage.d.ts +4 -4
- package/lib/{compiler/apps → bundler}/monolyth/stages/7_dump_package_json_stage.js +14 -11
- package/lib/compiler/compiler.d.ts +1 -6
- package/lib/compiler/compiler.js +1 -1
- package/lib/compiler/elements/bucket.element.d.ts +2 -1
- package/lib/compiler/elements/bucket.element.js +16 -21
- package/lib/compiler/elements/cached.element.d.ts +1 -1
- package/lib/compiler/elements/cached.element.js +2 -2
- package/lib/compiler/elements/constants.element.d.ts +1 -1
- package/lib/compiler/elements/constants.element.js +2 -0
- package/lib/compiler/elements/controller.element.js +3 -3
- package/lib/compiler/elements/element.d.ts +6 -13
- package/lib/compiler/elements/element.js +11 -9
- package/lib/compiler/elements/externals.element.js +2 -2
- package/lib/compiler/elements/job.element.d.ts +1 -1
- package/lib/compiler/elements/job.element.js +1 -1
- package/lib/compiler/elements/machine.element.d.ts +2 -2
- package/lib/compiler/elements/machine.element.js +7 -7
- package/lib/compiler/elements/message.element.d.ts +1 -1
- package/lib/compiler/elements/message.element.js +26 -26
- package/lib/compiler/elements/queue.element.js +1 -1
- package/lib/compiler/elements/resource.element.d.ts +1 -1
- package/lib/compiler/elements/resource.element.js +9 -9
- package/lib/compiler/elements/topic.element.js +1 -1
- package/lib/compiler/error.d.ts +1 -5
- package/lib/compiler/error.js +3 -15
- package/lib/compiler/helpers/dump_helpers.d.ts +1 -1
- package/lib/compiler/helpers/dump_helpers.js +1 -1
- package/lib/compiler/index.d.ts +1 -3
- package/lib/compiler/index.js +15 -7
- package/lib/compiler/module.js +12 -12
- package/lib/compiler/progressive.d.ts +3 -4
- package/lib/compiler/progressive.js +3 -4
- package/lib/compiler/stages/2_treeshake_stage.js +4 -0
- package/lib/compiler/stages/3_extract_ts_stage.js +7 -7
- package/lib/compiler/stages/4_build_schemas_stage.js +3 -16
- package/lib/compiler/stages/6_build_elements_stage.js +1 -1
- package/lib/compiler/stages/7_dump_stage.js +35 -10
- package/lib/compiler/typescript/bridge/extract.js +24 -0
- package/lib/compiler/typescript/bridge/inject.js +18 -3
- package/lib/compiler/typescript/bridge/organize.d.ts +4 -0
- package/lib/compiler/typescript/bridge/organize.js +41 -22
- package/lib/compiler/typescript/error.d.ts +2 -83
- package/lib/compiler/typescript/error.js +6 -219
- package/lib/compiler/typescript/parser.js +3 -3
- package/lib/compiler/typescript/source.d.ts +2 -2
- package/lib/compiler/typescript/transformers/app_inject.transformer.js +13 -4
- package/lib/compiler/typescript/typescript_compiler.d.ts +3 -3
- package/lib/compiler/typescript/typescript_compiler.js +2 -2
- package/lib/elements/blocks/block.builder.d.ts +7 -4
- package/lib/elements/blocks/block.builder.js +24 -13
- package/lib/elements/blocks/block.js +2 -2
- package/lib/elements/blocks/block.schema.d.ts +12 -9
- package/lib/elements/blocks/block.schema.js +2 -2
- package/lib/elements/blocks/job/internal/machine_job.builder.d.ts +6 -5
- package/lib/elements/blocks/job/internal/machine_job.builder.js +3 -3
- package/lib/elements/blocks/job/internal/resource_job.builder.d.ts +11 -10
- package/lib/elements/blocks/job/internal/resource_job.builder.js +9 -6
- package/lib/elements/blocks/job/internal/resource_job.js +3 -6
- package/lib/elements/blocks/job/job.builder.d.ts +5 -5
- package/lib/elements/blocks/job/job.builder.js +7 -7
- package/lib/elements/blocks/job/job.js +1 -1
- package/lib/elements/blocks/job/job.schema.d.ts +5 -5
- package/lib/elements/blocks/job/job.schema.js +3 -3
- package/lib/elements/blocks/machine/machine.builder.d.ts +2 -2
- package/lib/elements/blocks/machine/machine.builder.js +12 -9
- package/lib/elements/blocks/machine/machine.js +7 -7
- package/lib/elements/blocks/machine/machine.schema.d.ts +23 -23
- package/lib/elements/blocks/machine/machine.schema.js +9 -9
- package/lib/elements/blocks/machine/machine_state.builder.d.ts +1 -0
- package/lib/elements/blocks/machine/machine_state.builder.js +31 -29
- package/lib/elements/blocks/machine/machine_transition.builder.d.ts +2 -2
- package/lib/elements/blocks/machine/machine_transition.builder.js +8 -8
- package/lib/elements/blocks/queue/queue.builder.d.ts +3 -3
- package/lib/elements/blocks/queue/queue.builder.js +3 -3
- package/lib/elements/blocks/queue/queue.schema.d.ts +6 -6
- package/lib/elements/blocks/queue/queue.schema.js +3 -3
- package/lib/elements/blocks/resource/resource.builder.d.ts +2 -2
- package/lib/elements/blocks/resource/resource.builder.js +37 -40
- package/lib/elements/blocks/resource/resource.d.ts +2 -2
- package/lib/elements/blocks/resource/resource.js +10 -18
- package/lib/elements/blocks/resource/resource.schema.d.ts +15 -15
- package/lib/elements/blocks/resource/resource.schema.js +8 -8
- package/lib/elements/blocks/topic/topic.builder.d.ts +2 -2
- package/lib/elements/blocks/topic/topic.builder.js +4 -4
- package/lib/elements/blocks/topic/topic.d.ts +2 -2
- package/lib/elements/blocks/topic/topic.js +7 -7
- package/lib/elements/blocks/topic/topic.schema.d.ts +6 -6
- package/lib/elements/blocks/topic/topic.schema.js +3 -3
- package/lib/elements/edge/controller/adapters/cli.controller_adapter.js +1 -1
- package/lib/elements/edge/controller/adapters/controller_adapter.d.ts +2 -2
- package/lib/elements/edge/controller/adapters/controller_adapter.js +2 -2
- package/lib/elements/edge/controller/controller.builder.d.ts +14 -13
- package/lib/elements/edge/controller/controller.builder.js +52 -42
- package/lib/elements/edge/controller/controller.d.ts +3 -3
- package/lib/elements/edge/controller/controller.js +12 -12
- package/lib/elements/edge/controller/controller.schema.d.ts +17 -16
- package/lib/elements/edge/controller/controller.schema.js +11 -11
- package/lib/elements/edge/externals/externals.builder.d.ts +8 -13
- package/lib/elements/edge/externals/externals.builder.js +43 -11
- package/lib/elements/edge/externals/externals.schema.d.ts +8 -7
- package/lib/elements/edge/externals/externals.schema.js +5 -3
- package/lib/elements/entities/bucket/adapters/browserdb.bucket_adapter.d.ts +45 -0
- package/lib/elements/entities/bucket/adapters/browserdb.bucket_adapter.js +164 -0
- package/lib/elements/entities/bucket/adapters/browserdb.service.d.ts +30 -0
- package/lib/elements/entities/bucket/adapters/browserdb.service.js +97 -0
- package/lib/elements/entities/bucket/adapters/bucket_adapter.d.ts +6 -1
- package/lib/elements/entities/bucket/adapters/bucket_adapter.js +7 -6
- package/lib/elements/entities/bucket/adapters/json.bucket_adapter.d.ts +1 -1
- package/lib/elements/entities/bucket/adapters/json.bucket_adapter.js +1 -0
- package/lib/elements/entities/bucket/adapters/memory.bucket_adapter.d.ts +1 -0
- package/lib/elements/entities/bucket/adapters/memory.bucket_adapter.js +14 -13
- package/lib/elements/entities/bucket/adapters/memory.nql.js +41 -35
- package/lib/elements/entities/bucket/bucket.builder.d.ts +6 -8
- package/lib/elements/entities/bucket/bucket.builder.js +19 -34
- package/lib/elements/entities/bucket/bucket.d.ts +2 -2
- package/lib/elements/entities/bucket/bucket.infer.d.ts +5 -5
- package/lib/elements/entities/bucket/bucket.js +19 -17
- package/lib/elements/entities/bucket/bucket.schema.d.ts +3 -3
- package/lib/elements/entities/bucket/bucket.schema.js +2 -2
- package/lib/elements/entities/bucket/cache/bucket_cache.js +14 -2
- package/lib/elements/entities/bucket/graph/bucket_graph.d.ts +3 -3
- package/lib/elements/entities/bucket/graph/bucket_graph.js +101 -29
- package/lib/elements/entities/bucket/graph/bucket_graph.schema.d.ts +3 -3
- package/lib/elements/entities/bucket/graph/bucket_graph_link.builder.d.ts +2 -2
- package/lib/elements/entities/bucket/graph/bucket_graph_link.builder.js +5 -3
- package/lib/elements/entities/bucket/model/bucket_model.builder.d.ts +2 -1
- package/lib/elements/entities/bucket/model/bucket_model.builder.js +2 -2
- package/lib/elements/entities/bucket/model/bucket_model.convert.js +3 -6
- package/lib/elements/entities/bucket/model/bucket_model.d.ts +13 -0
- package/lib/elements/entities/bucket/model/bucket_model.js +93 -0
- package/lib/elements/entities/bucket/model/bucket_model.schema.d.ts +4 -8
- package/lib/elements/entities/bucket/model/bucket_model.schema.js +0 -68
- package/lib/elements/entities/bucket/model/bucket_model_field.builder.d.ts +12 -4
- package/lib/elements/entities/bucket/model/bucket_model_field.builder.js +30 -33
- package/lib/elements/entities/bucket/query/nql.schema.d.ts +1 -1
- package/lib/elements/entities/bucket/query/nql_compiler.d.ts +8 -4
- package/lib/elements/entities/bucket/query/nql_compiler.js +44 -38
- package/lib/elements/entities/bucket/query/nql_engine.d.ts +1 -1
- package/lib/elements/entities/bucket/query/nql_engine.js +5 -2
- package/lib/elements/entities/bucket/view/bucket_view.builder.d.ts +2 -2
- package/lib/elements/entities/bucket/view/bucket_view.js +113 -81
- package/lib/elements/entities/bucket/view/bucket_view_field.builder.d.ts +9 -8
- package/lib/elements/entities/bucket/view/bucket_view_field.builder.js +8 -10
- package/lib/elements/entities/constants/constants.builder.d.ts +3 -3
- package/lib/elements/entities/constants/constants.builder.js +8 -8
- package/lib/elements/entities/constants/constants.schema.d.ts +8 -3
- package/lib/elements/entities/constants/constants.schema.js +7 -2
- package/lib/elements/entities/message/message.infer.d.ts +1 -5
- package/lib/elements/entities/message/message.js +2 -7
- package/lib/elements/entities/message/message.schema.js +1 -1
- package/lib/elements/entities/message/template/message_template.schema.d.ts +7 -5
- package/lib/elements/entities/message/template/message_template_field.builder.d.ts +18 -3
- package/lib/elements/entities/message/template/message_template_field.builder.js +49 -30
- package/lib/elements/entities/message/template/message_template_parser.js +2 -2
- package/lib/engine/{apps → app}/app.config.d.ts +11 -5
- package/lib/engine/{apps → app}/app.config.js +2 -2
- package/lib/engine/{apps → app}/app.d.ts +3 -2
- package/lib/engine/{apps → app}/app.js +3 -1
- package/lib/engine/{apps/distributed → app}/inc/inc.client.js +1 -1
- package/lib/engine/{apps/distributed → app}/inc/inc.server.js +3 -3
- package/lib/engine/{apps/distributed → app}/inc/sandbox.js +1 -1
- package/lib/engine/{apps → app}/inline.app.d.ts +2 -12
- package/lib/engine/{apps → app}/inline.app.js +37 -34
- package/lib/engine/auth/authn.d.ts +10 -12
- package/lib/engine/auth/zero.authn_provider.d.ts +3 -4
- package/lib/engine/auth/zero.authn_provider.js +0 -1
- package/lib/engine/builder.d.ts +28 -0
- package/lib/engine/builder.js +99 -0
- package/lib/engine/cli/cli.js +3 -2
- package/lib/engine/cli/ui.js +1 -0
- package/lib/engine/daemon.d.ts +28 -25
- package/lib/engine/daemon.js +37 -8
- package/lib/engine/data/error.d.ts +37 -3
- package/lib/engine/data/error.js +58 -16
- package/lib/engine/data/file.d.ts +1 -0
- package/lib/engine/data/file.js +4 -0
- package/lib/engine/dependency.d.ts +53 -81
- package/lib/engine/dependency.js +246 -120
- package/lib/engine/module.d.ts +18 -48
- package/lib/engine/module.js +78 -158
- package/lib/engine/space.d.ts +2 -2
- package/lib/engine/space.js +6 -6
- package/lib/engine/transaction/nodes/bucket.trx_node.d.ts +7 -4
- package/lib/engine/transaction/nodes/bucket.trx_node.js +66 -43
- package/lib/engine/transaction/nodes/bucket_query.trx_node.d.ts +10 -4
- package/lib/engine/transaction/nodes/bucket_query.trx_node.js +56 -45
- package/lib/engine/transaction/nodes/external.trx_node.d.ts +15 -0
- package/lib/engine/transaction/nodes/external.trx_node.js +53 -0
- package/lib/engine/transaction/nodes/job.trx_node.d.ts +7 -3
- package/lib/engine/transaction/nodes/job.trx_node.js +49 -29
- package/lib/engine/transaction/nodes/machine.trx_node.js +6 -6
- package/lib/engine/transaction/nodes/queue.trx_node.js +3 -3
- package/lib/engine/transaction/nodes/resource.trx_node.d.ts +7 -4
- package/lib/engine/transaction/nodes/resource.trx_node.js +68 -51
- package/lib/engine/transaction/nodes/topic.trx_node.js +9 -9
- package/lib/engine/transaction/trx.d.ts +15 -12
- package/lib/engine/transaction/trx.js +19 -3
- package/lib/engine/transaction/trx_engine.config.d.ts +4 -4
- package/lib/engine/transaction/trx_engine.d.ts +25 -7
- package/lib/engine/transaction/trx_engine.js +67 -16
- package/lib/engine/transaction/trx_node.d.ts +25 -21
- package/lib/engine/transaction/trx_node.js +99 -57
- package/lib/engine/tree.d.ts +4 -16
- package/lib/engine/tree.js +87 -57
- package/lib/{compiler → engine}/treeshake.d.ts +32 -32
- package/lib/{compiler → engine}/treeshake.js +272 -242
- package/lib/engine/util/console.js +3 -0
- package/lib/engine/util/crypto.d.ts +4 -3
- package/lib/engine/util/crypto.js +15 -5
- package/lib/engine/util/hash.js +5 -0
- package/lib/engine/util/log.d.ts +6 -8
- package/lib/engine/util/log.js +1 -1
- package/lib/engine/util/name_helpers.d.ts +37 -0
- package/lib/{compiler/helpers → engine/util}/name_helpers.js +33 -0
- package/lib/engine/util/parse.d.ts +4 -3
- package/lib/engine/util/parse.js +13 -28
- package/lib/engine/util/path.d.ts +1 -0
- package/lib/engine/util/path.js +14 -0
- package/lib/engine/util/random.d.ts +4 -0
- package/lib/engine/util/random.js +31 -0
- package/lib/engine/util/type.d.ts +8 -0
- package/lib/schema.d.ts +1 -1
- package/package.json +4 -1
- package/tools/joaquin/bucket.js +1 -1
- package/tools/joaquin/job.js +1 -1
- package/tools/joaquin/message.js +1 -1
- package/tools/joaquin/mock.js +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/lib/compiler/apps/distributed/stages/1_mkdir_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/2_build_typescript_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/3_copy_types_stage.d.ts +0 -15
- package/lib/compiler/apps/distributed/stages/4_dump_modules_stage.d.ts +0 -16
- package/lib/compiler/apps/monolyth/stages/1_mkdir_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/2_build_typescript_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/3_copy_types_stage.d.ts +0 -15
- package/lib/compiler/apps/monolyth/stages/6_dump_cli_stage.d.ts +0 -15
- package/lib/compiler/helpers/name_helpers.d.ts +0 -20
- package/lib/engine/apps/distributed/distributed.app.config.d.ts +0 -44
- package/lib/engine/apps/distributed/elements/distributed_job.d.ts +0 -7
- package/lib/engine/apps/distributed/elements/distributed_job.js +0 -11
- /package/lib/{compiler/apps → bundler}/distributed/stages/5_copy_static_stage.d.ts +0 -0
- /package/lib/{compiler/apps → bundler}/distributed/stages/6_dump_cli_stage.d.ts +0 -0
- /package/lib/{compiler/apps → bundler}/distributed/stages/7_dump_package_json_stage.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/inc.client.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/inc.server.d.ts +0 -0
- /package/lib/engine/{apps/distributed → app}/inc/sandbox.d.ts +0 -0
- /package/lib/engine/{apps → app}/service.d.ts +0 -0
- /package/lib/engine/{apps → app}/service.js +0 -0
|
@@ -1,89 +1,66 @@
|
|
|
1
|
-
import { $Module
|
|
1
|
+
import { $Module } from "../schema";
|
|
2
2
|
import { AnyBuilder, AnyElementSchema } from './module';
|
|
3
3
|
import { Overlay } from './util/type';
|
|
4
4
|
import { JobBuilderNode } from "../elements/blocks/job/job.builder";
|
|
5
5
|
import { MessageBuilderNode } from "../elements/entities/message/message.builder";
|
|
6
6
|
import { ResourceJobBuilderNode } from "../elements/blocks/job/internal/resource_job.builder";
|
|
7
|
-
import { BucketFnExtract, JobFnExtract, MachineFnExtract, MessageFnExtract } from "../compiler/typescript/bridge/organize";
|
|
8
7
|
import { MachineJobBuilderNode } from "../elements/blocks/job/internal/machine_job.builder";
|
|
8
|
+
import { ModuleTree } from './tree';
|
|
9
|
+
import { AnyTrxNode } from './transaction/trx_node';
|
|
10
|
+
export type TagString = `${string}::${string}:${string}`;
|
|
11
|
+
export type ShortTagString = `${string}::${string}`;
|
|
12
|
+
export type TagType = 'constants' | 'constants.enum' | 'constants.value' | 'message' | 'bucket' | 'job' | 'resource' | 'machine' | 'controller' | 'queue' | 'topic' | 'externals';
|
|
13
|
+
import { BucketFnExtract, JobFnExtract, MachineFnExtract, MessageFnExtract } from "../compiler/typescript/bridge/organize";
|
|
14
|
+
import { AnyExternalsBuilder } from "../elements/edge/externals/externals.builder";
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* A tag references an element on a given module.
|
|
17
|
+
* The short form can be used when the type is implicit.
|
|
11
18
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* ```
|
|
15
|
-
* module::type:name
|
|
16
|
-
* module::name
|
|
17
|
-
* type:name
|
|
18
|
-
* name
|
|
19
|
-
* ```
|
|
19
|
+
* module::type:name -> full tag
|
|
20
|
+
* module::name -> short tag
|
|
20
21
|
*
|
|
21
22
|
* @category Engine
|
|
22
23
|
*/
|
|
23
|
-
export declare class
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
static
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
static
|
|
44
|
-
|
|
45
|
-
type: string | undefined;
|
|
46
|
-
name: string;
|
|
47
|
-
};
|
|
24
|
+
export declare class Tag {
|
|
25
|
+
module: string;
|
|
26
|
+
type: TagType;
|
|
27
|
+
name: string;
|
|
28
|
+
full: TagString;
|
|
29
|
+
short: ShortTagString;
|
|
30
|
+
constructor(module: string, type: TagType, name: string);
|
|
31
|
+
static from(tag: TagString): Tag;
|
|
32
|
+
static fromShort(type: TagType, shortTag: ShortTagString): Tag;
|
|
33
|
+
static fromNameOrShort(module: string, type: TagType, nameOrShortTag: string): Tag;
|
|
34
|
+
static get unsafe(): typeof __unsafe_Tag;
|
|
35
|
+
static resolve(self: Tag, tree: ModuleTree): AnyElementSchema;
|
|
36
|
+
static resolveFrom(self: Tag, module: $Module): AnyElementSchema;
|
|
37
|
+
static resolveExternal(self: Tag, externals: AnyExternalsBuilder): Dependency;
|
|
38
|
+
static element(self: Tag, trx: AnyTrxNode): any;
|
|
39
|
+
static matches(self: Tag, other: Tag): boolean;
|
|
40
|
+
static isSameNodeAs(self: Tag, other: Tag): boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare class __unsafe_Tag {
|
|
43
|
+
static from(tag: TagString): any;
|
|
44
|
+
static fromShort(type: TagType, shortTag: ShortTagString): any;
|
|
45
|
+
static fromNameOrShort(module: string, type: TagType, nameOrShortTag: string): any;
|
|
48
46
|
}
|
|
49
47
|
/**
|
|
50
|
-
* A
|
|
48
|
+
* A link between two elements.
|
|
51
49
|
*
|
|
52
50
|
* @category Engine
|
|
53
51
|
*/
|
|
54
|
-
export declare class
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
soft: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* @param fromModule Name of module which uses this dependency
|
|
69
|
-
* @param type Type of referenced element
|
|
70
|
-
* @param name Name of referenced element
|
|
71
|
-
* @param soft True if this doesn't affect build order
|
|
72
|
-
*/
|
|
73
|
-
constructor(fromModule: string, type: BuilderType, name: string, soft?: boolean);
|
|
74
|
-
/**
|
|
75
|
-
* Return the type name (UpperCamel) of the element
|
|
76
|
-
* referenced by a dependency.
|
|
77
|
-
*
|
|
78
|
-
* @param dep A `$Dependency` instance
|
|
79
|
-
* @param fromModule Name of dependant module
|
|
80
|
-
* @returns The type name of the dependency
|
|
81
|
-
*/
|
|
82
|
-
static typeName(dep: $Dependency, fromModule: string): string;
|
|
83
|
-
static resolve(module: $Module, dep: {
|
|
84
|
-
type: string;
|
|
85
|
-
name: string;
|
|
86
|
-
}): import("../elements").$Message | import("../elements").$Machine | import("../elements").$Bucket | import("../elements").$Constants | import("../elements").$Job | import("../elements").$Externals | import("../elements").$Resource | import("../elements").$Controller | undefined;
|
|
52
|
+
export declare class Dependency {
|
|
53
|
+
fromModule: string;
|
|
54
|
+
tag: Tag;
|
|
55
|
+
external: boolean;
|
|
56
|
+
build: boolean;
|
|
57
|
+
compile: boolean;
|
|
58
|
+
runtime: boolean;
|
|
59
|
+
constructor(fromModule: string, tag: Tag, options?: {
|
|
60
|
+
build?: boolean;
|
|
61
|
+
compile?: boolean;
|
|
62
|
+
runtime?: boolean;
|
|
63
|
+
});
|
|
87
64
|
}
|
|
88
65
|
/**
|
|
89
66
|
* A element builder, along with metadata required for building it.
|
|
@@ -91,24 +68,19 @@ export declare class $Dependency {
|
|
|
91
68
|
* @category Engine
|
|
92
69
|
*/
|
|
93
70
|
export declare class BuilderNode {
|
|
94
|
-
|
|
95
|
-
type: BuilderType;
|
|
96
|
-
name: string;
|
|
97
|
-
tag: string;
|
|
71
|
+
tag: Tag;
|
|
98
72
|
isInline?: boolean;
|
|
99
73
|
filepath: string | string[];
|
|
100
|
-
dependencies:
|
|
74
|
+
dependencies: Dependency[];
|
|
101
75
|
builder: AnyBuilder;
|
|
102
76
|
progressive?: {
|
|
103
77
|
schema: AnyElementSchema;
|
|
104
78
|
};
|
|
105
79
|
constructor($: {
|
|
106
|
-
|
|
107
|
-
type: BuilderType;
|
|
108
|
-
name: string;
|
|
80
|
+
tag: Tag;
|
|
109
81
|
isInline?: boolean;
|
|
110
82
|
filepath: string | string[];
|
|
111
|
-
dependencies:
|
|
83
|
+
dependencies: Dependency[];
|
|
112
84
|
builder: AnyBuilder;
|
|
113
85
|
progressive?: {
|
|
114
86
|
schema: AnyElementSchema;
|
|
@@ -122,7 +94,7 @@ export type ResolvedBuilderNode = Overlay<BuilderNode, {
|
|
|
122
94
|
_dependencies?: ResolvedBuilderNode[];
|
|
123
95
|
dependencies: {
|
|
124
96
|
node: ResolvedBuilderNode;
|
|
125
|
-
|
|
97
|
+
dep: Dependency;
|
|
126
98
|
}[];
|
|
127
99
|
inlines: {
|
|
128
100
|
message?: Record<string, MessageBuilderNode>;
|
|
@@ -134,6 +106,6 @@ export type ResolvedBuilderNode = Overlay<BuilderNode, {
|
|
|
134
106
|
bridge?: {
|
|
135
107
|
imports?: string[];
|
|
136
108
|
extract?: BucketFnExtract | MessageFnExtract | JobFnExtract | MachineFnExtract;
|
|
137
|
-
appDependencies?:
|
|
109
|
+
appDependencies?: Dependency[];
|
|
138
110
|
};
|
|
139
111
|
}>;
|
package/lib/engine/dependency.js
CHANGED
|
@@ -1,146 +1,275 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuilderNode = exports
|
|
4
|
-
const
|
|
3
|
+
exports.BuilderNode = exports.Dependency = exports.__unsafe_Tag = exports.Tag = void 0;
|
|
4
|
+
const trx_node_1 = require("./transaction/trx_node");
|
|
5
|
+
/* @nesoi:browser ignore-end */
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* A tag references an element on a given module.
|
|
8
|
+
* The short form can be used when the type is implicit.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* ```
|
|
11
|
-
* module::type:name
|
|
12
|
-
* module::name
|
|
13
|
-
* type:name
|
|
14
|
-
* name
|
|
15
|
-
* ```
|
|
10
|
+
* module::type:name -> full tag
|
|
11
|
+
* module::name -> short tag
|
|
16
12
|
*
|
|
17
13
|
* @category Engine
|
|
18
14
|
*/
|
|
19
|
-
class
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
static
|
|
28
|
-
const match = tag.match(/(
|
|
29
|
-
const module = match?.[1]
|
|
30
|
-
const type = match?.[2]
|
|
15
|
+
class Tag {
|
|
16
|
+
constructor(module, type, name) {
|
|
17
|
+
this.module = module;
|
|
18
|
+
this.type = type;
|
|
19
|
+
this.name = name;
|
|
20
|
+
this.full = `${module}::${type}:${name}`;
|
|
21
|
+
this.short = `${module}::${name}`;
|
|
22
|
+
}
|
|
23
|
+
static from(tag) {
|
|
24
|
+
const match = tag.match(/(.+)::(.+):(.+)/);
|
|
25
|
+
const module = match?.[1];
|
|
26
|
+
const type = match?.[2];
|
|
31
27
|
const name = match?.[3];
|
|
32
|
-
if (!match
|
|
33
|
-
|| (module && module.includes(':'))
|
|
34
|
-
|| (type && type.includes(':'))
|
|
35
|
-
|| !name
|
|
36
|
-
|| name.includes(':')) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
return { module, type, name };
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Parse `module?`, `type?` and `name` from a tag string.
|
|
43
|
-
*
|
|
44
|
-
* @param tag A tag string
|
|
45
|
-
* @returns An object containing the parsed tag info
|
|
46
|
-
* @throws If it's an invalid tag
|
|
47
|
-
*/
|
|
48
|
-
static parseOrFail(tag) {
|
|
49
|
-
const match = tag.match(/(.\w*?::)?(\w*?:)?(.*)/);
|
|
50
28
|
if (!match) {
|
|
51
29
|
throw new Error(`Internal error: Invalid tag ${tag}`);
|
|
52
30
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
throw new Error(`Internal error: Invalid tag ${tag}, module ${module} includes invalid characters`);
|
|
31
|
+
if (!module) {
|
|
32
|
+
throw new Error(`Internal error: Invalid tag ${tag}, no module specified`);
|
|
56
33
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
throw new Error(`Internal error: Invalid tag ${tag}, type ${type} includes invalid characters`);
|
|
34
|
+
if (!type) {
|
|
35
|
+
throw new Error(`Internal error: Invalid tag ${tag}, no type specified`);
|
|
60
36
|
}
|
|
61
|
-
const name = match[3];
|
|
62
37
|
if (!name) {
|
|
63
38
|
throw new Error(`Internal error: Invalid tag ${tag}, no name specified`);
|
|
64
39
|
}
|
|
40
|
+
if (module.includes(':')) {
|
|
41
|
+
throw new Error(`Internal error: Invalid tag ${tag}, module ${module} includes invalid characters`);
|
|
42
|
+
}
|
|
43
|
+
if (type.includes(':')) {
|
|
44
|
+
throw new Error(`Internal error: Invalid tag ${tag}, type ${type} includes invalid characters`);
|
|
45
|
+
}
|
|
65
46
|
if (name.includes(':')) {
|
|
66
47
|
throw new Error(`Internal error: Invalid tag ${tag}, name ${name} includes invalid characters`);
|
|
67
48
|
}
|
|
68
|
-
|
|
49
|
+
// TODO: validate type?
|
|
50
|
+
return new Tag(module, type, name);
|
|
51
|
+
}
|
|
52
|
+
static fromShort(type, shortTag) {
|
|
53
|
+
const match = shortTag.match(/(.+)::(.*)/);
|
|
54
|
+
const module = match?.[1];
|
|
55
|
+
const name = match?.[2];
|
|
56
|
+
if (!match) {
|
|
57
|
+
throw new Error(`Internal error: Invalid short tag ${shortTag}`);
|
|
58
|
+
}
|
|
59
|
+
if (!module) {
|
|
60
|
+
throw new Error(`Internal error: Invalid short tag ${shortTag}, no module specified`);
|
|
61
|
+
}
|
|
62
|
+
if (!name) {
|
|
63
|
+
throw new Error(`Internal error: Invalid short tag ${shortTag}, no name specified`);
|
|
64
|
+
}
|
|
65
|
+
if (module.includes(':')) {
|
|
66
|
+
throw new Error(`Internal error: Invalid short tag ${shortTag}, module ${module} includes invalid characters`);
|
|
67
|
+
}
|
|
68
|
+
if (name.includes(':')) {
|
|
69
|
+
throw new Error(`Internal error: Invalid short tag ${shortTag}, name ${name} includes invalid characters`);
|
|
70
|
+
}
|
|
71
|
+
return new Tag(module, type, name);
|
|
72
|
+
}
|
|
73
|
+
static fromNameOrShort(module, type, nameOrShortTag) {
|
|
74
|
+
const match = nameOrShortTag.match(/((.+)::)?(.*)/);
|
|
75
|
+
const tagModule = match?.[2];
|
|
76
|
+
module = tagModule ?? module;
|
|
77
|
+
const name = match?.[3];
|
|
78
|
+
if (!match) {
|
|
79
|
+
throw new Error(`Internal error: Invalid name or short tag ${nameOrShortTag}`);
|
|
80
|
+
}
|
|
81
|
+
if (!name) {
|
|
82
|
+
throw new Error(`Internal error: Invalid name or short tag ${nameOrShortTag}, no name specified`);
|
|
83
|
+
}
|
|
84
|
+
if (name.includes(':')) {
|
|
85
|
+
throw new Error(`Internal error: Invalid name or short tag ${nameOrShortTag}, name ${name} includes invalid characters`);
|
|
86
|
+
}
|
|
87
|
+
return new Tag(module, type, name);
|
|
88
|
+
}
|
|
89
|
+
static get unsafe() {
|
|
90
|
+
return __unsafe_Tag;
|
|
91
|
+
}
|
|
92
|
+
//
|
|
93
|
+
static resolve(self, tree) {
|
|
94
|
+
const module = tree.modules[self.module];
|
|
95
|
+
if (!module) {
|
|
96
|
+
throw new Error(`Module ${self.module} is not an option to resolve the Tag`);
|
|
97
|
+
}
|
|
98
|
+
return this.resolveFrom(self, module.schema);
|
|
99
|
+
}
|
|
100
|
+
static resolveFrom(self, module) {
|
|
101
|
+
if (self.module !== module.name) {
|
|
102
|
+
throw new Error(`Schema with tag ${self.full} does not belong to module ${module.name}`);
|
|
103
|
+
}
|
|
104
|
+
if (self.type === 'constants')
|
|
105
|
+
return module.constants;
|
|
106
|
+
if (self.type === 'constants.enum')
|
|
107
|
+
return module.constants.enums[self.name];
|
|
108
|
+
if (self.type === 'constants.value')
|
|
109
|
+
return module.constants.values[self.name];
|
|
110
|
+
if (self.type === 'externals')
|
|
111
|
+
return module.externals;
|
|
112
|
+
if (self.type === 'bucket')
|
|
113
|
+
return module.buckets[self.name];
|
|
114
|
+
if (self.type === 'message')
|
|
115
|
+
return module.messages[self.name];
|
|
116
|
+
if (self.type === 'job')
|
|
117
|
+
return module.jobs[self.name];
|
|
118
|
+
if (self.type === 'resource')
|
|
119
|
+
return module.resources[self.name];
|
|
120
|
+
if (self.type === 'machine')
|
|
121
|
+
return module.machines[self.name];
|
|
122
|
+
if (self.type === 'controller')
|
|
123
|
+
return module.controllers[self.name];
|
|
124
|
+
throw new Error(`Schema with tag ${self.full} not found on module ${module.name}`);
|
|
125
|
+
}
|
|
126
|
+
static resolveExternal(self, externals) {
|
|
127
|
+
if (self.type === 'constants.enum') {
|
|
128
|
+
const enums = externals.enums;
|
|
129
|
+
return enums[self.short];
|
|
130
|
+
}
|
|
131
|
+
if (self.type === 'constants.value') {
|
|
132
|
+
const values = externals.values;
|
|
133
|
+
return values[self.short];
|
|
134
|
+
}
|
|
135
|
+
if (self.type === 'bucket') {
|
|
136
|
+
const buckets = externals.buckets;
|
|
137
|
+
return buckets[self.short];
|
|
138
|
+
}
|
|
139
|
+
if (self.type === 'message') {
|
|
140
|
+
const messages = externals.messages;
|
|
141
|
+
return messages[self.short];
|
|
142
|
+
}
|
|
143
|
+
if (self.type === 'job') {
|
|
144
|
+
const jobs = externals.jobs;
|
|
145
|
+
return jobs[self.short];
|
|
146
|
+
}
|
|
147
|
+
if (self.type === 'machine') {
|
|
148
|
+
const machines = externals.machines;
|
|
149
|
+
return machines[self.short];
|
|
150
|
+
}
|
|
151
|
+
const module = externals.module;
|
|
152
|
+
throw new Error(`External tag ${self.full} not found on module ${module}`);
|
|
153
|
+
}
|
|
154
|
+
static element(self, trx) {
|
|
155
|
+
const module = trx_node_1.TrxNode.getModule(trx);
|
|
156
|
+
if (self.module !== module.name) {
|
|
157
|
+
throw new Error(`Element with tag ${self.full} does not belong to module ${module.name}`);
|
|
158
|
+
}
|
|
159
|
+
if (self.type === 'constants')
|
|
160
|
+
return module.schema.constants;
|
|
161
|
+
if (self.type === 'constants.enum')
|
|
162
|
+
return module.schema.constants.enums[self.name];
|
|
163
|
+
if (self.type === 'constants.value')
|
|
164
|
+
return module.schema.constants.values[self.name];
|
|
165
|
+
if (self.type === 'externals')
|
|
166
|
+
return module.schema.externals;
|
|
167
|
+
if (self.type === 'bucket')
|
|
168
|
+
return module.buckets[self.name];
|
|
169
|
+
if (self.type === 'message')
|
|
170
|
+
return module.messages[self.name];
|
|
171
|
+
if (self.type === 'job')
|
|
172
|
+
return module.jobs[self.name];
|
|
173
|
+
if (self.type === 'resource')
|
|
174
|
+
return module.resources[self.name];
|
|
175
|
+
if (self.type === 'machine')
|
|
176
|
+
return module.machines[self.name];
|
|
177
|
+
if (self.type === 'controller')
|
|
178
|
+
return module.controllers[self.name];
|
|
179
|
+
throw new Error(`Element with tag ${self.full} not found on module ${module.name}`);
|
|
180
|
+
}
|
|
181
|
+
static matches(self, other) {
|
|
182
|
+
if (self.module !== other.module)
|
|
183
|
+
return false;
|
|
184
|
+
if (self.type !== other.type)
|
|
185
|
+
return false;
|
|
186
|
+
if (self.name !== other.name)
|
|
187
|
+
return false;
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
static isSameNodeAs(self, other) {
|
|
191
|
+
if (self.module !== other.module)
|
|
192
|
+
return false;
|
|
193
|
+
if (self.type === 'constants') {
|
|
194
|
+
if (!other.type.startsWith('constants'))
|
|
195
|
+
return false;
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
if (other.type === 'constants') {
|
|
199
|
+
if (!self.type.startsWith('constants'))
|
|
200
|
+
return false;
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
if (self.type !== other.type)
|
|
204
|
+
return false;
|
|
205
|
+
if (self.name !== other.name)
|
|
206
|
+
return false;
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.Tag = Tag;
|
|
211
|
+
class __unsafe_Tag {
|
|
212
|
+
static from(tag) {
|
|
213
|
+
const match = tag.match(/(\w+)::([\w.]+):(\w*)/);
|
|
214
|
+
const module = match?.[1];
|
|
215
|
+
const type = match?.[2];
|
|
216
|
+
const name = match?.[3];
|
|
217
|
+
if (!match
|
|
218
|
+
|| !module
|
|
219
|
+
|| !type
|
|
220
|
+
|| !name
|
|
221
|
+
|| module.includes(':')
|
|
222
|
+
|| type.includes(':')
|
|
223
|
+
|| name.includes(':')) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
// TODO: validate type?
|
|
227
|
+
return new Tag(module, type, name);
|
|
228
|
+
}
|
|
229
|
+
static fromShort(type, shortTag) {
|
|
230
|
+
const match = shortTag.match(/(\w+)::(\w*)/);
|
|
231
|
+
const module = match?.[1];
|
|
232
|
+
const name = match?.[2];
|
|
233
|
+
if (!match
|
|
234
|
+
|| !module
|
|
235
|
+
|| !name
|
|
236
|
+
|| module.includes(':')
|
|
237
|
+
|| name.includes(':')) {
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
return new Tag(module, type, name);
|
|
241
|
+
}
|
|
242
|
+
static fromNameOrShort(module, type, nameOrShortTag) {
|
|
243
|
+
const match = nameOrShortTag.match(/((\w+)::)?(\w*)/);
|
|
244
|
+
const tagModule = match?.[1];
|
|
245
|
+
module = tagModule ?? module;
|
|
246
|
+
const name = match?.[3];
|
|
247
|
+
if (!match
|
|
248
|
+
|| !name
|
|
249
|
+
|| name.includes(':')) {
|
|
250
|
+
return undefined;
|
|
251
|
+
}
|
|
252
|
+
return new Tag(module, type, name);
|
|
69
253
|
}
|
|
70
254
|
}
|
|
71
|
-
exports
|
|
255
|
+
exports.__unsafe_Tag = __unsafe_Tag;
|
|
72
256
|
/**
|
|
73
|
-
* A
|
|
257
|
+
* A link between two elements.
|
|
74
258
|
*
|
|
75
259
|
* @category Engine
|
|
76
260
|
*/
|
|
77
|
-
class
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.type = type;
|
|
86
|
-
this.soft = soft;
|
|
87
|
-
const parsed = $Tag.parseOrFail(name);
|
|
88
|
-
this.name = parsed.name;
|
|
89
|
-
if (parsed.module) {
|
|
90
|
-
this.module = parsed.module;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.module = fromModule;
|
|
94
|
-
}
|
|
95
|
-
this.tag = `${this.module}::${this.type}:${this.name}`;
|
|
96
|
-
if (this.module === fromModule) {
|
|
97
|
-
this.refName = this.name;
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
this.refName = `${this.module}::${this.name}`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Return the type name (UpperCamel) of the element
|
|
105
|
-
* referenced by a dependency.
|
|
106
|
-
*
|
|
107
|
-
* @param dep A `$Dependency` instance
|
|
108
|
-
* @param fromModule Name of dependant module
|
|
109
|
-
* @returns The type name of the dependency
|
|
110
|
-
*/
|
|
111
|
-
static typeName(dep, fromModule) {
|
|
112
|
-
if (dep.module !== fromModule) {
|
|
113
|
-
const moduleHigh = name_helpers_1.NameHelpers.nameLowToHigh(dep.module);
|
|
114
|
-
// WARN: this might break non-regular plural block names in the future
|
|
115
|
-
const el_t = dep.type + 's';
|
|
116
|
-
return `${moduleHigh}Module['${el_t}']['${dep.name}']`;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
return name_helpers_1.NameHelpers
|
|
120
|
-
.names({ $t: dep.type, name: dep.name })
|
|
121
|
-
.type;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
static resolve(module, dep) {
|
|
125
|
-
if (dep.type === 'constants')
|
|
126
|
-
return module.constants;
|
|
127
|
-
if (dep.type === 'externals')
|
|
128
|
-
return module.externals;
|
|
129
|
-
if (dep.type === 'bucket')
|
|
130
|
-
return module.buckets[dep.name];
|
|
131
|
-
if (dep.type === 'message')
|
|
132
|
-
return module.messages[dep.name];
|
|
133
|
-
if (dep.type === 'job')
|
|
134
|
-
return module.jobs[dep.name];
|
|
135
|
-
if (dep.type === 'resource')
|
|
136
|
-
return module.resources[dep.name];
|
|
137
|
-
if (dep.type === 'machine')
|
|
138
|
-
return module.machines[dep.name];
|
|
139
|
-
if (dep.type === 'controller')
|
|
140
|
-
return module.controllers[dep.name];
|
|
261
|
+
class Dependency {
|
|
262
|
+
constructor(fromModule, tag, options) {
|
|
263
|
+
this.fromModule = fromModule;
|
|
264
|
+
this.tag = tag;
|
|
265
|
+
this.external = tag.module !== fromModule;
|
|
266
|
+
this.build = options?.build || false;
|
|
267
|
+
this.compile = options?.compile || false;
|
|
268
|
+
this.runtime = options?.runtime || false;
|
|
141
269
|
}
|
|
142
270
|
}
|
|
143
|
-
exports
|
|
271
|
+
exports.Dependency = Dependency;
|
|
272
|
+
// Compiler
|
|
144
273
|
/**
|
|
145
274
|
* A element builder, along with metadata required for building it.
|
|
146
275
|
*
|
|
@@ -148,10 +277,7 @@ exports.$Dependency = $Dependency;
|
|
|
148
277
|
*/
|
|
149
278
|
class BuilderNode {
|
|
150
279
|
constructor($) {
|
|
151
|
-
this.
|
|
152
|
-
this.type = $.type;
|
|
153
|
-
this.name = $.name;
|
|
154
|
-
this.tag = `${this.module}::${this.type}:${this.name}`;
|
|
280
|
+
this.tag = $.tag;
|
|
155
281
|
this.isInline = $.isInline;
|
|
156
282
|
this.filepath = $.filepath;
|
|
157
283
|
this.dependencies = $.dependencies;
|