Skip to content

Commit 587fc17

Browse files
Merge pull request #318 from code0-tech/renovate/code0-tech-tucana-0.x
Update dependency @code0-tech/tucana to v0.0.68
2 parents 1fcbd47 + 2b15c08 commit 587fc17

4 files changed

Lines changed: 32 additions & 18 deletions

File tree

package/reader/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/reader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"access": "public"
2929
},
3030
"dependencies": {
31-
"@code0-tech/tucana": "0.0.59",
31+
"@code0-tech/tucana": "0.0.68",
3232
"@protobuf-ts/runtime": "^2.11.1",
3333
"@protobuf-ts/runtime-rpc": "^2.11.1",
3434
"vite-plugin-dts": "^4.5.4"

package/reader/src/index.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import {readdir, readFile} from "node:fs/promises";
22
import {join, extname} from "node:path";
3-
4-
import {FlowType} from "@code0-tech/tucana/pb/shared.flow_definition_pb.js";
5-
import {RuntimeFunctionDefinition} from "@code0-tech/tucana/pb/shared.runtime_function_pb.js";
6-
import {DefinitionDataType} from "@code0-tech/tucana/pb/shared.data_type_pb.js";
3+
import {DefinitionDataType, FlowType, FunctionDefinition, RuntimeFunctionDefinition} from "@code0-tech/tucana/shared";
74

85
export const enum MetaType {
96
FlowType = "FlowType",
107
DataType = "DataType",
118
RuntimeFunction = "RuntimeFunction",
9+
Function = "Function"
1210
}
1311

1412
export interface DefinitionError {
@@ -22,6 +20,7 @@ export interface Feature {
2220
data_types: DefinitionDataType[];
2321
flow_types: FlowType[];
2422
runtime_functions: RuntimeFunctionDefinition[];
23+
functions: FunctionDefinition[];
2524
errors: DefinitionError[];
2625
}
2726

@@ -58,14 +57,16 @@ const toMetaType = (folder: string): MetaType | null =>
5857
({
5958
flow_type: MetaType.FlowType,
6059
data_type: MetaType.DataType,
61-
runtime_definition: MetaType.RuntimeFunction
60+
runtime_definition: MetaType.RuntimeFunction,
61+
function: MetaType.Function,
6262
} as const)[folder] ?? null;
6363

6464
const emptyFeature = (name: string): Feature => ({
6565
name,
6666
data_types: [],
6767
flow_types: [],
6868
runtime_functions: [],
69+
functions: [],
6970
errors: [],
7071
});
7172

@@ -93,9 +94,22 @@ const collectJsonFiles = async (dir: string): Promise<string[]> => {
9394

9495
const addDefinition = (feature: Feature, def: string, type: MetaType) => {
9596
try {
96-
if (type === MetaType.DataType) feature.data_types.push(DefinitionDataType.fromJsonString(def));
97-
else if (type === MetaType.FlowType) feature.flow_types.push(FlowType.fromJsonString(def));
98-
else feature.runtime_functions.push(RuntimeFunctionDefinition.fromJsonString(def));
97+
switch (type) {
98+
case MetaType.DataType:
99+
feature.data_types.push(DefinitionDataType.fromJsonString(def));
100+
break
101+
case MetaType.FlowType:
102+
feature.flow_types.push(FlowType.fromJsonString(def));
103+
break
104+
case MetaType.RuntimeFunction:
105+
feature.runtime_functions.push(RuntimeFunctionDefinition.fromJsonString(def));
106+
break
107+
case MetaType.Function:
108+
feature.functions.push(FunctionDefinition.fromJsonString(def));
109+
break
110+
default:
111+
throw new Error(`Unknown MetaType: ${type}`);
112+
}
99113
} catch (err) {
100114
feature.errors.push({
101115
definition: extractIdentifier(def, type),

package/reader/tsconfig.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"exclude": ["node_modules", "build", "dist"],
3-
"include": ["node_modules/@code0-tech/tucana/pb/**/*.ts"],
3+
"include": ["src/**/*"],
44
"types": [
55
"typePatches"
66
],
77
"compilerOptions": {
8-
"lib": ["ESNext"],
9-
"module": "NodeNext",
10-
"target": "ESNext",
8+
"lib": ["es2020"],
9+
"module": "commonjs",
10+
"target": "es2020",
1111
"skipLibCheck": true,
1212
"strict": true,
1313
"paths": {
@@ -17,7 +17,7 @@
1717
},
1818
"baseUrl": "src/",
1919
"sourceMap": true,
20-
"moduleResolution": "nodenext",
20+
"moduleResolution": "bundler",
2121
"declaration": true,
2222
"emitDeclarationOnly": true,
2323
"esModuleInterop": true,

0 commit comments

Comments
 (0)