generator-reshow 0.19.5 → 0.19.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.
@@ -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,21 @@ __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
+ exports: {
2179
+ types: "./types/index.d.ts",
2180
+ require: "./dist/index.js",
2181
+ import: "./dist/index.js"
2182
+ },
2183
+ types: "./types/index.d.ts",
2184
+ main: "./dist/index.js",
2185
+ module: "./dist/index.js",
2186
+ scripts: {
2187
+ "build:types": "bun tsc -p ./",
2188
+ build: "bun build:types",
2189
+ test: "npm run build && bun test"
2173
2190
  },
2174
- scripts: {},
2175
2191
  files: ["dist", "package.json", "README.md"]
2176
2192
  };
2177
2193
 
@@ -2189,9 +2205,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2205
  };
2190
2206
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2207
  }
2192
- writing() {
2208
+ conflicts() {
2193
2209
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2210
+ const payload = this.payload || {};
2195
2211
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2212
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2213
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2215,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2215
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2216
  data.repository = repository;
2201
2217
  data.homepage = repositoryHomepage;
2218
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2219
  return data;
2203
2220
  });
2204
2221
  }
@@ -2220,6 +2237,7 @@ class bun_default extends YoGenerator_default {
2220
2237
  ...commonPrompt_default.repository(this)
2221
2238
  ];
2222
2239
  handleAnswers2(await mergePromptOrOption(prompts), (payload) => {
2240
+ console.log({ payload });
2223
2241
  composeWithBefore(require.resolve("../bun-package-json"), payload);
2224
2242
  });
2225
2243
  }
@@ -2227,6 +2245,7 @@ class bun_default extends YoGenerator_default {
2227
2245
  this.env.options.nodePackageManager = "bun";
2228
2246
  const { cp, chMainName } = YoHelper_default(this);
2229
2247
  chMainName(this.mainName);
2248
+ cp("src", null, this.payload);
2230
2249
  cp("README.md", null, this.payload);
2231
2250
  cp("tsconfig.json", null, this.payload);
2232
2251
  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,21 @@ __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
+ exports: {
2179
+ types: "./types/index.d.ts",
2180
+ require: "./dist/index.js",
2181
+ import: "./dist/index.js"
2182
+ },
2183
+ types: "./types/index.d.ts",
2184
+ main: "./dist/index.js",
2185
+ module: "./dist/index.js",
2186
+ scripts: {
2187
+ "build:types": "bun tsc -p ./",
2188
+ build: "bun build:types",
2189
+ test: "npm run build && bun test"
2173
2190
  },
2174
- scripts: {},
2175
2191
  files: ["dist", "package.json", "README.md"]
2176
2192
  };
2177
2193
 
@@ -2189,9 +2205,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2205
  };
2190
2206
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2207
  }
2192
- writing() {
2208
+ conflicts() {
2193
2209
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2210
+ const payload = this.payload || {};
2195
2211
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2212
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2213
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2215,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2215
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2216
  data.repository = repository;
2201
2217
  data.homepage = repositoryHomepage;
2218
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2219
  return data;
2203
2220
  });
2204
2221
  }
@@ -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,21 @@ __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
+ exports: {
2179
+ types: "./types/index.d.ts",
2180
+ require: "./dist/index.js",
2181
+ import: "./dist/index.js"
2182
+ },
2183
+ types: "./types/index.d.ts",
2184
+ main: "./dist/index.js",
2185
+ module: "./dist/index.js",
2186
+ scripts: {
2187
+ "build:types": "bun tsc -p ./",
2188
+ build: "bun build:types",
2189
+ test: "npm run build && bun test"
2173
2190
  },
2174
- scripts: {},
2175
2191
  files: ["dist", "package.json", "README.md"]
2176
2192
  };
2177
2193
 
@@ -2189,9 +2205,9 @@ class bun_package_json_default extends YoGenerator_default {
2189
2205
  };
2190
2206
  composeWithBefore(require.resolve("../package-json"), this.payload);
2191
2207
  }
2192
- writing() {
2208
+ conflicts() {
2193
2209
  const { handleKeywords, updateDestJSON } = YoHelper_default(this);
2194
- const payload = this.payload;
2210
+ const payload = this.payload || {};
2195
2211
  updateDestJSON("package.json", payload, (data = {}, { keyword, repository, repositoryHomepage }) => {
2196
2212
  handleKeywords(keyword, (arr) => data.keywords = arr);
2197
2213
  const { scripts: defaultScripts, ...restDefaults } = defaultPackageJSON;
@@ -2199,6 +2215,7 @@ class bun_package_json_default extends YoGenerator_default {
2199
2215
  data.scripts = { ...defaultScripts, ...data.scripts };
2200
2216
  data.repository = repository;
2201
2217
  data.homepage = repositoryHomepage;
2218
+ data.bin = { [this.mainName]: "src/cli.ts" };
2202
2219
  return data;
2203
2220
  });
2204
2221
  }
@@ -2220,6 +2237,7 @@ class bun_default extends YoGenerator_default {
2220
2237
  ...commonPrompt_default.repository(this)
2221
2238
  ];
2222
2239
  handleAnswers2(await mergePromptOrOption(prompts), (payload) => {
2240
+ console.log({ payload });
2223
2241
  composeWithBefore(require.resolve("../bun-package-json"), payload);
2224
2242
  });
2225
2243
  }
@@ -2227,6 +2245,7 @@ class bun_default extends YoGenerator_default {
2227
2245
  this.env.options.nodePackageManager = "bun";
2228
2246
  const { cp, chMainName } = YoHelper_default(this);
2229
2247
  chMainName(this.mainName);
2248
+ cp("src", null, this.payload);
2230
2249
  cp("README.md", null, this.payload);
2231
2250
  cp("tsconfig.json", null, this.payload);
2232
2251
  cp("_gitignore", ".gitignore", this.payload);
@@ -2247,8 +2266,9 @@ var defaultPackageJSON2 = {
2247
2266
  "modality-bun-kit": "*"
2248
2267
  },
2249
2268
  scripts: {
2269
+ "build:types": "bun tsc -p ./",
2270
+ build: "bun build:types",
2250
2271
  test: "npm run build && bun test",
2251
- build: "bun run src/build.ts",
2252
2272
  start: "bun run src/index.ts",
2253
2273
  dev: "bun --hot src/index.ts"
2254
2274
  },
@@ -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];
@@ -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.5",
2
+ "version": "0.19.7",
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
- };