create-gen-app 0.1.0 → 0.1.2
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.
- package/LICENSE +1 -1
- package/README.md +45 -9
- package/clone.js +18 -9
- package/extract.js +18 -9
- package/index.js +18 -9
- package/package.json +14 -11
- package/prompt.js +2 -3
- package/replace.js +18 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Interweb, Inc. <developers@interweb.co>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# create-gen-app
|
|
2
2
|
|
|
3
3
|
<p align="center" width="100%">
|
|
4
|
-
<img height="90" src="https://
|
|
4
|
+
<img height="90" src="https://raw.githubusercontent.com/hyperweb-io/dev-utils/refs/heads/main/docs/img/inquirerer.svg" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center" width="100%">
|
|
8
|
-
|
|
9
|
-
<a href="https://github.com/
|
|
10
|
-
<img height="20" src="https://github.com/
|
|
8
|
+
|
|
9
|
+
<a href="https://github.com/hyperweb-io/dev-utils/actions/workflows/ci.yml">
|
|
10
|
+
<img height="20" src="https://github.com/hyperweb-io/dev-utils/actions/workflows/ci.yml/badge.svg" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://github.com/hyperweb-io/dev-utils/blob/main/LICENSE">
|
|
13
|
+
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
|
|
11
14
|
</a>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<a href="https://www.npmjs.com/package/inquirerer"><img height="20" src="https://img.shields.io/github/package-json/v/pyramation/inquirerer?filename=packages%2Finquirerer%2Fpackage.json"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/create-gen-app"><img height="20" src="https://img.shields.io/npm/dt/create-gen-app"></a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/create-gen-app"><img height="20" src="https://img.shields.io/github/package-json/v/hyperweb-io/dev-utils?filename=packages%2Fcreate-gen-app%2Fpackage.json"></a>
|
|
15
17
|
</p>
|
|
16
18
|
|
|
17
19
|
A TypeScript library for cloning and customizing template repositories with variable replacement.
|
|
@@ -145,6 +147,40 @@ Examples of valid variables:
|
|
|
145
147
|
- `__snake_case__`
|
|
146
148
|
- `__VERSION_1__`
|
|
147
149
|
|
|
148
|
-
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
### Setup
|
|
155
|
+
|
|
156
|
+
1. Clone the repository:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git clone https://github.com/hyperweb-io/dev-utils.git
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
2. Install dependencies:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cd dev-utils
|
|
166
|
+
pnpm install
|
|
167
|
+
pnpm build
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
3. Test the package of interest:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
cd packages/<packagename>
|
|
174
|
+
pnpm test:watch
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Credits
|
|
178
|
+
|
|
179
|
+
Built for developers, with developers.
|
|
180
|
+
👉 https://launchql.com | https://hyperweb.io
|
|
181
|
+
|
|
182
|
+
## Disclaimer
|
|
183
|
+
|
|
184
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
149
185
|
|
|
150
|
-
|
|
186
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
package/clone.js
CHANGED
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.cloneRepo =
|
|
36
|
+
exports.cloneRepo = cloneRepo;
|
|
27
37
|
const child_process_1 = require("child_process");
|
|
28
38
|
const fs = __importStar(require("fs"));
|
|
29
39
|
const os = __importStar(require("os"));
|
|
@@ -54,7 +64,6 @@ async function cloneRepo(url) {
|
|
|
54
64
|
throw new Error(`Failed to clone repository: ${errorMessage}`);
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
|
-
exports.cloneRepo = cloneRepo;
|
|
58
67
|
/**
|
|
59
68
|
* Normalize a URL to a git-cloneable format
|
|
60
69
|
* @param url - Input URL
|
package/extract.js
CHANGED
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.extractVariables =
|
|
36
|
+
exports.extractVariables = extractVariables;
|
|
27
37
|
const fs = __importStar(require("fs"));
|
|
28
38
|
const path = __importStar(require("path"));
|
|
29
39
|
/**
|
|
@@ -74,7 +84,6 @@ async function extractVariables(templateDir) {
|
|
|
74
84
|
projectQuestions
|
|
75
85
|
};
|
|
76
86
|
}
|
|
77
|
-
exports.extractVariables = extractVariables;
|
|
78
87
|
/**
|
|
79
88
|
* Extract variables from file content using streams
|
|
80
89
|
* @param filePath - Path to the file
|
package/index.js
CHANGED
|
@@ -15,18 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.createGen =
|
|
39
|
+
exports.createGen = createGen;
|
|
30
40
|
const fs = __importStar(require("fs"));
|
|
31
41
|
const clone_1 = require("./clone");
|
|
32
42
|
const extract_1 = require("./extract");
|
|
@@ -67,4 +77,3 @@ async function createGen(options) {
|
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
}
|
|
70
|
-
exports.createGen = createGen;
|
package/package.json
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-gen-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "Clone and customize template repositories",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"module": "esm/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
|
-
"homepage": "https://github.com/
|
|
10
|
-
"license": "
|
|
9
|
+
"homepage": "https://github.com/hyperweb-io/dev-utils",
|
|
10
|
+
"license": "MIT",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public",
|
|
13
13
|
"directory": "dist"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/
|
|
17
|
+
"url": "https://github.com/hyperweb-io/dev-utils"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/hyperweb-io/dev-utils/issues"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"copy": "
|
|
24
|
-
"clean": "
|
|
25
|
-
"
|
|
26
|
-
"build": "npm run clean
|
|
23
|
+
"copy": "makage assets",
|
|
24
|
+
"clean": "rimraf dist",
|
|
25
|
+
"prepublishOnly": "npm run build",
|
|
26
|
+
"build": "npm run clean && makage build-ts && npm run copy",
|
|
27
27
|
"dev": "ts-node dev/index",
|
|
28
28
|
"test": "jest",
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"inquirerer": "
|
|
32
|
+
"inquirerer": "2.1.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"makage": "0.1.3"
|
|
33
36
|
},
|
|
34
37
|
"keywords": [],
|
|
35
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "6eb73b8f975306bef631af4a32f054fd225c36f9"
|
|
36
39
|
}
|
package/prompt.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateQuestions = generateQuestions;
|
|
4
|
+
exports.promptUser = promptUser;
|
|
4
5
|
const inquirerer_1 = require("inquirerer");
|
|
5
6
|
/**
|
|
6
7
|
* Generate questions from extracted variables
|
|
@@ -40,7 +41,6 @@ function generateQuestions(extractedVariables) {
|
|
|
40
41
|
}
|
|
41
42
|
return questions;
|
|
42
43
|
}
|
|
43
|
-
exports.generateQuestions = generateQuestions;
|
|
44
44
|
/**
|
|
45
45
|
* Prompt the user for variable values
|
|
46
46
|
* @param extractedVariables - Variables extracted from the template
|
|
@@ -59,4 +59,3 @@ async function promptUser(extractedVariables, argv = {}, noTty = false) {
|
|
|
59
59
|
const answers = await prompter.prompt(argv, questions);
|
|
60
60
|
return answers;
|
|
61
61
|
}
|
|
62
|
-
exports.promptUser = promptUser;
|
package/replace.js
CHANGED
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.replaceVariables =
|
|
36
|
+
exports.replaceVariables = replaceVariables;
|
|
27
37
|
const fs = __importStar(require("fs"));
|
|
28
38
|
const path = __importStar(require("path"));
|
|
29
39
|
const stream_1 = require("stream");
|
|
@@ -41,7 +51,6 @@ async function replaceVariables(templateDir, outputDir, extractedVariables, answ
|
|
|
41
51
|
}
|
|
42
52
|
await walkAndReplace(templateDir, outputDir, extractedVariables, answers);
|
|
43
53
|
}
|
|
44
|
-
exports.replaceVariables = replaceVariables;
|
|
45
54
|
/**
|
|
46
55
|
* Walk through directory and replace variables in files and filenames
|
|
47
56
|
* @param sourceDir - Source directory
|