@nexrender/worker 1.41.0 → 1.42.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.
Files changed (3) hide show
  1. package/package.json +3 -3
  2. package/readme.md +1 -0
  3. package/src/bin.js +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexrender/worker",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "author": "inlife",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@nexrender/api": "^1.41.0",
20
- "@nexrender/core": "^1.41.0",
20
+ "@nexrender/core": "^1.42.0",
21
21
  "@nexrender/types": "^1.40.0",
22
22
  "arg": "^4.1.0",
23
23
  "chalk": "^2.4.2",
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "01e3428a9194eb50e40f22a66bb236c9fc70a03c"
29
+ "gitHead": "8f7fb490c786fa1532e0f6608b2c18d1b690affb"
30
30
  }
package/readme.md CHANGED
@@ -87,4 +87,5 @@ Available settings (almost same as for `nexrender-core`):
87
87
  * `wslMap` - string, drive letter of your WSL mapping in Windows
88
88
  * `aeParams` - array of strings, any additional params that will be passed to the aerender binary, a name-value parameter pair separated by a space,
89
89
  * `actions` - an object with keys corresponding to the `module` field when defining an action, value should be a function matching expected signature of an action. Used for defining actions programmatically without needing to package the action as a separate package
90
+ * `cache` - boolean or string. Set the cache folder used by HTTP assets. If `true` will use the default path of `${workpath}/http-cache`, if set to a string it will be interpreted as a filesystem path to the cache folder.
90
91
 
package/src/bin.js CHANGED
@@ -20,6 +20,8 @@ const args = arg({
20
20
  '--workpath': String,
21
21
  '--wsl-map': String,
22
22
  '--tag-selector': String,
23
+ '--cache': Boolean,
24
+ '--cache-path': String,
23
25
 
24
26
  '--stop-on-error': Boolean,
25
27
 
@@ -96,7 +98,13 @@ if (args['--help']) {
96
98
 
97
99
  {bold ADVANCED OPTIONS}
98
100
 
99
-
101
+
102
+ --cache Boolean flag that enables default HTTP caching of assets.
103
+ Will save cache to [workpath]/http-cache unless "--cache-path is used"
104
+
105
+ --cache-path String value that sets the HTTP cache path to the provided folder path.
106
+ "--cache" will default to true if this is used.
107
+
100
108
  --stop-on-error forces worker to stop if processing/rendering error occures,
101
109
  otherwise worker will report an error, and continue working
102
110
 
@@ -199,6 +207,12 @@ opt('wslMap', '--wsl-map');
199
207
  opt('aeParams', '--aerender-parameter');
200
208
  opt('tagSelector', '--tag-selector');
201
209
 
210
+ if(args['--cache-path']){
211
+ opt('cache', '--cache-path');
212
+ }else if(args['--cache']){
213
+ opt('cache', '--cache');
214
+ }
215
+
202
216
  if (args['--cleanup']) {
203
217
  settings = init(Object.assign(settings, {
204
218
  logger: console