create-newt-app 0.31.6 → 0.31.7
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/dist/index.js +3 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { promises as promises$1 } from "node:fs";
|
|
|
14
14
|
import https from "node:https";
|
|
15
15
|
import path$1 from "node:path";
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.31.
|
|
17
|
+
var version = "0.31.7";
|
|
18
18
|
var engines = { "node": ">=24.0.0" };
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/templates/root/index.ts
|
|
@@ -12705,35 +12705,12 @@ function post(body) {
|
|
|
12705
12705
|
}
|
|
12706
12706
|
});
|
|
12707
12707
|
}
|
|
12708
|
-
const NOTICE = [
|
|
12709
|
-
"create-newt-app sends one anonymous event per scaffold: the options you chose,",
|
|
12710
|
-
"the CLI and Node major versions, your platform, whether prompts or flags were",
|
|
12711
|
-
"used, and whether this is CI. No project name, no paths, no file contents, and",
|
|
12712
|
-
"no identifier of any kind.",
|
|
12713
|
-
"Opt out with DO_NOT_TRACK=1 or NEWT_TELEMETRY_DISABLED=1."
|
|
12714
|
-
].join("\n");
|
|
12715
12708
|
async function reportRun(report) {
|
|
12716
12709
|
if (!isEnabled()) return;
|
|
12717
12710
|
const state = await readState();
|
|
12718
12711
|
if (state.unreachableUntil && state.unreachableUntil > Date.now()) return;
|
|
12719
|
-
if (!
|
|
12720
|
-
|
|
12721
|
-
console.log(NOTICE);
|
|
12722
|
-
console.log();
|
|
12723
|
-
await writeState({
|
|
12724
|
-
...state,
|
|
12725
|
-
notifiedAt: Date.now()
|
|
12726
|
-
});
|
|
12727
|
-
}
|
|
12728
|
-
if (!await post(JSON.stringify(buildPayload(report)))) await writeState({
|
|
12729
|
-
...state,
|
|
12730
|
-
notifiedAt: state.notifiedAt ?? Date.now(),
|
|
12731
|
-
unreachableUntil: Date.now() + UNREACHABLE_BACKOFF_MS
|
|
12732
|
-
});
|
|
12733
|
-
else if (state.unreachableUntil) await writeState({
|
|
12734
|
-
...state,
|
|
12735
|
-
unreachableUntil: void 0
|
|
12736
|
-
});
|
|
12712
|
+
if (!await post(JSON.stringify(buildPayload(report)))) await writeState({ unreachableUntil: Date.now() + UNREACHABLE_BACKOFF_MS });
|
|
12713
|
+
else if (state.unreachableUntil) await writeState({});
|
|
12737
12714
|
}
|
|
12738
12715
|
//#endregion
|
|
12739
12716
|
//#region src/index.ts
|