wirejs-scripts 3.0.2 → 3.0.4

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/bin.js CHANGED
@@ -12,6 +12,7 @@ import { rimraf } from 'rimraf';
12
12
  import { JSDOM } from 'jsdom';
13
13
  import { useJSDOM } from 'wirejs-dom/v2';
14
14
  import { requiresContext, Context, CookieJar } from 'wirejs-resources';
15
+ import { prebuildApi } from 'wirejs-resources/internal';
15
16
 
16
17
  const CWD = process.cwd();
17
18
  const webpackConfig = webpackConfigure(process.env, process.argv);
@@ -440,8 +441,13 @@ const engine = {
440
441
  // explicit exit forces lingering child processes to die.
441
442
  logger.log('stopping')
442
443
  process.exit();
443
- }
444
+ },
444
445
 
446
+ async ['prebuild-api']() {
447
+ logger.log("prebuilding api...");
448
+ await prebuildApi();
449
+ logger.log("api prebuild finished");
450
+ },
445
451
  };
446
452
 
447
453
  if (typeof engine[action] === 'function') {
@@ -23,10 +23,6 @@ marked.setOptions({
23
23
  }
24
24
  });
25
25
 
26
- const BUILD_ID = (new Date()).getTime();
27
-
28
- fs.writeFileSync('./src/build_id.json', JSON.stringify(BUILD_ID.toString()));
29
-
30
26
  function distPath({ subpathOut = '', subpathIn = '', extensionOut } = {}) {
31
27
  return function ({ context, absoluteFilename }) {
32
28
  const prefixIn = path.resolve(context, subpathIn);
@@ -94,7 +90,7 @@ const Generated = {
94
90
 
95
91
  try {
96
92
  if (contentPath.endsWith('.js')) {
97
- const module = await import(contentPath);
93
+ const module = await import(contentPath + '?' + new Date() + Math.random());
98
94
  if (typeof module.generate === 'function') {
99
95
  const doc = await module.generate(contentPath);
100
96
  const doctype = doc.parentNode.doctype?.name || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-scripts",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Basic build and start commands for wirejs apps",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,6 +31,6 @@
31
31
  "rimraf": "^6.0.1",
32
32
  "style-loader": "^2.0.0",
33
33
  "webpack": "^5.97.1",
34
- "wirejs-dom": "^1.0.34"
34
+ "wirejs-dom": "^1.0.35"
35
35
  }
36
36
  }