@danhachuel/thunderbolt 0.3.33 → 0.3.34
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/package.json +2 -1
- package/scripts/npx-cache-compat.mjs +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danhachuel/thunderbolt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "scripts/cli.mjs",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
".streamlit/config.toml"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
+
"postinstall": "node scripts/npx-cache-compat.mjs",
|
|
33
34
|
"start": "node scripts/cli.mjs",
|
|
34
35
|
"check": "node scripts/cli.mjs --check",
|
|
35
36
|
"pack:check": "npm pack --dry-run"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
const npxCacheRoot = resolve(packageRoot, "../../..");
|
|
7
|
+
const pathParts = npxCacheRoot.split(/[\\/]+/).filter(Boolean).map((part) => part.toLowerCase());
|
|
8
|
+
const isNpxCache = pathParts.includes("_npx");
|
|
9
|
+
const packageJsonPath = resolve(npxCacheRoot, "package.json");
|
|
10
|
+
|
|
11
|
+
if (isNpxCache && !existsSync(packageJsonPath)) {
|
|
12
|
+
mkdirSync(npxCacheRoot, { recursive: true });
|
|
13
|
+
writeFileSync(packageJsonPath, JSON.stringify({ private: true }, null, 2) + "\n", "utf8");
|
|
14
|
+
}
|
|
15
|
+
|