motoko 3.0.0-beta4 → 3.0.0-beta5
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 +2 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -6
- package/lib/index.js.map +1 -1
- package/lib/versions/interpreter.d.ts +2 -2
- package/lib/versions/interpreter.d.ts.map +1 -1
- package/lib/versions/interpreter.js +1 -1
- package/lib/versions/interpreter.js.map +1 -1
- package/lib/versions/moc.d.ts +2 -2
- package/lib/versions/moc.d.ts.map +1 -1
- package/lib/versions/moc.js +1 -1
- package/lib/versions/moc.js.map +1 -1
- package/package.json +1 -1
- package/packages/latest/base.json +1 -1
- package/src/index.ts +5 -8
- package/src/versions/interpreter.ts +1 -1
- package/src/versions/moc.ts +1 -1
- package/versions/latest/moc.min.js +1 -1
- package/versions/latest/moc_interpreter.min.js +1 -1
package/src/index.ts
CHANGED
@@ -28,15 +28,11 @@ export type Diagnostic = {
|
|
28
28
|
|
29
29
|
export type WasmMode = 'ic' | 'wasi';
|
30
30
|
|
31
|
-
export default function wrapMotoko(compiler: Compiler
|
31
|
+
export default function wrapMotoko(compiler: Compiler) {
|
32
|
+
const version = compiler.version || '(unknown)';
|
32
33
|
const debug = require('debug')(`motoko:${version}`);
|
33
34
|
|
34
35
|
const invoke = (key: string, unwrap: boolean, args: any[]) => {
|
35
|
-
if (!compiler) {
|
36
|
-
throw new Error(
|
37
|
-
'Please load a Motoko compiler before running this function',
|
38
|
-
);
|
39
|
-
}
|
40
36
|
if (typeof compiler[key] !== 'function') {
|
41
37
|
throw new Error(`Unknown compiler function: '${key}'`);
|
42
38
|
}
|
@@ -143,8 +139,9 @@ export default function wrapMotoko(compiler: Compiler, version: string) {
|
|
143
139
|
validatePackage(pkg: Package) {
|
144
140
|
validatePackage(pkg);
|
145
141
|
},
|
146
|
-
setAliases(aliases: Record<string, string>) {
|
147
|
-
debug('aliases', aliases);
|
142
|
+
setAliases(directory: string, aliases: Record<string, string>) {
|
143
|
+
debug('aliases', directory, aliases);
|
144
|
+
invoke('setCandidPath', false, [directory]);
|
148
145
|
invoke('setActorAliases', false, [Object.entries(aliases)]);
|
149
146
|
},
|
150
147
|
setMetadata(values: string) {
|
package/src/versions/moc.ts
CHANGED