create-cloudinary-react 1.0.0-beta.11 → 1.0.0-beta.12

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/CHANGELOG.md +12 -0
  2. package/cli.js +130 -84
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [1.0.0-beta.12](https://github.com/cloudinary-devs/create-cloudinary-react/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2026-02-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove console.log ([369e92f](https://github.com/cloudinary-devs/create-cloudinary-react/commit/369e92f3cb3e5af633c1553380119d5a685ec506))
7
+
8
+
9
+ ### Features
10
+
11
+ * non-interactive 'headless' mode ([4334991](https://github.com/cloudinary-devs/create-cloudinary-react/commit/4334991f99eddfb3ae2b017c977f9c69c0c500fd))
12
+
1
13
  # [1.0.0-beta.11](https://github.com/cloudinary-devs/create-cloudinary-react/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2026-01-30)
2
14
 
3
15
 
package/cli.js CHANGED
@@ -7,6 +7,7 @@ import { execSync } from 'child_process';
7
7
  import inquirer from 'inquirer';
8
8
  import chalk from 'chalk';
9
9
  import fs from 'fs-extra';
10
+ import { parseArgs } from 'node:util';
10
11
 
11
12
  const __filename = fileURLToPath(import.meta.url);
12
13
  const __dirname = dirname(__filename);
@@ -24,95 +25,140 @@ function isValidProjectName(name) {
24
25
  }
25
26
 
26
27
  async function main() {
27
- console.log(chalk.cyan.bold('\n🚀 Cloudinary React + Vite Boilerplate\n'));
28
- console.log(chalk.gray('💡 Need a Cloudinary account? Sign up for free: https://cloudinary.com/users/register/free\n'));
28
+
29
+ let answers = {};
30
+
31
+ if (process.argv.includes('--headless')) {
29
32
 
30
- const answers = await inquirer.prompt([
31
- {
32
- type: 'input',
33
- name: 'projectName',
34
- message: 'What’s your project’s name?\n',
35
- default: 'my-cloudinary-app',
36
- validate: (input) => {
37
- if (!input.trim()) {
38
- return 'Project name cannot be empty';
33
+ const { values, positionals } = parseArgs({
34
+ options: {
35
+ headless: {
36
+ type: 'boolean'
37
+ },
38
+ projectName: {
39
+ type: 'string',
40
+ default: 'my-cloudinary-app'
41
+ },
42
+ cloudName: {
43
+ type: 'string'
44
+ },
45
+ hasUploadPreset: {
46
+ type: 'boolean',
47
+ default: false
48
+ },
49
+ uploadPreset: {
50
+ type: 'string'
51
+ },
52
+ aiTools: {
53
+ type: 'string',
54
+ multiple: true,
55
+ default: ['cursor']
56
+ },
57
+ installDeps: {
58
+ type: 'boolean',
59
+ default: true
60
+ },
61
+ startDev: {
62
+ type: 'boolean',
63
+ default: false
39
64
  }
40
- if (!isValidProjectName(input)) {
41
- return 'Project name can only contain letters, numbers, hyphens, and underscores';
42
- }
43
- if (existsSync(input)) {
44
- return `Directory "${input}" already exists. Please choose a different name.`;
45
- }
46
- return true;
65
+ }
66
+ });
67
+
68
+ Object.assign(answers, values);
69
+
70
+ } else {
71
+
72
+ console.log(chalk.cyan.bold('\n🚀 Cloudinary React + Vite Boilerplate\n'));
73
+ console.log(chalk.gray('💡 Need a Cloudinary account? Sign up for free: https://cloudinary.com/users/register/free\n'));
74
+
75
+ answers = await inquirer.prompt([
76
+ {
77
+ type: 'input',
78
+ name: 'projectName',
79
+ message: 'What’s your project’s name?\n',
80
+ default: 'my-cloudinary-app',
81
+ validate: (input) => {
82
+ if (!input.trim()) {
83
+ return 'Project name cannot be empty';
84
+ }
85
+ if (!isValidProjectName(input)) {
86
+ return 'Project name can only contain letters, numbers, hyphens, and underscores';
87
+ }
88
+ if (existsSync(input)) {
89
+ return `Directory "${input}" already exists. Please choose a different name.`;
90
+ }
91
+ return true;
92
+ },
47
93
  },
48
- },
49
- {
50
- type: 'input',
51
- name: 'cloudName',
52
- message:
53
- 'What’s your Cloudinary cloud name?\n' +
54
- chalk.gray(' → Find your cloud name: https://console.cloudinary.com/app/home/dashboard') + '\n',
55
- validate: (input) => {
56
- if (!input.trim()) {
57
- return chalk.yellow(
58
- 'Cloud name is required.\n' +
59
- ' → Sign up: https://cloudinary.com/users/register/free\n' +
60
- ' → Find your cloud name: https://console.cloudinary.com/app/home/dashboard'
61
- );
62
- }
63
- if (!isValidCloudName(input)) {
64
- return 'Cloud name can only contain lowercase letters, numbers, hyphens, and underscores';
65
- }
66
- return true;
94
+ {
95
+ type: 'input',
96
+ name: 'cloudName',
97
+ message:
98
+ 'What’s your Cloudinary cloud name?\n' +
99
+ chalk.gray(' → Find your cloud name: https://console.cloudinary.com/app/home/dashboard') + '\n',
100
+ validate: (input) => {
101
+ if (!input.trim()) {
102
+ return chalk.yellow(
103
+ 'Cloud name is required.\n' +
104
+ ' Sign up: https://cloudinary.com/users/register/free\n' +
105
+ ' → Find your cloud name: https://console.cloudinary.com/app/home/dashboard'
106
+ );
107
+ }
108
+ if (!isValidCloudName(input)) {
109
+ return 'Cloud name can only contain lowercase letters, numbers, hyphens, and underscores';
110
+ }
111
+ return true;
112
+ },
67
113
  },
68
- },
69
- {
70
- type: 'confirm',
71
- name: 'hasUploadPreset',
72
- message:
73
- 'Do you have an unsigned upload preset?\n' +
74
- chalk.gray(' → You’ll need one if you want to upload new images to Cloudinary,\n but not if you only want to transform or deliver existing images.') + '\n' +
75
- chalk.gray(' → Create one here: https://console.cloudinary.com/app/settings/upload/presets') + '\n',
76
- default: false,
77
- },
78
- {
79
- type: 'input',
80
- name: 'uploadPreset',
81
- message: 'What’s your unsigned upload preset’s name?\n',
82
- when: (answers) => answers.hasUploadPreset,
83
- validate: (input) => {
84
- if (!input.trim()) {
85
- return 'Upload preset name cannot be empty';
86
- }
87
- return true;
114
+ {
115
+ type: 'confirm',
116
+ name: 'hasUploadPreset',
117
+ message:
118
+ 'Do you have an unsigned upload preset?\n' +
119
+ chalk.gray(' → You’ll need one if you want to upload new images to Cloudinary,\n but not if you only want to transform or deliver existing images.') + '\n' +
120
+ chalk.gray(' → Create one here: https://console.cloudinary.com/app/settings/upload/presets') + '\n',
121
+ default: false,
122
+ },
123
+ {
124
+ type: 'input',
125
+ name: 'uploadPreset',
126
+ message: 'What’s your unsigned upload preset’s name?\n',
127
+ when: (answers) => answers.hasUploadPreset,
128
+ validate: (input) => {
129
+ if (!input.trim()) {
130
+ return 'Upload preset name cannot be empty';
131
+ }
132
+ return true;
133
+ },
134
+ },
135
+ {
136
+ type: 'checkbox',
137
+ name: 'aiTools',
138
+ message: 'Which AI coding assistant(s) are you using? (Select all that apply)',
139
+ choices: [
140
+ { name: 'Cursor', value: 'cursor' },
141
+ { name: 'GitHub Copilot', value: 'copilot' },
142
+ { name: 'Claude Code / Claude Desktop', value: 'claude' },
143
+ { name: 'Other / Generic AI tools', value: 'generic' },
144
+ ],
145
+ default: ['cursor'],
88
146
  },
89
- },
90
- {
91
- type: 'checkbox',
92
- name: 'aiTools',
93
- message: 'Which AI coding assistant(s) are you using? (Select all that apply)',
94
- choices: [
95
- { name: 'Cursor', value: 'cursor' },
96
- { name: 'GitHub Copilot', value: 'copilot' },
97
- { name: 'Claude Code / Claude Desktop', value: 'claude' },
98
- { name: 'Other / Generic AI tools', value: 'generic' },
99
- ],
100
- default: ['cursor'],
101
- },
102
- {
103
- type: 'confirm',
104
- name: 'installDeps',
105
- message: 'Install dependencies now?\n',
106
- default: true,
107
- },
108
- {
109
- type: 'confirm',
110
- name: 'startDev',
111
- message: 'Start development server?\n',
112
- default: false,
113
- when: (answers) => answers.installDeps,
114
- },
115
- ]);
147
+ {
148
+ type: 'confirm',
149
+ name: 'installDeps',
150
+ message: 'Install dependencies now?\n',
151
+ default: true,
152
+ },
153
+ {
154
+ type: 'confirm',
155
+ name: 'startDev',
156
+ message: 'Start development server?\n',
157
+ default: false,
158
+ when: (answers) => answers.installDeps,
159
+ },
160
+ ]);
161
+ }
116
162
 
117
163
  const { projectName, cloudName, uploadPreset, aiTools, installDeps, startDev } = answers;
118
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudinary-react",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "Scaffold a Cloudinary React + Vite + TypeScript project with interactive setup",
5
5
  "type": "module",
6
6
  "bin": {