@weborigami/language 0.2.4 → 0.2.5
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/main.js +1 -0
- package/package.json +3 -3
- package/src/runtime/ImportModulesMixin.js +4 -1
- package/src/runtime/moduleCache.js +14 -0
package/main.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as HandleExtensionsTransform } from "./src/runtime/HandleExtens
|
|
|
10
10
|
export * from "./src/runtime/handlers.js";
|
|
11
11
|
export { default as ImportModulesMixin } from "./src/runtime/ImportModulesMixin.js";
|
|
12
12
|
export { default as InvokeFunctionsTransform } from "./src/runtime/InvokeFunctionsTransform.js";
|
|
13
|
+
export * as moduleCache from "./src/runtime/moduleCache.js";
|
|
13
14
|
export { default as OrigamiFiles } from "./src/runtime/OrigamiFiles.js";
|
|
14
15
|
export * as symbols from "./src/runtime/symbols.js";
|
|
15
16
|
export { default as taggedTemplate } from "./src/runtime/taggedTemplate.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weborigami/language",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Web Origami expression language compiler and runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./main.js",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"yaml": "2.6.1"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@weborigami/async-tree": "0.2.
|
|
16
|
-
"@weborigami/types": "0.2.
|
|
15
|
+
"@weborigami/async-tree": "0.2.5",
|
|
16
|
+
"@weborigami/types": "0.2.5",
|
|
17
17
|
"watcher": "2.3.1"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
@@ -2,6 +2,7 @@ import * as fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { maybeOrigamiSourceCode } from "./errors.js";
|
|
5
|
+
import * as moduleCache from "./moduleCache.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @typedef {import("@weborigami/types").AsyncTree} AsyncTree
|
|
@@ -14,7 +15,9 @@ export default function ImportModulesMixin(Base) {
|
|
|
14
15
|
const filePath = path.join(this.dirname, ...keys);
|
|
15
16
|
// On Windows, absolute paths must be valid file:// URLs.
|
|
16
17
|
const fileUrl = pathToFileURL(filePath);
|
|
17
|
-
|
|
18
|
+
// Add cache-busting timestamp
|
|
19
|
+
const modulePath =
|
|
20
|
+
fileUrl.href + `?cacheBust=${moduleCache.getTimestamp()}`;
|
|
18
21
|
|
|
19
22
|
// Try to load the module.
|
|
20
23
|
let obj;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module is used to let the dev:watch builtin tell ImportModulesMixin when
|
|
3
|
+
* it should reset its module cache-busting timestamp.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
let timestamp = Date.now();
|
|
7
|
+
|
|
8
|
+
export function getTimestamp() {
|
|
9
|
+
return timestamp;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function resetTimestamp() {
|
|
13
|
+
timestamp = Date.now();
|
|
14
|
+
}
|