diff --git a/src/check.ts b/src/check.ts index 264f61f80..9195c9be2 100644 --- a/src/check.ts +++ b/src/check.ts @@ -25,7 +25,7 @@ export type CheckResult = { export function check(args: { project: VirtualFileSystem, entrypoint: string }): CheckResult { // Create context - let stdlib = createVirtualFileSystem('@stdlib', files); + let stdlib = createVirtualFileSystem('@stdlib/', files); let ctx: CompilerContext = new CompilerContext({ shared: {} }); ctx = featureEnable(ctx, 'debug'); // Enable debug flag (does not affect type checking in practice) ctx = featureEnable(ctx, 'masterchain'); // Enable masterchain flag to avoid masterchain-specific errors diff --git a/src/node.ts b/src/node.ts index f7aa0bdef..d2f25cbce 100644 --- a/src/node.ts +++ b/src/node.ts @@ -46,7 +46,7 @@ export async function run(args: { configPath: string, projectNames?: string[] }) // Compile let success = true; let project = createNodeFileSystem(rootPath, false); - let stdlib = path.resolve(__dirname, '..', 'stdlib'); // Improves developer experience + let stdlib = path.resolve(__dirname, '..', 'stdlib') + path.sep; // Improves developer experience for (let config of projects) { console.log('💼 Compiling project ' + config.name + '...'); let built = await build({ config, project, stdlib, logger: consoleLogger }); diff --git a/src/vfs/createVirtualFileSystem.ts b/src/vfs/createVirtualFileSystem.ts index e578b161a..e6c57dd4d 100644 --- a/src/vfs/createVirtualFileSystem.ts +++ b/src/vfs/createVirtualFileSystem.ts @@ -3,9 +3,6 @@ import { VirtualFileSystem } from "./VirtualFileSystem"; export function createVirtualFileSystem(root: string, fs: { [key: string]: string }, readonly: boolean = true): VirtualFileSystem { let normalizedRoot = normalize(root); - if (!normalizedRoot.endsWith('/')) { - normalizedRoot += '/'; - } return { root: normalizedRoot, exists(filePath: string): boolean { @@ -25,7 +22,7 @@ export function createVirtualFileSystem(root: string, fs: { [key: string]: strin let name = filePath.slice(normalizedRoot.length); let content = fs[name]; if (typeof content !== 'string') { - throw Error('File not found: ' + filePath); + throw Error(`File ${name} not found at ${filePath}`); } else { return Buffer.from(content, 'base64'); }