Skip to content

Commit

Permalink
build: fix JS build
Browse files Browse the repository at this point in the history
  • Loading branch information
bpowers committed May 17, 2024
1 parent 4a4bfc5 commit ebf15e8
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 83 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"clean": "yarn workspaces run clean",
"deploy": "export NODE_ENV=production && yarn clean && yarn build && yarn workspace @system-dynamics/app deploy && gcloud app deploy ./.app.prod.yaml && yarn workspace @system-dynamics/app deploy-clean",
"start": "node src/server/lib"
}
},
"dependencies": {}
}
80 changes: 48 additions & 32 deletions src/core/datamodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,54 @@ import { canonicalize } from './canonicalize';
export type UID = number;

export enum ErrorCode {
NoError,
DoesNotExist,
XmlDeserialization,
VensimConversion,
ProtobufDecode,
InvalidToken,
UnrecognizedEOF,
UnrecognizedToken,
ExtraToken,
UnclosedComment,
UnclosedQuotedIdent,
ExpectedNumber,
UnknownBuiltin,
BadBuiltinArgs,
EmptyEquation,
BadModuleInputDst,
BadModuleInputSrc,
NotSimulatable,
BadTable,
BadSimSpecs,
NoAbsoluteReferences,
CircularDependency,
ArraysNotImplemented,
MultiDimensionalArraysNotImplemented,
BadDimensionName,
BadModelName,
MismatchedDimensions,
ArrayReferenceNeedsExplicitSubscripts,
DuplicateVariable,
UnknownDependency,
VariablesHaveErrors,
Generic,
NoError = 0,
DoesNotExist = 1,
XmlDeserialization = 2,
VensimConversion = 3,
ProtobufDecode = 4,
InvalidToken = 5,
UnrecognizedEof = 6,
UnrecognizedToken = 7,
ExtraToken = 8,
UnclosedComment = 9,
UnclosedQuotedIdent = 10,
ExpectedNumber = 11,
UnknownBuiltin = 12,
BadBuiltinArgs = 13,
EmptyEquation = 14,
BadModuleInputDst = 15,
BadModuleInputSrc = 16,
NotSimulatable = 17,
BadTable = 18,
BadSimSpecs = 19,
NoAbsoluteReferences = 20,
CircularDependency = 21,
ArraysNotImplemented = 22,
MultiDimensionalArraysNotImplemented = 23,
BadDimensionName = 24,
BadModelName = 25,
MismatchedDimensions = 26,
ArrayReferenceNeedsExplicitSubscripts = 27,
DuplicateVariable = 28,
UnknownDependency = 29,
VariablesHaveErrors = 30,
UnitDefinitionErrors = 31,
Generic = 32,
NoAppInUnits = 33,
NoSubscriptInUnits = 34,
NoIfInUnits = 35,
NoUnaryOpInUnits = 36,
BadBinaryOpInUnits = 37,
NoConstInUnits = 38,
ExpectedInteger = 39,
ExpectedIntegerOne = 40,
DuplicateUnit = 41,
ExpectedModule = 42,
ExpectedIdent = 43,
UnitMismatch = 44,
TodoWildcard = 45,
TodoStarRange = 46,
TodoRange = 47,
}

const equationErrorDefaults = {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/error_codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function errorCodeDescription(code: ErrorCode): string {
return 'Internal error (protocol buffer decoding)';
case ErrorCode.InvalidToken:
return 'Invalid input in equation';
case ErrorCode.UnrecognizedEOF:
case ErrorCode.UnrecognizedEof:
return 'Unexpectedly reached the end of the equation';
case ErrorCode.UnrecognizedToken:
return 'Unrecognized input in equation';
Expand Down
93 changes: 48 additions & 45 deletions src/engine/iengine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,49 +221,52 @@ export enum ErrorKind {
}

export enum ErrorCode {
NoError, // will never be produced
DoesNotExist, // the named entity doesn't exist
XmlDeserialization,
VensimConversion,
ProtobufDecode,
InvalidToken,
UnrecognizedEOF,
UnrecognizedToken,
ExtraToken,
UnclosedComment,
UnclosedQuotedIdent,
ExpectedNumber,
UnknownBuiltin,
BadBuiltinArgs,
EmptyEquation,
BadModuleInputDst,
BadModuleInputSrc,
NotSimulatable,
BadTable,
BadSimSpecs,
NoAbsoluteReferences,
CircularDependency,
ArraysNotImplemented,
MultiDimensionalArraysNotImplemented,
BadDimensionName,
BadModelName,
MismatchedDimensions,
ArrayReferenceNeedsExplicitSubscripts,
DuplicateVariable,
UnknownDependency,
VariablesHaveErrors,
UnitDefinitionErrors,
Generic,
NoAppInUnits,
NoSubscriptInUnits,
NoIfInUnits,
NoUnaryOpInUnits,
BadBinaryOpInUnits,
NoConstInUnits,
ExpectedInteger,
ExpectedIntegerOne,
DuplicateUnit,
ExpectedModule,
ExpectedIdent,
UnitMismatch,
NoError = 0,
DoesNotExist = 1,
XmlDeserialization = 2,
VensimConversion = 3,
ProtobufDecode = 4,
InvalidToken = 5,
UnrecognizedEof = 6,
UnrecognizedToken = 7,
ExtraToken = 8,
UnclosedComment = 9,
UnclosedQuotedIdent = 10,
ExpectedNumber = 11,
UnknownBuiltin = 12,
BadBuiltinArgs = 13,
EmptyEquation = 14,
BadModuleInputDst = 15,
BadModuleInputSrc = 16,
NotSimulatable = 17,
BadTable = 18,
BadSimSpecs = 19,
NoAbsoluteReferences = 20,
CircularDependency = 21,
ArraysNotImplemented = 22,
MultiDimensionalArraysNotImplemented = 23,
BadDimensionName = 24,
BadModelName = 25,
MismatchedDimensions = 26,
ArrayReferenceNeedsExplicitSubscripts = 27,
DuplicateVariable = 28,
UnknownDependency = 29,
VariablesHaveErrors = 30,
UnitDefinitionErrors = 31,
Generic = 32,
NoAppInUnits = 33,
NoSubscriptInUnits = 34,
NoIfInUnits = 35,
NoUnaryOpInUnits = 36,
BadBinaryOpInUnits = 37,
NoConstInUnits = 38,
ExpectedInteger = 39,
ExpectedIntegerOne = 40,
DuplicateUnit = 41,
ExpectedModule = 42,
ExpectedIdent = 43,
UnitMismatch = 44,
TodoWildcard = 45,
TodoStarRange = 46,
TodoRange = 47,
}
16 changes: 12 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@
"@docusaurus/theme-search-algolia" "2.4.1"
"@docusaurus/types" "2.4.1"

"@docusaurus/[email protected]", "react-loadable@npm:@docusaurus/[email protected]":
"@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
Expand Down Expand Up @@ -4720,9 +4720,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001489:
version "1.0.30001492"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001492.tgz#4a06861788a52b4c81fd3344573b68cc87fe062b"
integrity sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw==
version "1.0.30001620"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz"
integrity sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==

cardinal@^2.1.1:
version "2.1.1"
Expand Down Expand Up @@ -11056,6 +11056,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"

"react-loadable@npm:@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
dependencies:
"@types/react" "*"
prop-types "^15.6.2"

react-refresh@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046"
Expand Down

0 comments on commit ebf15e8

Please sign in to comment.