generator-reshow 0.18.8 → 0.19.0

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 (65) hide show
  1. package/README.md +1 -1
  2. package/generators/app/index.js +2332 -43
  3. package/generators/app/templates/index.tpl +1 -1
  4. package/generators/babel-package-json/index.js +2286 -0
  5. package/generators/bun/index.js +2250 -0
  6. package/generators/bun/templates/README.md +16 -0
  7. package/generators/bun/templates/_gitignore +8 -0
  8. package/generators/bun/templates/src/index.js +7 -0
  9. package/generators/bun/templates/src/init.js +8 -0
  10. package/generators/bun/templates/tsconfig.json +34 -0
  11. package/generators/bun-package-json/index.js +2197 -0
  12. package/generators/compile-sh/index.js +2132 -8
  13. package/generators/docker/index.js +2164 -52
  14. package/generators/generator/index.js +2141 -46
  15. package/generators/gitlab-docker/index.js +2219 -42
  16. package/generators/hono/index.js +2289 -0
  17. package/generators/hono/templates/src/index.ts +10 -0
  18. package/generators/npm/index.js +2319 -49
  19. package/generators/package-json/index.js +2141 -92
  20. package/generators/package-json/templates/package.json +4 -28
  21. package/generators/types/app/__tests__/App.test.d.ts +8 -0
  22. package/generators/types/app/index.d.ts +32 -0
  23. package/generators/types/babel-package-json/__tests__/babel-package-json.test.d.ts +8 -0
  24. package/generators/types/babel-package-json/index.d.ts +8 -0
  25. package/generators/types/bun/__tests__/bun.test.d.ts +8 -0
  26. package/generators/types/bun/index.d.ts +27 -0
  27. package/generators/types/bun-package-json/__tests__/bun-package-json.test.d.ts +8 -0
  28. package/generators/types/bun-package-json/index.d.ts +8 -0
  29. package/generators/types/compile-sh/__tests__/compile-sh.test.d.ts +8 -0
  30. package/generators/types/compile-sh/index.d.ts +7 -0
  31. package/generators/types/docker/__tests__/docker.test.d.ts +8 -0
  32. package/generators/types/docker/commonDockerPrompt.d.ts +7 -0
  33. package/generators/types/docker/index.d.ts +27 -0
  34. package/generators/types/generator/__tests__/generator.test.d.ts +8 -0
  35. package/generators/types/generator/index.d.ts +27 -0
  36. package/generators/types/gitlab-docker/__tests__/gitlab-docker.test.d.ts +8 -0
  37. package/generators/types/gitlab-docker/index.d.ts +27 -0
  38. package/generators/types/hono/__tests__/hono.test.d.ts +8 -0
  39. package/generators/types/hono/index.d.ts +10 -0
  40. package/generators/types/npm/__tests__/npm.test.d.ts +8 -0
  41. package/generators/types/npm/index.d.ts +27 -0
  42. package/generators/types/package-json/__tests__/package-json.test.d.ts +8 -0
  43. package/generators/types/package-json/index.d.ts +7 -0
  44. package/generators/types/update-esm-export/__tests__/update-esm-export.test.d.ts +8 -0
  45. package/generators/types/update-esm-export/index.d.ts +27 -0
  46. package/generators/update-esm-export/index.js +2164 -67
  47. package/package.json +16 -11
  48. package/generators/app/README.md +0 -4
  49. package/generators/app/__tests__/TestApp.js +0 -43
  50. package/generators/compile-sh/README.md +0 -8
  51. package/generators/compile-sh/__tests__/Test.js +0 -43
  52. package/generators/docker/README.md +0 -24
  53. package/generators/docker/__tests__/Test.js +0 -42
  54. package/generators/docker/commonDockerPrompt.js +0 -24
  55. package/generators/generator/README.md +0 -9
  56. package/generators/generator/__tests__/TestGenerator.js +0 -42
  57. package/generators/gitlab-docker/README.md +0 -9
  58. package/generators/gitlab-docker/__tests__/Test.js +0 -44
  59. package/generators/npm/README.md +0 -9
  60. package/generators/npm/__tests__/Test.js +0 -46
  61. package/generators/package-json/README.md +0 -9
  62. package/generators/package-json/__tests__/Test.js +0 -45
  63. package/generators/update-esm-export/README.md +0 -9
  64. package/generators/update-esm-export/__tests__/Test.js +0 -43
  65. /package/generators/{package-json → babel-package-json}/templates/.yo +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "version": "0.18.8",
2
+ "version": "0.19.0",
3
3
  "name": "generator-reshow",
4
4
  "repository": {
5
5
  "type": "git",
6
- "url": "https://github.com/react-atomic/reshow",
7
- "directory": "packages/generator-reshow"
6
+ "url": "https://github.com/modality-ai/yo-modality",
7
+ "directory": "generator-reshow"
8
8
  },
9
- "homepage": "https://github.com/react-atomic/reshow/tree/main/packages/generator-reshow",
9
+ "homepage": "https://github.com/modality-ai/yo-modality/tree/main/generator-reshow",
10
10
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
11
11
  "keywords": [
12
12
  "yeoman-generator"
@@ -14,19 +14,24 @@
14
14
  "author": "Hill <hill@kimo.com>",
15
15
  "license": "ISC",
16
16
  "dependencies": {
17
- "yo-reshow": "^0.18.2"
17
+ "yo-reshow": "^0.19.14"
18
18
  },
19
19
  "devDependencies": {
20
- "yo-unit": "*"
20
+ "@types/bun": "^1.3.12",
21
+ "typescript": "^6.0.3",
22
+ "yo-unit": "^0.19.3"
21
23
  },
22
24
  "scripts": {
23
- "mochaFor": "mocha --timeout 2500",
24
- "mocha": "npm run mochaFor -- 'generators/**/__tests__/*.js'",
25
- "test": "npm run mocha",
26
- "prepublishOnly": "npm run test"
25
+ "build:clean": "find ./generators -name '*.*' | xargs rm -rf",
26
+ "build:src": "bun build src/**/index.ts --outdir generators --root src --target node --format cjs --external parse-ini-string --external yeoman-generator",
27
+ "build:templates": "for d in src/*/templates; do cp -r \"$d\" \"generators/$(basename $(dirname $d))/\"; done",
28
+ "build:types": "bun tsc -p ./",
29
+ "build": "npm run build:clean && npm run build:src && npm run build:templates && npm run build:types",
30
+ "test": "npm run build && bun test --timeout 5000 ./src 2>&1 | tee /tmp/bun-test.txt; ! grep -q '(fail)' /tmp/bun-test.txt",
31
+ "prepublishOnly": "npm t"
27
32
  },
28
33
  "bugs": {
29
- "url": "https://github.com/react-atomic/reshow/issues"
34
+ "url": "https://github.com/modality-ai/yo-modality/issues"
30
35
  },
31
36
  "engines": {
32
37
  "node": ">=12"
@@ -1,4 +0,0 @@
1
- # `reshow:app`
2
-
3
- > check https://github.com/react-atomic/reshow/tree/main/packages/generator-reshow
4
-
@@ -1,43 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("generator-reshow:app", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- },
22
- });
23
- });
24
-
25
- after(()=>{
26
- if (runResult) {
27
- runResult.restore();
28
- }
29
- });
30
-
31
- it("should have folder", () => {
32
- assert.file(["src", "src/ui"]);
33
- });
34
-
35
- it("should have file", () => {
36
- assert.file(["compile.sh", "index.tpl"]);
37
- });
38
-
39
- it("should have content", () => {
40
- // assert.fileContent('composer.json', 'foo-desc');
41
- // assert.fileContent('.circleci/config.yml', 'foo');
42
- });
43
- });
@@ -1,8 +0,0 @@
1
- # `compile-sh`
2
-
3
- > build compile.sh
4
-
5
- ## Usage
6
-
7
- > You should call it with this.composeWith()
8
-
@@ -1,43 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! compile-sh !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- },
22
- });
23
- });
24
-
25
- after(() => {
26
- if (runResult) {
27
- runResult.restore();
28
- }
29
- });
30
-
31
- it("should have folder", () => {
32
- // assert.file(["src", "ui"]);
33
- });
34
-
35
- it("should have file", () => {
36
- // assert.file(["compile.sh", "index.html"]);
37
- });
38
-
39
- it("should have content", () => {
40
- // assert.fileContent('composer.json', 'foo-desc');
41
- // assert.fileContent('.circleci/config.yml', 'foo');
42
- });
43
- });
@@ -1,24 +0,0 @@
1
- # `docker`
2
-
3
- > Docker generator
4
-
5
- ## Setup circleci
6
-
7
- ### setup multi version
8
- * https://github.com/HillLiu/docker-twemproxy-alpine/blob/main/.circleci/config.yml#L62
9
-
10
- ### Environment Variables
11
- * DOCKER_LOGIN
12
- * DOCKER_PASSWORD
13
-
14
- ### circleci sample url
15
-
16
- * Syntax
17
- ```
18
- * /settings/project/github/[git-org]/[git-repository-name]/environment-variables
19
- ```
20
-
21
- * Sample
22
- * git-org: HillLiu
23
- * git-repository-name: docker-twemproxy-alpine
24
- * url: https://app.circleci.com/settings/project/github/HillLiu/docker-twemproxy-alpine/environment-variables
@@ -1,42 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! docker !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- },
21
- });
22
- });
23
-
24
- after(() => {
25
- if (runResult) {
26
- runResult.restore();
27
- }
28
- });
29
-
30
- it("should have folder", () => {
31
- assert.file(["bin", ".circleci"]);
32
- });
33
-
34
- it("should have file", () => {
35
- // assert.file(["compile.sh", "index.html"]);
36
- });
37
-
38
- it("should have content", () => {
39
- // assert.fileContent('composer.json', 'foo-desc');
40
- // assert.fileContent('.circleci/config.yml', 'foo');
41
- });
42
- });
@@ -1,24 +0,0 @@
1
- const commonDockerPrompt = (oGen) => {
2
- return [
3
- {
4
- type: "input",
5
- name: "dockerImageName",
6
- message: "Please input your docker-image-name?",
7
- default: "[DOCKER_IMAGE_NAME]",
8
- },
9
- {
10
- type: "input",
11
- name: "dockerOrgName",
12
- message: "Please input your docker-org-name?",
13
- default: "[DOCKER_ORG_NAME]",
14
- },
15
- {
16
- type: "input",
17
- name: "verPrefix",
18
- message: "Please input your version-prefix, will use with folder name and version?",
19
- default: "v",
20
- },
21
- ];
22
- };
23
-
24
- module.exports = commonDockerPrompt;
@@ -1,9 +0,0 @@
1
- # `generator`
2
-
3
- > TODO: description
4
-
5
- ## Usage
6
-
7
- ```
8
- npx yonpx reshow:generator
9
- ```
@@ -1,42 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! generator !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- },
22
- });
23
- });
24
-
25
- after(() => {
26
- if (runResult) {
27
- runResult.restore();
28
- }
29
- });
30
-
31
- it("should have folder", () => {
32
- assert.file(["__tests__"]);
33
- });
34
-
35
- it("should have file", () => {
36
- assert.file(["README.md", "index.js"]);
37
- });
38
-
39
- it("should have content", () => {
40
- assert.fileContent("README.md", "foo");
41
- });
42
- });
@@ -1,9 +0,0 @@
1
- # `gitlab-docker`
2
-
3
- > TODO: description
4
-
5
- ## Usage
6
-
7
- ```
8
- npx yonpx gitlab-docker
9
- ```
@@ -1,44 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! gitlab-docker !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- tags: "",
22
- },
23
- });
24
- });
25
-
26
- after(() => {
27
- if (runResult) {
28
- runResult.restore();
29
- }
30
- });
31
-
32
- it("should have folder", () => {
33
- // assert.file(["src", "ui"]);
34
- });
35
-
36
- it("should have file", () => {
37
- assert.file([".gitlab-ci.yml", ".gitlab/.gitlab-trigger.yml"]);
38
- });
39
-
40
- it("should have content", () => {
41
- // assert.fileContent('composer.json', 'foo-desc');
42
- // assert.fileContent('.circleci/config.yml', 'foo');
43
- });
44
- });
@@ -1,9 +0,0 @@
1
- # `npm`
2
-
3
- > TODO: description
4
-
5
- ## Usage
6
-
7
- ```
8
- npx yonpx reshow:npm
9
- ```
@@ -1,46 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! npm !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- repositoryName: "foo-repository-name",
22
- repositoryOrgName: "foo-repository-org-name",
23
- },
24
- });
25
- });
26
-
27
- after(() => {
28
- if (runResult) {
29
- runResult.restore();
30
- }
31
- });
32
-
33
- it("should have folder", () => {
34
- // assert.file(["src", "ui"]);
35
- });
36
-
37
- it("should have file", () => {
38
- // assert.file(["compile.sh", "index.html"]);
39
- });
40
-
41
- it("should have content", () => {
42
- const {generator} = runResult;
43
- // assert.fileContent('composer.json', 'foo-desc');
44
- // assert.fileContent('.circleci/config.yml', 'foo');
45
- });
46
- });
@@ -1,9 +0,0 @@
1
- # `package-json`
2
-
3
- > TODO: description
4
-
5
- ## Usage
6
-
7
- ```
8
- npx yonpx package-json
9
- ```
@@ -1,45 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! package-json !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- options: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- authorName: "foo-name",
22
- authorEmail: "foo@foo.com",
23
- },
24
- });
25
- });
26
-
27
- after(() => {
28
- if (runResult) {
29
- runResult.restore();
30
- }
31
- });
32
-
33
- it("should have folder", () => {
34
- // assert.file(["src", "ui"]);
35
- });
36
-
37
- it("should have file", () => {
38
- // assert.file(["compile.sh", "index.html"]);
39
- });
40
-
41
- it("should have content", () => {
42
- // assert.fileContent('composer.json', 'foo-desc');
43
- // assert.fileContent('.circleci/config.yml', 'foo');
44
- });
45
- });
@@ -1,9 +0,0 @@
1
- # `update-esm-export`
2
-
3
- > update exm export
4
-
5
- ## Usage
6
-
7
- ```
8
- npx yonpx update-esm-export
9
- ```
@@ -1,43 +0,0 @@
1
- /**
2
- * https://yeoman.io/authoring/testing.html
3
- * https://gilsondev.gitbooks.io/yeoman-authoring/content/authoring/unit_testing.html
4
- *
5
- * https://github.com/yeoman/yeoman-assert/blob/main/index.js
6
- * https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
7
- */
8
-
9
- const { YoTest, assert } = require("yo-unit");
10
-
11
- describe("!! update-esm-export !!", () => {
12
- let runResult;
13
-
14
- before(async () => {
15
- runResult = await YoTest({
16
- source: __dirname + "/../.",
17
- params: {
18
- isReady: true,
19
- description: "foo-desc",
20
- keyword: "foo-keyword",
21
- },
22
- });
23
- });
24
-
25
- after(() => {
26
- if (runResult) {
27
- runResult.restore();
28
- }
29
- });
30
-
31
- it("should have folder", () => {
32
- // assert.file(["src", "ui"]);
33
- });
34
-
35
- it("should have file", () => {
36
- // assert.file(["compile.sh", "index.html"]);
37
- });
38
-
39
- it("should have content", () => {
40
- // assert.fileContent('composer.json', 'foo-desc');
41
- // assert.fileContent('.circleci/config.yml', 'foo');
42
- });
43
- });