@weborigami/origami 0.0.71 → 0.0.73
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/exports/buildExports.js +1 -1
- package/exports/exports.js +16 -16
- package/package.json +4 -4
- package/src/builtins/@inline.js +1 -1
- package/src/builtins/@ori.js +4 -2
- package/src/builtins/@project.js +14 -8
- package/src/builtins/@sitemap.js +1 -1
- package/src/builtins/{css_handler.js → css.handler.js} +1 -1
- package/src/builtins/htm.handler.js +2 -0
- package/src/builtins/{html_handler.js → html.handler.js} +1 -1
- package/src/builtins/jpg.handler.js +2 -0
- package/src/builtins/{md_handler.js → md.handler.js} +1 -1
- package/src/builtins/mjs.handler.js +2 -0
- package/src/builtins/xhtml.handler.js +2 -0
- package/src/builtins/yml.handler.js +2 -0
- package/src/common/documentObject.js +1 -1
- package/src/builtins/htm_handler.js +0 -2
- package/src/builtins/jpg_handler.js +0 -2
- package/src/builtins/mjs_handler.js +0 -2
- package/src/builtins/xhtml_handler.js +0 -2
- package/src/builtins/yml_handler.js +0 -2
- /package/src/builtins/{jpeg_handler.js → jpeg.handler.js} +0 -0
- /package/src/builtins/{js_handler.js → js.handler.js} +0 -0
- /package/src/builtins/{json_handler.js → json.handler.js} +0 -0
- /package/src/builtins/{ori_handler.js → ori.handler.js} +0 -0
- /package/src/builtins/{ori_document_handler.js → oridocument.handler.js} +0 -0
- /package/src/builtins/{txt_handler.js → txt.handler.js} +0 -0
- /package/src/builtins/{wasm_handler.js → wasm.handler.js} +0 -0
- /package/src/builtins/{yaml_handler.js → yaml.handler.js} +0 -0
package/exports/buildExports.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
map,
|
|
5
5
|
toString,
|
|
6
6
|
} from "@weborigami/async-tree";
|
|
7
|
-
import fileTypeOrigami from "../src/builtins/
|
|
7
|
+
import fileTypeOrigami from "../src/builtins/ori.handler.js";
|
|
8
8
|
import { transformObject } from "../src/common/utilities.js";
|
|
9
9
|
import PathTransform from "./PathTransform.js";
|
|
10
10
|
|
package/exports/exports.js
CHANGED
|
@@ -105,22 +105,22 @@ export { default as version } from "../src/builtins/@version.js";
|
|
|
105
105
|
export { default as watch } from "../src/builtins/@watch.js";
|
|
106
106
|
export { default as yaml } from "../src/builtins/@yaml.js";
|
|
107
107
|
export { default as yamlParse } from "../src/builtins/@yamlParse.js";
|
|
108
|
-
export { default as cssHandler } from "../src/builtins/
|
|
109
|
-
export { default as htmHandler } from "../src/builtins/
|
|
110
|
-
export { default as htmlHandler } from "../src/builtins/
|
|
111
|
-
export { default as jpegHandler } from "../src/builtins/
|
|
112
|
-
export { default as jpgHandler } from "../src/builtins/
|
|
113
|
-
export { default as jsHandler } from "../src/builtins/
|
|
114
|
-
export { default as jsonHandler } from "../src/builtins/
|
|
115
|
-
export { default as mdHandler } from "../src/builtins/
|
|
116
|
-
export { default as mjsHandler } from "../src/builtins/
|
|
117
|
-
export { default as
|
|
118
|
-
export { default as
|
|
119
|
-
export { default as txtHandler } from "../src/builtins/
|
|
120
|
-
export { default as wasmHandler } from "../src/builtins/
|
|
121
|
-
export { default as xhtmlHandler } from "../src/builtins/
|
|
122
|
-
export { default as yamlHandler } from "../src/builtins/
|
|
123
|
-
export { default as ymlHandler } from "../src/builtins/
|
|
108
|
+
export { default as cssHandler } from "../src/builtins/css.handler.js";
|
|
109
|
+
export { default as htmHandler } from "../src/builtins/htm.handler.js";
|
|
110
|
+
export { default as htmlHandler } from "../src/builtins/html.handler.js";
|
|
111
|
+
export { default as jpegHandler } from "../src/builtins/jpeg.handler.js";
|
|
112
|
+
export { default as jpgHandler } from "../src/builtins/jpg.handler.js";
|
|
113
|
+
export { default as jsHandler } from "../src/builtins/js.handler.js";
|
|
114
|
+
export { default as jsonHandler } from "../src/builtins/json.handler.js";
|
|
115
|
+
export { default as mdHandler } from "../src/builtins/md.handler.js";
|
|
116
|
+
export { default as mjsHandler } from "../src/builtins/mjs.handler.js";
|
|
117
|
+
export { default as oriHandler } from "../src/builtins/ori.handler.js";
|
|
118
|
+
export { default as oridocumentHandler } from "../src/builtins/oridocument.handler.js";
|
|
119
|
+
export { default as txtHandler } from "../src/builtins/txt.handler.js";
|
|
120
|
+
export { default as wasmHandler } from "../src/builtins/wasm.handler.js";
|
|
121
|
+
export { default as xhtmlHandler } from "../src/builtins/xhtml.handler.js";
|
|
122
|
+
export { default as yamlHandler } from "../src/builtins/yaml.handler.js";
|
|
123
|
+
export { default as ymlHandler } from "../src/builtins/yml.handler.js";
|
|
124
124
|
export { default as defaultModuleExport } from "../src/cli/defaultModuleExport.js";
|
|
125
125
|
export { default as showUsage } from "../src/cli/showUsage.js";
|
|
126
126
|
export { default as arrowsMapFn } from "../src/common/arrowsMapFn.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weborigami/origami",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"description": "Web Origami language, CLI, framework, and server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"typescript": "5.6.2"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@weborigami/async-tree": "0.0.
|
|
21
|
-
"@weborigami/language": "0.0.
|
|
22
|
-
"@weborigami/types": "0.0.
|
|
20
|
+
"@weborigami/async-tree": "0.0.73",
|
|
21
|
+
"@weborigami/language": "0.0.73",
|
|
22
|
+
"@weborigami/types": "0.0.73",
|
|
23
23
|
"exif-parser": "0.1.12",
|
|
24
24
|
"graphviz-wasm": "3.0.2",
|
|
25
25
|
"highlight.js": "11.10.0",
|
package/src/builtins/@inline.js
CHANGED
|
@@ -3,7 +3,7 @@ import { compile } from "@weborigami/language";
|
|
|
3
3
|
import documentObject from "../common/documentObject.js";
|
|
4
4
|
import { toString } from "../common/utilities.js";
|
|
5
5
|
import assertTreeIsDefined from "../misc/assertTreeIsDefined.js";
|
|
6
|
-
import fileTypeOrigami from "./
|
|
6
|
+
import fileTypeOrigami from "./ori.handler.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Inline any Origami expressions found inside ${...} placeholders in the input
|
package/src/builtins/@ori.js
CHANGED
|
@@ -31,8 +31,10 @@ export default async function ori(
|
|
|
31
31
|
// Run in the context of `this` if defined, otherwise use the builtins.
|
|
32
32
|
const tree = this ?? builtins;
|
|
33
33
|
|
|
34
|
-
//
|
|
35
|
-
|
|
34
|
+
// Compile the expression. Avoid caching scope references so that, e.g.,
|
|
35
|
+
// passing a function to the `watch` builtin will always look the current
|
|
36
|
+
// value of things in scope.
|
|
37
|
+
const fn = compile.expression(expression, { scopeCaching: false });
|
|
36
38
|
|
|
37
39
|
// Execute
|
|
38
40
|
let result = await fn.call(tree);
|
package/src/builtins/@project.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @typedef {import("@weborigami/types").AsyncTree} AsyncTree */
|
|
2
|
-
import {
|
|
2
|
+
import { Tree } from "@weborigami/async-tree";
|
|
3
3
|
import { OrigamiFiles } from "@weborigami/language";
|
|
4
4
|
import assertTreeIsDefined from "../misc/assertTreeIsDefined.js";
|
|
5
5
|
import builtins from "./@builtins.js";
|
|
6
|
-
import fileTypeOrigami from "./
|
|
6
|
+
import fileTypeOrigami from "./ori.handler.js";
|
|
7
7
|
|
|
8
8
|
const configFileName = "config.ori";
|
|
9
9
|
|
|
@@ -47,20 +47,26 @@ export default async function project(key) {
|
|
|
47
47
|
projectRoot = configContainer;
|
|
48
48
|
} else {
|
|
49
49
|
// Load Origami configuration file
|
|
50
|
-
const
|
|
50
|
+
const config = await fileTypeOrigami.unpack(buffer, {
|
|
51
51
|
key: configFileName,
|
|
52
52
|
parent: configContainer,
|
|
53
53
|
});
|
|
54
|
-
if (!
|
|
54
|
+
if (!config) {
|
|
55
55
|
const configPath = /** @type {any} */ (configContainer).path;
|
|
56
56
|
throw new Error(
|
|
57
57
|
`Couldn't load the Origami configuration in ${configPath}/${configFileName}`
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
projectRoot
|
|
60
|
+
|
|
61
|
+
// The config tree may refer to the container tree *and vice versa*. To
|
|
62
|
+
// support this, we put the container in the tree twice. The chain will
|
|
63
|
+
// be: projectRoot -> configTree -> configContainer -> builtins, where
|
|
64
|
+
// the projectRoot and configContainer are the same folder.
|
|
65
|
+
const configTree = Tree.from(config);
|
|
66
|
+
projectRoot = new OrigamiFiles(configContainer.path);
|
|
67
|
+
projectRoot.parent = configTree;
|
|
68
|
+
configTree.parent = configContainer;
|
|
69
|
+
configContainer.parent = builtins;
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
|
package/src/builtins/@sitemap.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Tree } from "@weborigami/async-tree";
|
|
|
2
2
|
import assertTreeIsDefined from "../misc/assertTreeIsDefined.js";
|
|
3
3
|
import getTreeArgument from "../misc/getTreeArgument.js";
|
|
4
4
|
import builtins from "./@builtins.js";
|
|
5
|
-
import fileTypeOrigami from "./
|
|
5
|
+
import fileTypeOrigami from "./ori.handler.js";
|
|
6
6
|
|
|
7
7
|
const templateText = `(urls) => \`<?xml version="1.0" encoding="UTF-8"?>
|
|
8
8
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPlainObject, isUnpackable, toString } from "@weborigami/async-tree";
|
|
2
|
-
// import txtHandler from "../builtins/
|
|
2
|
+
// import txtHandler from "../builtins/txt.handler.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* In Origami, a text document object is any object with a `@text` property and
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|