@fluid-app/fluid-cli-portal 0.1.9 → 0.1.10
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/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3100,7 +3100,7 @@ function insertImport(source, importLine) {
|
|
|
3100
3100
|
*/
|
|
3101
3101
|
function insertIntoCustomWidgets(source, camelName) {
|
|
3102
3102
|
let matched = false;
|
|
3103
|
-
const result = source.replace(/export const customWidgets
|
|
3103
|
+
const result = source.replace(/(export const customWidgets(?::\s*WidgetManifest\[\])?)\s*=\s*\[([^\]]*)\]/, (_match, declaration, inner) => {
|
|
3104
3104
|
matched = true;
|
|
3105
3105
|
const lines = inner.split("\n");
|
|
3106
3106
|
const existingEntries = [];
|
|
@@ -3110,7 +3110,7 @@ function insertIntoCustomWidgets(source, camelName) {
|
|
|
3110
3110
|
}
|
|
3111
3111
|
if (existingEntries.includes(camelName)) return _match;
|
|
3112
3112
|
const commentLines = lines.filter((line) => line.trim().startsWith("//")).map((line) => line.trimEnd());
|
|
3113
|
-
return
|
|
3113
|
+
return `${declaration} = [${commentLines.length > 0 ? "\n" + commentLines.join("\n") : ""}\n${[...existingEntries, camelName].map((e) => ` ${e},`).join("\n")}\n]`;
|
|
3114
3114
|
});
|
|
3115
3115
|
return matched ? result : null;
|
|
3116
3116
|
}
|
|
@@ -3213,7 +3213,7 @@ export { manifest } from "./manifest";
|
|
|
3213
3213
|
console.log(chalk.yellow("Next steps:"));
|
|
3214
3214
|
console.log(` 1. Edit the component in ${chalk.cyan(`src/widgets/${name}/component.tsx`)}`);
|
|
3215
3215
|
console.log(` 2. Customize the manifest fields in ${chalk.cyan(`src/widgets/${name}/manifest.ts`)}`);
|
|
3216
|
-
console.log(` 3. Run ${chalk.cyan("fluid dev")} to preview in the builder`);
|
|
3216
|
+
console.log(` 3. Run ${chalk.cyan("fluid portal dev")} to preview in the builder`);
|
|
3217
3217
|
});
|
|
3218
3218
|
const widgetCommand = new Command("widget").description("Manage custom portal widgets").addCommand(createSubcommand);
|
|
3219
3219
|
//#endregion
|