create-harper 0.0.7 → 0.0.8

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.
@@ -31,6 +31,29 @@ export async function checkForUpdate() {
31
31
  );
32
32
  console.log(` Automatically updating to the latest version...\n`);
33
33
 
34
+ // Clear the npx cache for this package to ensure we get the latest version
35
+ const lsResult = spawn.sync('npm', ['cache', 'npx', 'ls', pkg.name], {
36
+ encoding: 'utf-8',
37
+ });
38
+
39
+ if (lsResult.stdout) {
40
+ const keys = lsResult.stdout
41
+ .split('\n')
42
+ .map((line) => line.trim())
43
+ .filter((line) => line.includes(':'))
44
+ .filter((line) => {
45
+ const [, pkgPart] = line.split(':');
46
+ return pkgPart && pkgPart.trim().startsWith(`${pkg.name}@`);
47
+ })
48
+ .map((line) => line.split(':')[0].trim());
49
+
50
+ if (keys.length > 0) {
51
+ spawn.sync('npm', ['cache', 'npx', 'rm', ...keys], {
52
+ stdio: 'inherit',
53
+ });
54
+ }
55
+ }
56
+
34
57
  const result = spawn.sync('npx', [`${pkg.name}@latest`, ...process.argv.slice(2)], {
35
58
  stdio: 'inherit',
36
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-harper",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "HarperDB",