create-gtkx 2.0.0-beta.10 → 2.0.0-beta.12

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.
Files changed (40) hide show
  1. package/README.md +8 -166
  2. package/dist/build-allowance.d.ts.map +1 -1
  3. package/dist/build-allowance.js +6 -5
  4. package/dist/build-allowance.js.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/command.d.ts +3 -2
  8. package/dist/command.d.ts.map +1 -1
  9. package/dist/command.js +93 -90
  10. package/dist/command.js.map +1 -1
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/manifest.d.ts.map +1 -1
  13. package/dist/manifest.js +2 -10
  14. package/dist/manifest.js.map +1 -1
  15. package/dist/package-managers.d.ts +0 -3
  16. package/dist/package-managers.d.ts.map +1 -1
  17. package/dist/package-managers.js +0 -3
  18. package/dist/package-managers.js.map +1 -1
  19. package/dist/project-name.d.ts.map +1 -1
  20. package/dist/scaffolder.d.ts.map +1 -1
  21. package/dist/scaffolder.js +51 -158
  22. package/dist/scaffolder.js.map +1 -1
  23. package/dist/templates/gtkx.config.ts.ejs +2 -2
  24. package/dist/templates/package.json.ejs +4 -1
  25. package/dist/templates.d.ts.map +1 -1
  26. package/dist/templates.js.map +1 -1
  27. package/package.json +16 -39
  28. package/src/build-allowance.ts +6 -7
  29. package/src/cli.ts +1 -1
  30. package/src/command.ts +114 -110
  31. package/src/manifest.ts +2 -10
  32. package/src/package-managers.ts +0 -3
  33. package/src/scaffolder.ts +83 -255
  34. package/src/templates/gtkx.config.ts.ejs +2 -2
  35. package/src/templates/package.json.ejs +4 -1
  36. package/dist/install-hints.d.ts +0 -3
  37. package/dist/install-hints.d.ts.map +0 -1
  38. package/dist/install-hints.js +0 -35
  39. package/dist/install-hints.js.map +0 -1
  40. package/src/install-hints.ts +0 -54
@@ -1,54 +0,0 @@
1
- const RELEASE_AGE_PATTERN = /ERR_PNPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;
2
- const BLOCKED_VERSION_PATTERN = /^[ \t]*(\S+) was published at .+ within the minimumReleaseAge cutoff/gm;
3
-
4
- const RELEASE_AGE_POLICY =
5
- "pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package " +
6
- "published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong " +
7
- "with these versions other than their age.";
8
-
9
- const RELEASE_AGE_REMEDY =
10
- "Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the " +
11
- "top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside " +
12
- "either of them:";
13
-
14
- const RELEASE_AGE_REMEDY_WITHOUT_VERSIONS =
15
- "Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level " +
16
- "minimumReleaseAgeExclude key in pnpm-workspace.yaml.";
17
-
18
- const RELEASE_AGE_PARTIAL_LIST =
19
- "pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. " +
20
- "Add each one to the same list.";
21
-
22
- const RELEASE_AGE_OPT_OUT =
23
- 'Listing exact versions keeps the policy on for every other package. Setting "minimumReleaseAge: 0" in the ' +
24
- "same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.";
25
-
26
- const getBlockedVersions = (message: string): string[] => {
27
- const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? "");
28
-
29
- return [...new Set(matches.filter(Boolean))];
30
- };
31
-
32
- const formatExcludeBlock = (versions: string[]): string =>
33
- ["minimumReleaseAgeExclude:", ...versions.map((version) => ` - '${version}'`)].join("\n");
34
-
35
- const describeReleaseAge = (message: string): string => {
36
- const versions = getBlockedVersions(message);
37
-
38
- if (versions.length === 0) {
39
- return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join("\n\n");
40
- }
41
-
42
- return [
43
- RELEASE_AGE_POLICY,
44
- RELEASE_AGE_REMEDY,
45
- formatExcludeBlock(versions),
46
- RELEASE_AGE_PARTIAL_LIST,
47
- RELEASE_AGE_OPT_OUT,
48
- ].join("\n\n");
49
- };
50
-
51
- const getInstallHint = (message: string): string | undefined =>
52
- RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;
53
-
54
- export { getInstallHint };