functionalscript 0.6.1 → 0.6.3

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/dev/module.f.js CHANGED
@@ -33,7 +33,7 @@ export const loadModuleMap = async (io) => {
33
33
  for (const f of await allFiles(io)) {
34
34
  if (f.endsWith('.f.js') ||
35
35
  (f.endsWith('.f.ts') && !existsSync(f.substring(0, f.length - 3) + '.js'))) {
36
- const source = await asyncImport(`../${f}`);
36
+ const source = await asyncImport(f);
37
37
  map = [...map, [f, source]];
38
38
  }
39
39
  }
package/io/module.f.d.ts CHANGED
@@ -80,6 +80,7 @@ export type Process = {
80
80
  readonly argv: string[];
81
81
  readonly env: Env;
82
82
  readonly exit: (code: number) => never;
83
+ readonly cwd: () => string;
83
84
  };
84
85
  /**
85
86
  * The environment variables.
package/io/module.f.js CHANGED
@@ -5,7 +5,7 @@
5
5
  export const run = (io) => {
6
6
  const code = ([x, b]) => {
7
7
  if (x === 'error') {
8
- io.console.error(x[1]);
8
+ io.console.error(b);
9
9
  return 1;
10
10
  }
11
11
  else {
package/io/module.js CHANGED
@@ -9,11 +9,13 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
9
9
  import { run } from "./module.f.js";
10
10
  import fs from 'node:fs';
11
11
  import process from "node:process";
12
+ import { concat } from "../path/module.f.js";
13
+ const prefix = 'file:///';
12
14
  export const io = {
13
15
  console,
14
16
  fs,
15
17
  process,
16
- asyncImport: (v) => import(__rewriteRelativeImportExtension(v)),
18
+ asyncImport: (v) => import(__rewriteRelativeImportExtension(`${prefix}${concat(process.cwd())(v)}`)),
17
19
  performance,
18
20
  tryCatch: f => {
19
21
  try {
package/io/virtual.f.js CHANGED
@@ -21,6 +21,7 @@ export const createVirtualIo = (files) => ({
21
21
  argv: [],
22
22
  env: {},
23
23
  exit: n => { throw n; },
24
+ cwd: () => '',
24
25
  },
25
26
  asyncImport: () => Promise.reject(),
26
27
  performance: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "**/*.js",
package/path/module.f.js CHANGED
@@ -3,7 +3,8 @@ import { join } from "../types/string/module.f.js";
3
3
  import { concat as stringConcat } from "../types/string/module.f.js";
4
4
  const foldNormalizeOp = input => state => {
5
5
  switch (input) {
6
- case '': {
6
+ case '':
7
+ case '.': {
7
8
  return state;
8
9
  }
9
10
  case '..': {