@e-mc/document 0.9.29 → 0.9.30
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/README.md +9 -9
- package/index.js +7 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.30/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { DataSource, ViewEngine } from "./squared";
|
|
@@ -183,14 +183,14 @@ NOTE: **@e-mc/document** is an abstract base class and cannot be instantiated. *
|
|
|
183
183
|
|
|
184
184
|
## References
|
|
185
185
|
|
|
186
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
187
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
188
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
189
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
190
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
191
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
192
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
193
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
186
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/squared.d.ts
|
|
187
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/asset.d.ts
|
|
188
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/core.d.ts
|
|
189
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/document.d.ts
|
|
190
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/filemanager.d.ts
|
|
191
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/logger.d.ts
|
|
192
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/settings.d.ts
|
|
193
|
+
- https://www.unpkg.com/@e-mc/types@0.9.30/lib/watch.d.ts
|
|
194
194
|
|
|
195
195
|
## LICENSE
|
|
196
196
|
|
package/index.js
CHANGED
|
@@ -18,7 +18,6 @@ const CACHE_CODE = {};
|
|
|
18
18
|
const CACHE_HASH = {};
|
|
19
19
|
const CACHE_TEMPLATE = {};
|
|
20
20
|
const CACHE_VIEWENGINE = new Map();
|
|
21
|
-
const CACHE_EXTERNAL = {};
|
|
22
21
|
const CACHE_PICOMATCH = new Map();
|
|
23
22
|
let CACHE_TOTAL = 0;
|
|
24
23
|
function renewTransform(map, key, expires) {
|
|
@@ -102,7 +101,7 @@ class Document extends core_1.Client {
|
|
|
102
101
|
delete cache[name];
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
for (const cache of [CACHE_PACKAGE, CACHE_REQUIRE,
|
|
104
|
+
for (const cache of [CACHE_PACKAGE, CACHE_REQUIRE, CACHE_TEMPLATE]) {
|
|
106
105
|
for (const name in cache) {
|
|
107
106
|
delete cache[name];
|
|
108
107
|
}
|
|
@@ -1018,8 +1017,8 @@ class Document extends core_1.Client {
|
|
|
1018
1017
|
const config = this._transformConfig;
|
|
1019
1018
|
const cacheData = config && options.cacheData;
|
|
1020
1019
|
const cacheDir = username && core_1.Client.enabled("memory.settings.users", username) ? true : this.cacheDir || core_1.Client.enabled("memory.settings.users");
|
|
1021
|
-
let formatKey = '', hashKey
|
|
1022
|
-
if (cacheData && cacheDir &&
|
|
1020
|
+
let formatKey = '', hashKey;
|
|
1021
|
+
if (cacheData && cacheDir && (!config.exclude[type] || Array.isArray(config.exclude[type]) && !format.some(value => config.exclude[type].includes(value)) || Array.isArray(config.include[type]) && format.every(value => config.include[type].includes(value)))) {
|
|
1023
1022
|
const { uri, etag } = cacheData;
|
|
1024
1023
|
const encoding = (0, types_1.getEncoding)(cacheData.encoding);
|
|
1025
1024
|
const algorithm = config.algorithm;
|
|
@@ -1081,7 +1080,7 @@ class Document extends core_1.Client {
|
|
|
1081
1080
|
const imports = transform.imports ||= {};
|
|
1082
1081
|
const series = new transform_1.TransformSeries(type, code, options);
|
|
1083
1082
|
series.init(this, __dirname);
|
|
1084
|
-
let valid,
|
|
1083
|
+
let valid, userData, userImports, ignoreCache, storedLog, sourceFiles;
|
|
1085
1084
|
if (username && (transform = this.settings.users?.[username]?.transform)) {
|
|
1086
1085
|
userData = transform[type];
|
|
1087
1086
|
userImports = transform.imports;
|
|
@@ -1122,8 +1121,8 @@ class Document extends core_1.Client {
|
|
|
1122
1121
|
}
|
|
1123
1122
|
}
|
|
1124
1123
|
}
|
|
1125
|
-
if (!baseSettings) {
|
|
1126
|
-
|
|
1124
|
+
if (!baseSettings && !hasTransformType(config, type, name, cacheData)) {
|
|
1125
|
+
ignoreCache = true;
|
|
1127
1126
|
}
|
|
1128
1127
|
outputConfig ||= {};
|
|
1129
1128
|
if (plugin && baseConfig) {
|
|
@@ -1263,9 +1262,6 @@ class Document extends core_1.Client {
|
|
|
1263
1262
|
return;
|
|
1264
1263
|
}
|
|
1265
1264
|
series.close(this);
|
|
1266
|
-
if (excluded && excludeKey) {
|
|
1267
|
-
CACHE_EXTERNAL[excludeKey] = true;
|
|
1268
|
-
}
|
|
1269
1265
|
if (!valid) {
|
|
1270
1266
|
return;
|
|
1271
1267
|
}
|
|
@@ -1280,7 +1276,7 @@ class Document extends core_1.Client {
|
|
|
1280
1276
|
if (sourceFiles) {
|
|
1281
1277
|
output.sourceFiles = sourceFiles;
|
|
1282
1278
|
}
|
|
1283
|
-
if (formatKey && !
|
|
1279
|
+
if (formatKey && !ignoreCache) {
|
|
1284
1280
|
const { uri, etag } = cacheData;
|
|
1285
1281
|
const formatData = { ...output, storedLog };
|
|
1286
1282
|
const lastAccessed = Date.now();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/document",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.30",
|
|
4
4
|
"description": "Document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.9.
|
|
24
|
-
"@e-mc/db": "0.9.
|
|
25
|
-
"@e-mc/types": "0.9.
|
|
23
|
+
"@e-mc/core": "0.9.30",
|
|
24
|
+
"@e-mc/db": "0.9.30",
|
|
25
|
+
"@e-mc/types": "0.9.30",
|
|
26
26
|
"chalk": "4.1.2",
|
|
27
27
|
"domhandler": "^5.0.3",
|
|
28
28
|
"domutils": "^3.2.2",
|