@pumpkin-plugins/build 0.1.2 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +5 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1130,12 +1130,13 @@ function isRecord(value) {
1130
1130
 
1131
1131
  // src/update-check.ts
1132
1132
  import { createRequire as createRequire3 } from "node:module";
1133
- import { latestVersion, ONE_DAY } from "@badisi/latest-version";
1133
+ import { latestVersion } from "@badisi/latest-version";
1134
1134
  var packageMetadata = createRequire3(import.meta.url)("../package.json");
1135
1135
  var packageName = packageMetadata.name;
1136
1136
  var repositoryUrl = packageMetadata.repository.url.replace(/^git\+/, "").replace(/\.git$/, "");
1137
1137
  var releaseComponent = packageName.split("/").at(-1) ?? packageName;
1138
1138
  var requestTimeout = 5e3;
1139
+ var cacheMaxAge = 3 * 60 * 60 * 1e3;
1139
1140
  function isBuildUpdateCheckAllowed(args, environment, isTTY) {
1140
1141
  return isTTY && !environment.CI && environment.PUMPKIN_DEV_MODE !== "1" && environment.PUMPKIN_PLUGINS_NO_UPDATE_NOTIFIER !== "1" && !args.some((argument) => ["--help", "-h", "--version", "-V", "--no-update-notifier"].includes(argument));
1141
1142
  }
@@ -1143,8 +1144,8 @@ async function startBuildUpdateCheck(args, options) {
1143
1144
  if (!isBuildUpdateCheckAllowed(args, options.environment, options.isTTY)) return;
1144
1145
  try {
1145
1146
  const result = await (options.lookup ?? latestVersion)(packageName, {
1146
- useCache: true,
1147
- cacheMaxAge: ONE_DAY,
1147
+ useCache: !args.includes("--no-update-cache"),
1148
+ cacheMaxAge,
1148
1149
  requestOptions: { timeout: requestTimeout }
1149
1150
  });
1150
1151
  const currentVersion = result.local;
@@ -1599,7 +1600,7 @@ function isInputOutputError(error) {
1599
1600
 
1600
1601
  // src/cli.ts
1601
1602
  async function run(args, pluginDir) {
1602
- const command = new Command().name("pumpkin-plugins-build").description("Build the Pumpkin plugin in the current directory.").version(createRequire4(import.meta.url)("../package.json").version).option("--types-only", "Generate guest declarations without building a component").option("--parse-ts", "Use Hermes TypeScript parsing for the component bundle").option("--no-update-notifier", "Skip the npm update check").configureOutput({ outputError: () => {
1603
+ const command = new Command().name("pumpkin-plugins-build").description("Build the Pumpkin plugin in the current directory.").version(createRequire4(import.meta.url)("../package.json").version).option("--types-only", "Generate guest declarations without building a component").option("--parse-ts", "Use Hermes TypeScript parsing for the component bundle").option("--no-update-notifier", "Skip the npm update check").option("--no-update-cache", "Skip the npm update check cache").configureOutput({ outputError: () => {
1603
1604
  } }).exitOverride();
1604
1605
  try {
1605
1606
  command.parse(args, { from: "user" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pumpkin-plugins/build",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Shared build tool for the plugins",
5
5
  "keywords": [
6
6
  "minecraft",