@payloadcms/figma 0.0.1-alpha.57 → 0.0.1-alpha.58
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/dist/commands/init.js
CHANGED
|
@@ -217,23 +217,8 @@ import { cacheAllEnvironments } from '../utils/cache-bootstrap.js';
|
|
|
217
217
|
p.log.warn(pc.yellow(`⚠ Failed to update .env file: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
218
218
|
}
|
|
219
219
|
} else {
|
|
220
|
-
|
|
221
|
-
p.
|
|
222
|
-
const shouldAddPayload = await p.confirm({
|
|
223
|
-
initialValue: true,
|
|
224
|
-
message: 'Would you like to add Payload to this project?'
|
|
225
|
-
});
|
|
226
|
-
if (p.isCancel(shouldAddPayload)) {
|
|
227
|
-
p.cancel('Operation cancelled');
|
|
228
|
-
process.exit(0);
|
|
229
|
-
}
|
|
230
|
-
if (!shouldAddPayload) {
|
|
231
|
-
p.log.error('Payload is required to use Figma CMS');
|
|
232
|
-
process.exit(1);
|
|
233
|
-
}
|
|
234
|
-
// TODO: Add Payload to existing project (future enhancement)
|
|
235
|
-
p.log.error('Adding Payload to existing projects is not yet supported');
|
|
236
|
-
p.note('Create a new project or manually add Payload dependencies', 'Action Required');
|
|
220
|
+
p.log.warn(pc.yellow('⚠ Payload was not detected in this project'));
|
|
221
|
+
p.note('Run this command in a directory without an existing project or in an existing Payload project.', 'Action Required');
|
|
237
222
|
process.exit(1);
|
|
238
223
|
}
|
|
239
224
|
// Generate import map to prevent errors on first dev run
|
|
@@ -11,7 +11,8 @@ import { x } from 'tar';
|
|
|
11
11
|
this.name = 'TemplateDownloadError';
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
const BRANCH_OR_TAG = '
|
|
14
|
+
const BRANCH_OR_TAG = 'v3.79.1';
|
|
15
|
+
/** GitHub strips the 'v' prefix in tarball directory names */ const TARBALL_PREFIX = `payload-${BRANCH_OR_TAG.replace(/^v/, '')}`;
|
|
15
16
|
const TEMPLATE_NAME = 'blank';
|
|
16
17
|
const MAX_RETRIES = 3;
|
|
17
18
|
const INITIAL_RETRY_DELAY = 1000 // 1 second
|
|
@@ -43,7 +44,7 @@ const INITIAL_RETRY_DELAY = 1000 // 1 second
|
|
|
43
44
|
* Single attempt to download template (extracted for retry logic)
|
|
44
45
|
*/ async function downloadTemplateAttempt(projectDir) {
|
|
45
46
|
const url = `https://codeload.github.com/payloadcms/payload/tar.gz/${BRANCH_OR_TAG}`;
|
|
46
|
-
const filter =
|
|
47
|
+
const filter = `${TARBALL_PREFIX}/templates/${TEMPLATE_NAME}/`;
|
|
47
48
|
try {
|
|
48
49
|
// Ensure target directory exists
|
|
49
50
|
await fs.mkdir(projectDir, {
|