create-appsemble 0.36.2-test.6 → 0.36.3-test.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.
- package/README.md +3 -3
- package/index.js +16 -19
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Create
|
|
2
2
|
|
|
3
3
|
> Bootstrap an Appsemble project
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/create-appsemble)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.36.3-test.6)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -23,5 +23,5 @@ npm init appsemble
|
|
|
23
23
|
|
|
24
24
|
## License
|
|
25
25
|
|
|
26
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.
|
|
26
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.3-test.6/LICENSE.md) ©
|
|
27
27
|
[Appsemble](https://appsemble.com)
|
package/index.js
CHANGED
|
@@ -2,29 +2,23 @@
|
|
|
2
2
|
import { cp, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { logger, readData, writeData } from '@appsemble/node-utils';
|
|
5
|
-
import
|
|
5
|
+
import { input } from '@inquirer/prompts';
|
|
6
6
|
const templatesDir = new URL('templates/', import.meta.url);
|
|
7
|
-
function validateProjectName(
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
return false;
|
|
7
|
+
function validateProjectName(value) {
|
|
8
|
+
if (value.length > 30 || value.length === 0) {
|
|
9
|
+
return 'Please input a valid project name. Name must be between 1 and 30 characters long.';
|
|
11
10
|
}
|
|
12
11
|
return true;
|
|
13
12
|
}
|
|
14
13
|
export async function handler() {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
message: 'Please enter the path for where you want the project folder to go (default ".").',
|
|
24
|
-
},
|
|
25
|
-
].filter(Boolean));
|
|
26
|
-
const { name } = answers;
|
|
27
|
-
const path = answers.path || process.cwd();
|
|
14
|
+
const name = await input({
|
|
15
|
+
message: 'Please enter the name of your project.',
|
|
16
|
+
validate: validateProjectName,
|
|
17
|
+
});
|
|
18
|
+
const pathAnswer = await input({
|
|
19
|
+
message: 'Please enter the path for where you want the project folder to go (default ".").',
|
|
20
|
+
});
|
|
21
|
+
const path = pathAnswer || process.cwd();
|
|
28
22
|
const outputDirectory = join(path, name);
|
|
29
23
|
const inputDirectory = new URL('gitlab/', templatesDir);
|
|
30
24
|
const pkgPath = new URL('package.json', inputDirectory);
|
|
@@ -48,5 +42,8 @@ export async function handler() {
|
|
|
48
42
|
await writeFile(join(outputDirectory, 'README.md'), outputReadme);
|
|
49
43
|
logger.info(`Successfully created ${name} at ${outputDirectory}`);
|
|
50
44
|
}
|
|
51
|
-
|
|
45
|
+
// Only run interactively if stdin is a TTY (not during validation/CI)
|
|
46
|
+
if (process.stdin.isTTY) {
|
|
47
|
+
await handler();
|
|
48
|
+
}
|
|
52
49
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-appsemble",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.3-test.6",
|
|
4
4
|
"description": "Bootstrap an Appsemble project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -39,14 +39,11 @@
|
|
|
39
39
|
"test": "vitest"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@appsemble/node-utils": "0.36.
|
|
43
|
-
"inquirer": "^
|
|
42
|
+
"@appsemble/node-utils": "0.36.3-test.6",
|
|
43
|
+
"@inquirer/prompts": "^8.0.0",
|
|
44
44
|
"type-fest": "^4.0.0"
|
|
45
45
|
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/inquirer": "9.0.7"
|
|
48
|
-
},
|
|
49
46
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
47
|
+
"node": ">=24"
|
|
51
48
|
}
|
|
52
49
|
}
|