Skip to content

Commit

Permalink
Added toRef to BasicDataType and use es2022 as build output format
Browse files Browse the repository at this point in the history
  • Loading branch information
wolflu05 committed Dec 11, 2023
1 parent d1d88c6 commit e4f4ed6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export abstract class BasicDataType {
return this.name;
}

toRef() {
return `<${this.constructor.name}: ${this.toString()}>`
}

throwNotImplemented(name: string): never {
this.emitter.braingoat.throwError(
ErrorType.CompileError,
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/Emitter/Emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class Emitter {
else {
this.braingoat.throwError(
ErrorType.CompileError,
`cannot assign expression result to ${typeof variable}`,
`cannot assign expression result to ${variable.toRef()}`,
expression.source,
);
}
Expand Down
8 changes: 0 additions & 8 deletions packages/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,4 @@ import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
optimizeDeps: {
include: ["@braingoat/compiler"],
},
build: {
commonjsOptions: {
include: [/compiler/, /node_modules/]
}
}
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
"module": "commonjs" /* Specify what module code is generated. */,
"module": "ES2022" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down

0 comments on commit e4f4ed6

Please sign in to comment.