Skip to content

Commit

Permalink
Adds more imports
Browse files Browse the repository at this point in the history
  • Loading branch information
olih committed Jan 9, 2025
1 parent 0c6a3a5 commit 9532e47
Showing 1 changed file with 50 additions and 25 deletions.
75 changes: 50 additions & 25 deletions src/incy-wincy-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,8 @@ const programmingLanguage = z
.enum(programmingLanguageKey)
.describe(describeEnum('Programming Language:', programmingLanguageLabels));

const blockKindKey = [
'class',
'interface',
'const',
'function',
'test',
'other',
'import',
] as const;

const blockKindlabels = {
class: 'Class',
interface: 'Interface',
const: 'Constant',
function: 'Function',
test: 'Test',
other: 'Other',
import: 'Import',
};

const blockKind = z
.enum(blockKindKey)
.describe(describeEnum('Language block kind:', blockKindlabels));

const codeSection = {
name: stringFields.string1To80.describe('Name of the class'),
name: stringFields.string1To80.describe('Name of the section'),
body: stringFields.string1To1000.describe('The full code of the block'),
uncommentedBody: stringFields.string1To1000.describe(
'The code of the block with comments removed'
Expand All @@ -53,3 +29,52 @@ const classSection = z.object({
kind: z.literal('class').describe('Class'),
...codeSection,
});

const interfaceSection = z.object({

Check failure on line 33 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'interfaceSection' is declared but its value is never read.

Check failure on line 33 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'interfaceSection' is declared but its value is never read.
kind: z.literal('interface').describe('Interface'),
...codeSection,
});

const enumSection = z.object({

Check failure on line 38 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'enumSection' is declared but its value is never read.

Check failure on line 38 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'enumSection' is declared but its value is never read.
kind: z.literal('enum').describe('Enum'),
...codeSection,
});

const constSection = z.object({

Check failure on line 43 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'constSection' is declared but its value is never read.

Check failure on line 43 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'constSection' is declared but its value is never read.
kind: z.literal('const').describe('Const'),
...codeSection,
});

const functionSection = z.object({

Check failure on line 48 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'functionSection' is declared but its value is never read.

Check failure on line 48 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'functionSection' is declared but its value is never read.
kind: z.literal('function').describe('Function'),
...codeSection,
});

const testSection = z.object({

Check failure on line 53 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'testSection' is declared but its value is never read.

Check failure on line 53 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'testSection' is declared but its value is never read.
kind: z.literal('test').describe('Test'),
...codeSection,
});

const otherSection = z.object({

Check failure on line 58 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'otherSection' is declared but its value is never read.

Check failure on line 58 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'otherSection' is declared but its value is never read.
kind: z.literal('other').describe('Other'),
...codeSection,
});

const ImportSchema = z.object({

Check failure on line 63 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and macOS-latest

'ImportSchema' is declared but its value is never read.

Check failure on line 63 in src/incy-wincy-model.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test on Node 18.x and ubuntu-latest

'ImportSchema' is declared but its value is never read.
type: z.literal('default').or(z.literal('named')).or(z.literal('namespace')),
source: z.string().url().optional(),
defaultImport: z.string().optional(),
namedImports: z.array(z.string()).optional(),
namespace: z.string().optional(),
});

const importSection = {
kind: z.literal('import').describe('Import'),
body: stringFields.string1To1000.describe('The full code of the block'),
uncommentedBody: stringFields.string1To1000.describe(
'The code of the block with comments removed'
),
importPaths: z
.array(stringFields.string1To140)
.describe('Paths of the imports'),
};

0 comments on commit 9532e47

Please sign in to comment.