virmator 7.0.1 → 7.0.3

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.
@@ -30,16 +30,10 @@ function findGitRepoRoot(dir = exports.currentDir) {
30
30
  }
31
31
  exports.findGitRepoRoot = findGitRepoRoot;
32
32
  function createBaseConfig({ forGitHubPages }) {
33
- const githubPagesConfig = forGitHubPages
34
- ? {
35
- base: process.env.CI
36
- ? /** So GitHub Pages will work. */ (0, path_1.basename)(findGitRepoRoot())
37
- : '',
38
- }
39
- : {};
33
+ const basePath = forGitHubPages && process.env.CI ? `/${(0, path_1.basename)(findGitRepoRoot())}` : '/';
40
34
  return {
41
35
  clearScreen: false,
42
- ...githubPagesConfig,
36
+ base: basePath,
43
37
  publicDir: exports.staticDir,
44
38
  root: exports.srcDir,
45
39
  plugins: [
@@ -62,7 +56,7 @@ async function combineConfigs(baseConfigOptions, overrideConfigInput) {
62
56
  node_js_1.log.faint(`public dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.publicDir || '')}${node_js_1.logColors.reset}`);
63
57
  node_js_1.log.faint(`root dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.root || '')}${node_js_1.logColors.reset}`);
64
58
  node_js_1.log.faint(`out dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.build?.outDir || '')}${node_js_1.logColors.reset}`);
65
- node_js_1.log.faint(`base path: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.base || '')}${node_js_1.logColors.reset}`);
59
+ node_js_1.log.faint(`base path: ${node_js_1.logColors.info}${fullConfig.base}${node_js_1.logColors.reset}`);
66
60
  return fullConfig;
67
61
  }
68
62
  exports.combineConfigs = combineConfigs;
@@ -36,9 +36,24 @@ function alwaysReloadPlugin(config = {}) {
36
36
  name: 'alwaysReloadPlugin',
37
37
  apply: 'serve',
38
38
  config: () => ({ server: { watch: { disableGlobbing: false } } }),
39
+ handleHotUpdate() {
40
+ return [];
41
+ },
39
42
  configureServer({ watcher, ws, config: { logger, publicDir = '', root = process.cwd() } }) {
40
43
  const { inclusions = [], exclusions = [] } = config;
41
44
  let callingAlready = false;
45
+ const oldInfoLog = logger.info;
46
+ function customInfoLog(message, options) {
47
+ /**
48
+ * Ignore vite's built-in extra page reload logging as this will duplicate our
49
+ * messages.
50
+ */
51
+ if (message.startsWith('page reload')) {
52
+ return;
53
+ }
54
+ oldInfoLog(message, options);
55
+ }
56
+ logger.info = customInfoLog;
42
57
  function reloadCallback(path) {
43
58
  // prevent duplicate calls cause the watcher is very eager to call callbacks multiple times in a row
44
59
  if (!callingAlready) {
@@ -72,7 +87,6 @@ function alwaysReloadPlugin(config = {}) {
72
87
  if (publicDir) {
73
88
  watcher.add(publicDir);
74
89
  }
75
- watcher.removeAllListeners();
76
90
  if (!watcher.listeners('change').includes(reloadCallback)) {
77
91
  watcher.on('change', reloadCallback);
78
92
  watcher.on('add', reloadCallback);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Handle common package configs, commands, and dependencies.",
5
5
  "keywords": [
6
6
  "automation",
@@ -51,7 +51,7 @@
51
51
  "glob-promise": "^6.0.3",
52
52
  "semver": "^7.5.4",
53
53
  "simple-git": "^3.19.1",
54
- "type-fest": "^3.12.0"
54
+ "type-fest": "^3.13.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@electrovir/nyc": "15.1.0-fix0",
@@ -91,7 +91,7 @@
91
91
  "ts-node": "^10.9.1",
92
92
  "tsconfig-paths": "^4.2.0",
93
93
  "typescript": "^5.1.6",
94
- "virmator": "^6.7.1",
94
+ "virmator": "^7.0.2",
95
95
  "vite": "^4.4.2",
96
96
  "vite-tsconfig-paths": "^4.2.0"
97
97
  },