@powerbuilder/skill 1.0.7 → 1.0.8
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/lib/wizard-codeapp.js +21 -34
- package/package.json +1 -1
package/lib/wizard-codeapp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execSync
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
@@ -145,11 +145,20 @@ async function stepCopySkill(targets) {
|
|
|
145
145
|
|
|
146
146
|
for (const t of targets) {
|
|
147
147
|
const dest = path.join(t.skillsDir, 'powerapps-codeapp');
|
|
148
|
+
const exists = await fse.pathExists(dest);
|
|
149
|
+
|
|
150
|
+
if (exists) {
|
|
151
|
+
warn(`Existing skill found at ${chalk.dim(dest)}`);
|
|
152
|
+
warn(`It will be ${chalk.yellowBright('completely replaced')} with the latest version.`);
|
|
153
|
+
console.log();
|
|
154
|
+
}
|
|
155
|
+
|
|
148
156
|
const spinner = ora({ text: `Copying to ${chalk.cyanBright(t.target)} …`, prefixText: ' ' }).start();
|
|
149
157
|
|
|
150
158
|
try {
|
|
159
|
+
if (exists) await fse.remove(dest); // wipe old files first
|
|
151
160
|
await fse.ensureDir(dest);
|
|
152
|
-
await fse.copy(SKILL_SRC, dest
|
|
161
|
+
await fse.copy(SKILL_SRC, dest);
|
|
153
162
|
spinner.succeed(chalk.greenBright(`Installed → ${dest}`));
|
|
154
163
|
} catch (e) {
|
|
155
164
|
spinner.fail(chalk.red(`Failed to copy to ${dest}: ${e.message}`));
|
|
@@ -195,43 +204,21 @@ async function stepInstallPlaywright() {
|
|
|
195
204
|
|
|
196
205
|
async function stepOpenPowerApps() {
|
|
197
206
|
hr();
|
|
198
|
-
log(chalk.bold('Step 4/4 ·
|
|
207
|
+
log(chalk.bold('Step 4/4 · Power Apps login'));
|
|
199
208
|
hr();
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
console.log();
|
|
203
|
-
|
|
204
|
-
const doLogin = await askConfirm('Open Power Apps now to complete login?');
|
|
205
|
-
if (!doLogin) {
|
|
206
|
-
warn('Skipped. Run the following manually when ready:');
|
|
207
|
-
warn(' playwright-cli open "https://make.powerapps.com" --headed --persistent');
|
|
208
|
-
console.log();
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
info('Launching browser… (close the window when you are done signing in)');
|
|
209
|
+
log(`Opening ${chalk.cyanBright('make.powerapps.com')} in your browser…`);
|
|
210
|
+
log(chalk.dim(' Sign in with your Microsoft 365 account to connect Power Apps.'));
|
|
213
211
|
console.log();
|
|
214
212
|
|
|
215
213
|
try {
|
|
216
|
-
//
|
|
217
|
-
const
|
|
218
|
-
'
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
await new Promise((resolve, reject) => {
|
|
224
|
-
child.on('exit', code => {
|
|
225
|
-
if (code === 0 || code === null) resolve();
|
|
226
|
-
else reject(new Error(`playwright-cli exited with code ${code}`));
|
|
227
|
-
});
|
|
228
|
-
child.on('error', reject);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
ok('Browser session saved. You will not need to log in again.');
|
|
214
|
+
// Use the OS default browser — no playwright dependency needed here
|
|
215
|
+
const opener = process.platform === 'win32' ? 'start' :
|
|
216
|
+
process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
217
|
+
execSync(`${opener} https://make.powerapps.com`, { stdio: 'ignore' });
|
|
218
|
+
ok('Browser opened. Sign in and come back when you are done.');
|
|
232
219
|
} catch (e) {
|
|
233
|
-
|
|
234
|
-
|
|
220
|
+
warn('Could not open browser automatically.');
|
|
221
|
+
log(` Please open manually: ${chalk.cyanBright('https://make.powerapps.com')}`);
|
|
235
222
|
}
|
|
236
223
|
console.log();
|
|
237
224
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerbuilder/skill",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "PowerBuilder skill installer — drop production-ready AI agent skills into .cursor, .claude, or .gemini folders with one command.",
|
|
5
5
|
"author": "TuongDoan",
|
|
6
6
|
"license": "MIT",
|