@weborigami/language 0.5.7 → 0.6.0
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/index.ts +3 -4
- package/main.js +1 -3
- package/package.json +4 -5
- package/src/handlers/csv_handler.js +13 -8
- package/src/handlers/handlers.js +2 -0
- package/src/handlers/sh_handler.js +65 -0
- package/src/handlers/tsv_handler.js +63 -0
- package/src/project/jsGlobals.js +5 -1
- package/src/project/projectConfig.js +4 -4
- package/src/project/projectRoot.js +8 -9
- package/src/protocols/constructSiteTree.js +4 -4
- package/src/protocols/explore.js +2 -3
- package/src/protocols/fetchAndHandleExtension.js +0 -1
- package/src/protocols/files.js +2 -3
- package/src/protocols/http.js +0 -1
- package/src/protocols/https.js +0 -1
- package/src/protocols/httpstree.js +2 -3
- package/src/protocols/httptree.js +2 -3
- package/src/runtime/HandleExtensionsTransform.js +32 -8
- package/src/runtime/ImportModulesMixin.js +2 -2
- package/src/runtime/{OrigamiFiles.js → OrigamiFileMap.d.ts} +3 -3
- package/src/runtime/{OrigamiFiles.d.ts → OrigamiFileMap.js} +3 -5
- package/src/runtime/expressionFunction.js +3 -3
- package/src/runtime/expressionObject.js +19 -8
- package/src/runtime/handleExtension.js +2 -6
- package/src/runtime/mergeTrees.js +4 -7
- package/src/runtime/ops.js +13 -13
- package/test/cases/logicalAndExpression.yaml +7 -8
- package/test/compiler/compile.test.js +1 -1
- package/test/compiler/optimize.test.js +2 -2
- package/test/generated/logicalAndExpression.test.js +4 -0
- package/test/handlers/{csv.handler.test.js → csv_handler.test.js} +5 -5
- package/test/handlers/{js.handler.test.js → js_handler.test.js} +2 -2
- package/test/handlers/{ori.handler.test.js → ori_handler.test.js} +8 -8
- package/test/handlers/{oridocument.handler.test.js → oridocument_handler.test.js} +3 -3
- package/test/handlers/sh_handler.test.js +14 -0
- package/test/handlers/tsv_handler.test.js +28 -0
- package/test/handlers/{wasm.handler.test.js → wasm_handler.test.js} +2 -2
- package/test/runtime/OrigamiFileMap.test.js +40 -0
- package/test/runtime/evaluate.test.js +3 -3
- package/test/runtime/expressionObject.test.js +14 -6
- package/test/runtime/handleExtension.test.js +2 -2
- package/test/runtime/mergeTrees.test.js +2 -2
- package/test/runtime/ops.test.js +5 -5
- package/src/runtime/InvokeFunctionsTransform.d.ts +0 -5
- package/src/runtime/InvokeFunctionsTransform.js +0 -25
- package/src/runtime/functionResultsMap.js +0 -17
- package/test/runtime/OrigamiFiles.test.js +0 -35
- package/test/runtime/fixtures/subgraph = this.js +0 -5
- package/test/runtime/functionResultsMap.test.js +0 -20
- /package/test/handlers/{jpeg.handler.test.js → jpeg_handler.test.js} +0 -0
- /package/test/handlers/{json.handler.test.js → json_handler.test.js} +0 -0
- /package/test/handlers/{txt.handler.test.js → txt_handler.test.js} +0 -0
- /package/test/handlers/{yaml.handler.test.js → yaml_handler.test.js} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert";
|
|
2
|
-
import * as fs from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { describe, test } from "node:test";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import OrigamiFiles from "../../src/runtime/OrigamiFiles.js";
|
|
7
|
-
|
|
8
|
-
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const tempDirectory = path.join(dirname, "fixtures/temp");
|
|
10
|
-
|
|
11
|
-
describe("OrigamiFiles", () => {
|
|
12
|
-
test("can watch its folder for changes", { timeout: 2000 }, async () => {
|
|
13
|
-
await createTempDirectory();
|
|
14
|
-
const tempFiles = new OrigamiFiles(tempDirectory);
|
|
15
|
-
const changedFileName = await new Promise(async (resolve) => {
|
|
16
|
-
tempFiles.addEventListener("change", (event) => {
|
|
17
|
-
resolve(/** @type {any} */ (event).options.key);
|
|
18
|
-
});
|
|
19
|
-
await tempFiles.set(
|
|
20
|
-
"foo.txt",
|
|
21
|
-
"This file is left over from testing and can be removed."
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
await removeTempDirectory();
|
|
25
|
-
assert.equal(changedFileName, "foo.txt");
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
async function createTempDirectory() {
|
|
30
|
-
await fs.mkdir(tempDirectory, { recursive: true });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function removeTempDirectory() {
|
|
34
|
-
await fs.rm(tempDirectory, { recursive: true });
|
|
35
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ObjectTree, Tree } from "@weborigami/async-tree";
|
|
2
|
-
import assert from "node:assert";
|
|
3
|
-
import { describe, test } from "node:test";
|
|
4
|
-
import functionResultsMap from "../../src/runtime/functionResultsMap.js";
|
|
5
|
-
|
|
6
|
-
describe("functionResultsMap", () => {
|
|
7
|
-
test("get() invokes functions, returns other values as is", async () => {
|
|
8
|
-
const tree = new ObjectTree({
|
|
9
|
-
fn: function () {
|
|
10
|
-
return "Hello";
|
|
11
|
-
},
|
|
12
|
-
string: "string",
|
|
13
|
-
});
|
|
14
|
-
const fixture = await functionResultsMap(tree);
|
|
15
|
-
assert.deepEqual(await Tree.plain(fixture), {
|
|
16
|
-
fn: "Hello",
|
|
17
|
-
string: "string",
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|