@e-mc/document 0.8.30 → 0.8.31

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.
Files changed (3) hide show
  1. package/README.md +9 -9
  2. package/index.js +7 -11
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, ViewEngine } from "./squared";
@@ -85,14 +85,14 @@ interface DocumentConstructor extends ModuleConstructor {
85
85
 
86
86
  ## References
87
87
 
88
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/squared.d.ts
89
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/asset.d.ts
90
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/core.d.ts
91
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/document.d.ts
92
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/filemanager.d.ts
93
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/logger.d.ts
94
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/settings.d.ts
95
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/watch.d.ts
88
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/squared.d.ts
89
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/asset.d.ts
90
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/core.d.ts
91
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/document.d.ts
92
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/filemanager.d.ts
93
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/logger.d.ts
94
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/settings.d.ts
95
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/watch.d.ts
96
96
 
97
97
  ## LICENSE
98
98
 
package/index.js CHANGED
@@ -19,7 +19,6 @@ const CACHE_CODE = {};
19
19
  const CACHE_HASH = {};
20
20
  const CACHE_TEMPLATE = {};
21
21
  const CACHE_VIEWENGINE = new Map();
22
- const CACHE_EXTERNAL = {};
23
22
  const CACHE_PICOMATCH = new Map();
24
23
  let CACHE_TOTAL = 0;
25
24
  function renewTransform(map, key, expires) {
@@ -61,7 +60,7 @@ class Document extends core_1.Client {
61
60
  delete cache[name];
62
61
  }
63
62
  }
64
- for (const cache of [CACHE_PACKAGE, CACHE_REQUIRE, CACHE_EXTERNAL, CACHE_TEMPLATE]) {
63
+ for (const cache of [CACHE_PACKAGE, CACHE_REQUIRE, CACHE_TEMPLATE]) {
65
64
  for (const name in cache) {
66
65
  delete cache[name];
67
66
  }
@@ -990,8 +989,8 @@ class Document extends core_1.Client {
990
989
  const config = this._transformConfig;
991
990
  const cacheData = config && options.cacheData;
992
991
  const cacheType = username && core_1.Client.enabled("memory.settings.users", username) ? true : this.cacheDir || core_1.Client.enabled("memory.settings.users");
993
- let formatKey, hashKey, excludeKey;
994
- if (cacheData && cacheType && !CACHE_EXTERNAL[excludeKey = moduleName + '_' + type + '_' + format] && (!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)))) {
992
+ let formatKey, hashKey;
993
+ if (cacheData && cacheType && (!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)))) {
995
994
  const { uri, etag } = cacheData;
996
995
  const encoding = (0, types_1.getEncoding)(cacheData.encoding);
997
996
  const algorithm = config.algorithm;
@@ -1075,7 +1074,7 @@ class Document extends core_1.Client {
1075
1074
  const imports = transform.imports || (transform.imports = {});
1076
1075
  const series = new transform_1.TransformSeries(type, code, options);
1077
1076
  series.init(this, __dirname);
1078
- let valid, excluded, userData, userImports, ignoreCache, storedLog, sourceFiles;
1077
+ let valid, userData, userImports, ignoreCache, storedLog, sourceFiles;
1079
1078
  if (username && (transform = (_d = (_c = this.settings.users) === null || _c === void 0 ? void 0 : _c[username]) === null || _d === void 0 ? void 0 : _d.transform)) {
1080
1079
  userData = transform[type];
1081
1080
  userImports = transform.imports;
@@ -1124,8 +1123,8 @@ class Document extends core_1.Client {
1124
1123
  }
1125
1124
  }
1126
1125
  }
1127
- if (!baseSettings) {
1128
- excluded = !includes(name);
1126
+ if (!baseSettings && !includes(name)) {
1127
+ ignoreCache = true;
1129
1128
  }
1130
1129
  outputConfig || (outputConfig = {});
1131
1130
  if (plugin && baseConfig) {
@@ -1266,9 +1265,6 @@ class Document extends core_1.Client {
1266
1265
  return;
1267
1266
  }
1268
1267
  series.close(this);
1269
- if (excluded && excludeKey) {
1270
- CACHE_EXTERNAL[excludeKey] = true;
1271
- }
1272
1268
  if (!valid) {
1273
1269
  return;
1274
1270
  }
@@ -1283,7 +1279,7 @@ class Document extends core_1.Client {
1283
1279
  if (sourceFiles) {
1284
1280
  output.sourceFiles = sourceFiles;
1285
1281
  }
1286
- if (formatKey && !excluded && !ignoreCache) {
1282
+ if (formatKey && !ignoreCache) {
1287
1283
  const { uri, etag } = cacheData;
1288
1284
  const formatData = { ...output, storedLog };
1289
1285
  const lastAccessed = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/document",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
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.8.30",
24
- "@e-mc/db": "0.8.30",
25
- "@e-mc/types": "0.8.30",
23
+ "@e-mc/core": "0.8.31",
24
+ "@e-mc/db": "0.8.31",
25
+ "@e-mc/types": "0.8.31",
26
26
  "chalk": "4.1.2",
27
27
  "domhandler": "^5.0.3",
28
28
  "domutils": "^3.1.0",