generator-reshow 0.19.4 → 0.19.6

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.
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -2169,9 +2173,13 @@ __export(exports_bun_package_json, {
2169
2173
  module.exports = __toCommonJS(exports_bun_package_json);
2170
2174
  var defaultPackageJSON = {
2171
2175
  devDependencies: {
2172
- typescript: "*"
2176
+ "modality-bun-kit": "*"
2177
+ },
2178
+ scripts: {
2179
+ "build:types": "bun tsc -p ./",
2180
+ build: "bun build:types",
2181
+ test: "npm run build && bun test"
2173
2182
  },
2174
- scripts: {},
2175
2183
  files: ["dist", "package.json", "README.md"]
2176
2184
  };
2177
2185
 
@@ -2189,9 +2197,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2197
  };
2190
2198
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2199
  }
2192
- writing() {
2200
+ conflicts() {
2193
2201
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2202
+ const payload = this.payload || {};
2195
2203
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2204
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2205
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2207,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2207
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2208
  data.repository = repository;
2201
2209
  data.homepage = repositoryHomepage;
2210
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2211
  return data;
2203
2212
  });
2204
2213
  }
@@ -2220,6 +2229,7 @@ class bun_default extends YoGenerator_default {
2220
2229
  ...commonPrompt_default.repository(this)
2221
2230
  ];
2222
2231
  handleAnswers2(await mergePromptOrOption(prompts), (payload) => {
2232
+ console.log({ payload });
2223
2233
  composeWithBefore(require.resolve("../bun-package-json"), payload);
2224
2234
  });
2225
2235
  }
@@ -2227,6 +2237,7 @@ class bun_default extends YoGenerator_default {
2227
2237
  this.env.options.nodePackageManager = "bun";
2228
2238
  const { cp, chMainName } = YoHelper_default(this);
2229
2239
  chMainName(this.mainName);
2240
+ cp("src", null, this.payload);
2230
2241
  cp("README.md", null, this.payload);
2231
2242
  cp("tsconfig.json", null, this.payload);
2232
2243
  cp("_gitignore", ".gitignore", this.payload);
@@ -0,0 +1,10 @@
1
+ import { describe, it, expect } from "bun:test";
2
+ import { init } from "../init";
3
+
4
+ describe("Test <%= mainName %>", () => {
5
+ it("basic test", () => {
6
+ /*your test code*/
7
+ const actual = init();
8
+ expect(actual).toBe('bar');
9
+ });
10
+ });
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { init } from "./init";
4
+
5
+ init();
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+
3
+ export { init } from "./init";
@@ -0,0 +1,5 @@
1
+ export const init = () => {
2
+ console.log("foo");
3
+ return "bar";
4
+ };
5
+
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -2169,9 +2173,13 @@ __export(exports_bun_package_json, {
2169
2173
  module.exports = __toCommonJS(exports_bun_package_json);
2170
2174
  var defaultPackageJSON = {
2171
2175
  devDependencies: {
2172
- typescript: "*"
2176
+ "modality-bun-kit": "*"
2177
+ },
2178
+ scripts: {
2179
+ "build:types": "bun tsc -p ./",
2180
+ build: "bun build:types",
2181
+ test: "npm run build && bun test"
2173
2182
  },
2174
- scripts: {},
2175
2183
  files: ["dist", "package.json", "README.md"]
2176
2184
  };
2177
2185
 
@@ -2189,9 +2197,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2197
  };
2190
2198
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2199
  }
2192
- writing() {
2200
+ conflicts() {
2193
2201
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2202
+ const payload = this.payload || {};
2195
2203
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2204
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2205
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2207,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2207
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2208
  data.repository = repository;
2201
2209
  data.homepage = repositoryHomepage;
2210
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2211
  return data;
2203
2212
  });
2204
2213
  }
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -2169,9 +2173,13 @@ __export(exports_bun_package_json, {
2169
2173
  module.exports = __toCommonJS(exports_bun_package_json);
2170
2174
  var defaultPackageJSON = {
2171
2175
  devDependencies: {
2172
- typescript: "*"
2176
+ "modality-bun-kit": "*"
2177
+ },
2178
+ scripts: {
2179
+ "build:types": "bun tsc -p ./",
2180
+ build: "bun build:types",
2181
+ test: "npm run build && bun test"
2173
2182
  },
2174
- scripts: {},
2175
2183
  files: ["dist", "package.json", "README.md"]
2176
2184
  };
2177
2185
 
@@ -2189,9 +2197,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2197
  };
2190
2198
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2199
  }
2192
- writing() {
2200
+ conflicts() {
2193
2201
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2202
+ const payload = this.payload || {};
2195
2203
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2204
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2205
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2207,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2207
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2208
  data.repository = repository;
2201
2209
  data.homepage = repositoryHomepage;
2210
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2211
  return data;
2203
2212
  });
2204
2213
  }
@@ -2220,6 +2229,7 @@ class bun_default extends YoGenerator_default {
2220
2229
  ...commonPrompt_default.repository(this)
2221
2230
  ];
2222
2231
  handleAnswers2(await mergePromptOrOption(prompts), (payload) => {
2232
+ console.log({ payload });
2223
2233
  composeWithBefore(require.resolve("../bun-package-json"), payload);
2224
2234
  });
2225
2235
  }
@@ -2227,6 +2237,7 @@ class bun_default extends YoGenerator_default {
2227
2237
  this.env.options.nodePackageManager = "bun";
2228
2238
  const { cp, chMainName } = YoHelper_default(this);
2229
2239
  chMainName(this.mainName);
2240
+ cp("src", null, this.payload);
2230
2241
  cp("README.md", null, this.payload);
2231
2242
  cp("tsconfig.json", null, this.payload);
2232
2243
  cp("_gitignore", ".gitignore", this.payload);
@@ -2247,8 +2258,9 @@ var defaultPackageJSON2 = {
2247
2258
  "modality-bun-kit": "*"
2248
2259
  },
2249
2260
  scripts: {
2261
+ "build:types": "bun tsc -p ./",
2262
+ build: "bun build:types",
2250
2263
  test: "npm run build && bun test",
2251
- build: "bun run src/build.ts",
2252
2264
  start: "bun run src/index.ts",
2253
2265
  dev: "bun --hot src/index.ts"
2254
2266
  },
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -6,3 +6,4 @@ v8.log
6
6
  build
7
7
  .*.sw?
8
8
  webpack.pid
9
+ .claude
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
@@ -4,5 +4,5 @@ import { YoGenerator } from "yo-reshow";
4
4
  */
5
5
  export default class extends YoGenerator {
6
6
  default(): void;
7
- writing(): void;
7
+ conflicts(): void;
8
8
  }
@@ -848,6 +848,9 @@ function stripAnsi(string) {
848
848
  if (typeof string !== "string") {
849
849
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
850
850
  }
851
+ if (!string.includes("\x1B") && !string.includes("›")) {
852
+ return string;
853
+ }
851
854
  return string.replace(regex, "");
852
855
  }
853
856
  var import_eastasianwidth = __toESM2(require_eastasianwidth(), 1);
@@ -1939,6 +1942,7 @@ var YoHelper = (oGen) => {
1939
1942
  env: oGen.env,
1940
1943
  resolved: resolvedPath
1941
1944
  });
1945
+ child.mainName = oGen.mainName;
1942
1946
  const runLoop = oGen.env.runLoop;
1943
1947
  ALL_PHASES.forEach((phase) => {
1944
1948
  const childFn = child[phase];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.19.4",
2
+ "version": "0.19.6",
3
3
  "name": "generator-reshow",
4
4
  "repository": {
5
5
  "type": "git",
@@ -14,10 +14,10 @@
14
14
  "author": "Hill <hill@kimo.com>",
15
15
  "license": "ISC",
16
16
  "dependencies": {
17
- "yo-reshow": "^0.19.17"
17
+ "yo-reshow": "^0.19.19"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/bun": "^1.3.13",
20
+ "@types/bun": "^1.3.14",
21
21
  "typescript": "^6.0.3",
22
22
  "yo-unit": "^0.19.3"
23
23
  },
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // @ts-check
4
-
5
- const { init } = require("./init");
6
-
7
- init();
@@ -1,8 +0,0 @@
1
- const init = (props) => {
2
- console.log("foo");
3
- return "bar";
4
- };
5
-
6
- module.exports = {
7
- init,
8
- };