at-builder 1.3.3 → 1.4.0
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 +11 -11
- package/package.json +1 -1
- package/src/constants/config.ts +1 -1
- package/src/index.ts +8 -32
package/README.md
CHANGED
|
@@ -58,16 +58,16 @@ atb deploy
|
|
|
58
58
|
|
|
59
59
|
### **Core Commands**
|
|
60
60
|
|
|
61
|
-
| Command
|
|
62
|
-
|
|
63
|
-
| `atb init`
|
|
64
|
-
| `atb new`
|
|
65
|
-
| `atb build`
|
|
66
|
-
| `atb dev`
|
|
67
|
-
| `atb deploy`
|
|
68
|
-
| `atb sync`
|
|
69
|
-
| `atb doctor`
|
|
70
|
-
| `atb install-extension` | Install the
|
|
61
|
+
| Command | Description | Options |
|
|
62
|
+
| ----------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
63
|
+
| `atb init` | Initialize project with configuration files | |
|
|
64
|
+
| `atb new` | Create new Adobe Target activity with variations | |
|
|
65
|
+
| `atb build` | Build activity for development | `--prod` for production |
|
|
66
|
+
| `atb dev` | Start development server with file watching | `--browser` to open browser |
|
|
67
|
+
| `atb deploy` | Deploy activity to Adobe Target | `--dry-run` for testing, `--force` to override the 60s cooldown |
|
|
68
|
+
| `atb sync` | Sync `build.config.json` with the AT activity (pages, experiences, names) | `--scaffold` to auto-create missing variation folders |
|
|
69
|
+
| `atb doctor` | Diagnose and fix configuration issues | `--fix` to auto-fix |
|
|
70
|
+
| `atb install-extension` | Install the at-builder VSCode extension from the Marketplace | `--editor cursor` (or `codium`, etc.) to use a non-VSCode editor CLI |
|
|
71
71
|
|
|
72
72
|
### **Examples**
|
|
73
73
|
|
|
@@ -156,7 +156,7 @@ VARIATION="Variation-1"
|
|
|
156
156
|
# Adobe Target Deployment
|
|
157
157
|
ADOBE_CLIENT_ID="your-client-id"
|
|
158
158
|
ADOBE_CLIENT_SECRET="your-client-secret"
|
|
159
|
-
ADOBE_TENANT="" # Optional. Your Adobe org slug (e.g.
|
|
159
|
+
ADOBE_TENANT="" # Optional. Your Adobe org slug (e.g."tst123"). Enables clickable AT UI links in deploy/sync output.
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
### **Adobe Target Configuration (adobe.config.js)**
|
package/package.json
CHANGED
package/src/constants/config.ts
CHANGED
|
@@ -76,7 +76,7 @@ ${formatText("COMMANDS", 'yellow', true)}
|
|
|
76
76
|
${formatText("sync --scaffold", 'cyan', true)} Sync and auto-create any missing variation folders with boilerplate
|
|
77
77
|
${formatText("doctor", 'cyan', true)} Diagnose and fix project configuration issues
|
|
78
78
|
${formatText("doctor --fix", 'cyan', true)} Automatically fix detected configuration issues
|
|
79
|
-
${formatText("install-extension", 'cyan', true)} Install the
|
|
79
|
+
${formatText("install-extension", 'cyan', true)} Install the at-builder VSCode extension from the Marketplace
|
|
80
80
|
|
|
81
81
|
${formatText("GLOBAL OPTIONS", 'yellow', true)}
|
|
82
82
|
${formatText("-v, --verbose", 'green')} Enable detailed logging
|
package/src/index.ts
CHANGED
|
@@ -113,7 +113,7 @@ const setupCommander = async () => {
|
|
|
113
113
|
|
|
114
114
|
program
|
|
115
115
|
.command('install-extension')
|
|
116
|
-
.description('Install the
|
|
116
|
+
.description('Install the at-builder VSCode extension from the Marketplace')
|
|
117
117
|
.option('--editor <bin>', 'Editor CLI to use (e.g. code, cursor, codium)', 'code')
|
|
118
118
|
.action(async (options, command) => {
|
|
119
119
|
const globalOpts = command.parent.opts();
|
|
@@ -246,45 +246,23 @@ const handleSync = async (scaffold: boolean, verbose: boolean): Promise<void> =>
|
|
|
246
246
|
/**
|
|
247
247
|
* Handles the install-extension command.
|
|
248
248
|
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* The .vsix lives inside the at-builder package itself, NOT the consumer's
|
|
254
|
-
* project — so it resolves via __dirname, not PWD.
|
|
249
|
+
* Installs the at-builder VSCode extension from the VS Code Marketplace
|
|
250
|
+
* using the editor's CLI. Defaults to `code`; users on Cursor/VSCodium
|
|
251
|
+
* can pass --editor.
|
|
255
252
|
*/
|
|
256
253
|
const handleInstallExtension = async (editor: string, verbose: boolean): Promise<void> => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const installRoot = path.join(__dirname, "..");
|
|
254
|
+
const extensionId = "UpendraSengar.at-builder";
|
|
260
255
|
|
|
261
|
-
|
|
262
|
-
try {
|
|
263
|
-
candidates = fs.readdirSync(installRoot)
|
|
264
|
-
.filter(f => /^at-builder-.+\.vsix$/.test(f))
|
|
265
|
-
.sort()
|
|
266
|
-
.reverse(); // latest version first by lexicographic sort
|
|
267
|
-
} catch (error) {
|
|
268
|
-
console.error(`❌ Failed to scan at-builder directory: ${error.message}`);
|
|
269
|
-
process.exit(1);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (candidates.length === 0) {
|
|
273
|
-
console.error("❌ No at-builder VSCode extension (.vsix) found bundled with this install.");
|
|
274
|
-
console.error(`💡 Expected at: ${installRoot}/at-builder-*.vsix`);
|
|
275
|
-
process.exit(1);
|
|
276
|
-
}
|
|
256
|
+
if (verbose) logger.info("verbose", `Installing ${extensionId} via ${editor}`);
|
|
277
257
|
|
|
278
|
-
|
|
279
|
-
console.log(`📦 Installing ${candidates[0]} via "${editor}"...`);
|
|
258
|
+
console.log(`📦 Installing ${extensionId} from the Marketplace via "${editor}"...`);
|
|
280
259
|
|
|
281
|
-
const result = spawn(editor, ["--install-extension",
|
|
260
|
+
const result = spawn(editor, ["--install-extension", extensionId], {
|
|
282
261
|
stdio: "inherit",
|
|
283
262
|
shell: true
|
|
284
263
|
});
|
|
285
264
|
|
|
286
265
|
result.on("error", (err) => {
|
|
287
|
-
// ENOENT here means the editor binary isn't on PATH.
|
|
288
266
|
if ((err as NodeJS.ErrnoException).code === "ENOENT") {
|
|
289
267
|
console.error(`❌ "${editor}" CLI not found in PATH.`);
|
|
290
268
|
if (editor === "code") {
|
|
@@ -303,8 +281,6 @@ const handleInstallExtension = async (editor: string, verbose: boolean): Promise
|
|
|
303
281
|
console.log("✅ Extension installed. Reload your editor window to activate.");
|
|
304
282
|
return;
|
|
305
283
|
}
|
|
306
|
-
// 127 = shell's "command not found". With shell:true the spawn 'error'
|
|
307
|
-
// event never fires for missing CLIs, so we surface the same hint here.
|
|
308
284
|
if (code === 127) {
|
|
309
285
|
console.error(`❌ "${editor}" CLI not found in PATH.`);
|
|
310
286
|
if (editor === "code") {
|