create-appsemble 0.36.2-test.5 → 0.36.3-test.5

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 (3) hide show
  1. package/README.md +3 -3
  2. package/index.js +16 -19
  3. package/package.json +4 -7
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.2-test.5/config/assets/logo.svg) Appsemble Create
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.3-test.5/config/assets/logo.svg) Appsemble Create
2
2
 
3
3
  > Bootstrap an Appsemble project
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/create-appsemble)](https://www.npmjs.com/package/create-appsemble)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.2-test.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.2-test.5)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.3-test.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.3-test.5)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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.2-test.5/LICENSE.md) ©
26
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.3-test.5/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 inquirer from 'inquirer';
5
+ import { input } from '@inquirer/prompts';
6
6
  const templatesDir = new URL('templates/', import.meta.url);
7
- function validateProjectName(input) {
8
- if (input.length > 30 || input.length === 0) {
9
- logger.error('Please input a valid project name. Name must be between 1 and 30 characters long.');
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 answers = await inquirer.prompt([
16
- {
17
- name: 'name',
18
- message: 'Please enter the name of your project.',
19
- validate: validateProjectName,
20
- },
21
- {
22
- name: 'path',
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
- await handler();
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.2-test.5",
3
+ "version": "0.36.3-test.5",
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.2-test.5",
43
- "inquirer": "^9.0.0",
42
+ "@appsemble/node-utils": "0.36.3-test.5",
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": ">=20"
47
+ "node": ">=24"
51
48
  }
52
49
  }