okai 0.0.7 → 0.0.9

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/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { leftPart } from "./utils";
1
+ import { leftPart } from "./utils.js";
2
2
  export function parseTsdHeader(tsd) {
3
3
  const header = tsd.includes('/*prompt:')
4
4
  ? leftPart(tsd, '*/').replace('/*prompt:', '').trim()
package/dist/cs-apis.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getGroupName, splitCase } from "./utils";
2
- import { CSharpGenerator } from "./cs-gen";
1
+ import { getGroupName, splitCase } from "./utils.js";
2
+ import { CSharpGenerator } from "./cs-gen.js";
3
3
  export class CSharpApiGenerator extends CSharpGenerator {
4
4
  toApiClass(op) {
5
5
  const cls = op.request;
package/dist/cs-ast.js CHANGED
@@ -1,5 +1,5 @@
1
- import { plural, toPascalCase } from "./utils";
2
- import { Icons } from "./icons";
1
+ import { plural, toPascalCase } from "./utils.js";
2
+ import { Icons } from "./icons.js";
3
3
  const sys = (name, genericArgs) => ({ name, namespace: "System", genericArgs });
4
4
  const sysObj = sys("object");
5
5
  const sysDictObj = { name: "Dictionary", genericArgs: ["string", "object"], namespace: "System.Collections.Generic" };
package/dist/cs-gen.js CHANGED
@@ -1,4 +1,4 @@
1
- import { leftPart } from "./utils";
1
+ import { leftPart } from "./utils.js";
2
2
  export class CSharpGenerator {
3
3
  namespaces = [];
4
4
  apis = [];
@@ -1,5 +1,5 @@
1
- import { CSharpGenerator } from "./cs-gen";
2
- import { indentLines } from "./utils";
1
+ import { CSharpGenerator } from "./cs-gen.js";
2
+ import { indentLines } from "./utils.js";
3
3
  export class CSharpMigrationGenerator extends CSharpGenerator {
4
4
  generate(ast) {
5
5
  this.namespaces = Array.from(new Set([
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import blessed from 'blessed';
4
- import { projectInfo } from './info';
5
- import { getGroupName, leftPart, replaceMyApp, trimStart } from "./utils";
6
- import { toAst } from "./ts-ast";
7
- import { toMetadataTypes } from "./cs-ast";
8
- import { CSharpApiGenerator } from "./cs-apis";
9
- import { CSharpMigrationGenerator } from "./cs-migrations";
10
- import { TsdDataModelGenerator } from "./tsd-gen";
11
- import { parseTsdHeader, toTsdHeader } from "./client";
4
+ import { projectInfo } from './info.js';
5
+ import { getGroupName, leftPart, replaceMyApp, trimStart } from "./utils.js";
6
+ import { toAst } from "./ts-ast.js";
7
+ import { toMetadataTypes } from "./cs-ast.js";
8
+ import { CSharpApiGenerator } from "./cs-apis.js";
9
+ import { CSharpMigrationGenerator } from "./cs-migrations.js";
10
+ import { TsdDataModelGenerator } from "./tsd-gen.js";
11
+ import { parseTsdHeader, toTsdHeader } from "./client.js";
12
12
  function normalizeSwitches(cmd) { return cmd.replace(/^-+/, '/'); }
13
13
  function parseArgs(...args) {
14
14
  const ret = {
@@ -518,6 +518,8 @@ function chooseFile(ctx, info, gist) {
518
518
  const fullTsdPath = path.join(info.slnDir, relativeServiceModelDir, tsdFileName);
519
519
  const fullApiPath = path.join(info.slnDir, relativeServiceModelDir, apiFileName);
520
520
  const fullMigrationPath = path.join(info.slnDir, relativeMigrationDir, migrationFileName);
521
+ const clearScreen = blessed.screen();
522
+ clearScreen.render();
521
523
  if (!fs.existsSync(path.dirname(fullTsdPath))) {
522
524
  console.log(`Directory does not exist: ${path.dirname(fullTsdPath)}`);
523
525
  process.exit(0);
package/dist/okai.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #! /usr/bin/env node
2
- import { cli } from './index';
2
+ import { cli } from './index.js';
3
3
  await cli(process.argv.slice(2));
4
4
  export { cli };
package/dist/ts-ast.js CHANGED
@@ -1,4 +1,4 @@
1
- import { TypeScriptParser } from "./ts-parser";
1
+ import { TypeScriptParser } from "./ts-parser.js";
2
2
  export function toTypeScriptSrc(msg) {
3
3
  msg = msg.trim();
4
4
  const startPos = msg.indexOf("```typescript");
package/dist/tsd-gen.js CHANGED
@@ -1,4 +1,4 @@
1
- import { toPascalCase, toCamelCase } from "./utils";
1
+ import { toPascalCase, toCamelCase } from "./utils.js";
2
2
  export class TsdGenerator {
3
3
  interfaces = [];
4
4
  enums = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "okai",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "bin": "./dist/okai.js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "build": "bun run clean && tsc",
16
+ "build-bun": "bun run clean && bun build.ts",
16
17
  "clean": "shx rm -rf ./dist",
17
18
  "test": "bun test --",
18
19
  "prepublishOnly": "bun run build",