okai 0.0.34 → 0.0.35
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.js +13 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -751,17 +751,7 @@ function chooseFile(ctx, info, gist, comamnd) {
|
|
751
751
|
const apiTypesPath = path.join(info.slnDir, relativeServiceModelDir, `api.d.ts`);
|
752
752
|
const apiFile = path.join(import.meta.dirname, 'api.d.ts');
|
753
753
|
fs.writeFileSync(apiTypesPath, fs.readFileSync(apiFile, 'utf-8'));
|
754
|
-
let uiFileName = null;
|
755
|
-
if (info.uiMjsDir) {
|
756
|
-
uiFileName = `${res.groupName}.mjs`;
|
757
|
-
const uiGroupPath = path.join(info.uiMjsDir, uiFileName);
|
758
|
-
const uiVueGen = new UiMjsGroupGenerator();
|
759
|
-
const uiGroupSrc = uiVueGen.generate(res.csAst, res.groupName);
|
760
|
-
fs.writeFileSync(uiGroupPath, uiGroupSrc);
|
761
|
-
const uiIndexGen = new UiMjsIndexGenerator();
|
762
|
-
const uiIndexSrc = uiIndexGen.generate(fs.readdirSync(info.uiMjsDir));
|
763
|
-
fs.writeFileSync(path.join(info.uiMjsDir, `index.mjs`), uiIndexSrc);
|
764
|
-
}
|
754
|
+
let uiFileName = info.uiMjsDir ? `${res.groupName}.mjs` : null;
|
765
755
|
const tsdContent = createTsdFile(info, {
|
766
756
|
prompt: titleBar.content.replaceAll('/*', '').replaceAll('*/', ''),
|
767
757
|
apiFileName,
|
@@ -783,6 +773,18 @@ function chooseFile(ctx, info, gist, comamnd) {
|
|
783
773
|
fs.writeFileSync(fullApiPath, apiContent, { encoding: 'utf-8' });
|
784
774
|
console.log(`Saved: ${fullApiPath}`);
|
785
775
|
}
|
776
|
+
if (info.uiMjsDir) {
|
777
|
+
const uiGroupPath = path.join(info.uiMjsDir, uiFileName);
|
778
|
+
const uiVueGen = new UiMjsGroupGenerator();
|
779
|
+
const uiGroupSrc = uiVueGen.generate(res.csAst, res.groupName);
|
780
|
+
fs.writeFileSync(uiGroupPath, uiGroupSrc);
|
781
|
+
console.log(`Saved: ${uiGroupPath}`);
|
782
|
+
const uiIndexGen = new UiMjsIndexGenerator();
|
783
|
+
const uiIndexSrc = uiIndexGen.generate(fs.readdirSync(info.uiMjsDir));
|
784
|
+
const uiIndexPath = path.join(info.uiMjsDir, `index.mjs`);
|
785
|
+
fs.writeFileSync(uiIndexPath, uiIndexSrc);
|
786
|
+
console.log(`Saved: ${uiIndexPath}`);
|
787
|
+
}
|
786
788
|
if (fs.existsSync(path.dirname(fullMigrationPath))) {
|
787
789
|
fs.writeFileSync(fullMigrationPath, migrationContent, { encoding: 'utf-8' });
|
788
790
|
console.log(`Saved: ${fullMigrationPath}`);
|