Skip to content

Commit

Permalink
build: fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-fontaine committed May 14, 2023
1 parent a18f8d8 commit 6d7b47f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 33 deletions.
3 changes: 3 additions & 0 deletions apps/kazam/src/utils/define-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ export type KazamConfig = z.infer<typeof configSchema>
export type UserConfig = z.input<typeof configSchema>

export const defineConfig = (config: UserConfig) => configSchema.parse(config)

const assertType = <T>(_: T) => _
assertType<Parameters<ParserBase['load']>[0]>(<KazamConfig>{})
5 changes: 5 additions & 0 deletions packages/kaz-ast/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
failOnWarn: false,
})
6 changes: 4 additions & 2 deletions packages/kaz-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"./README.md": "./README.md"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
"dist",
"README.md"
],
"scripts": {
"build": "unbuild",
Expand Down
5 changes: 2 additions & 3 deletions packages/kaz-ast/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse as _parse, tokenize as _tokenize } from './lib/voltair'
import type { ParserError, Token } from './lib/voltair'
import { type KazAst, kazAstSchema } from './types/KazAst'
import type { KazAst } from './types/KazAst'
import config from './voltair.config'

export const tokenize = (input: string) => {
Expand All @@ -11,5 +11,4 @@ export const parse = (tokens: Token[]) => {
return _parse(tokens, config.entry) as ParserError | KazAst | undefined
}

export { kazAstSchema, type KazAst }
export * as schemas from './types/KazAst'
export * from './types/KazAst'
12 changes: 10 additions & 2 deletions packages/parser-base/src/parser-base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import type { ITransformerInput } from '@whitebird/kazam-transformer-base'
import type { ITransformerInput, TransformerBase } from '@whitebird/kazam-transformer-base'

import type { KazamConfig } from './types/KazamConfig'
type Transformer = new (...args: ConstructorParameters<typeof TransformerBase>) => TransformerBase
type Parser = new (...args: ConstructorParameters<typeof ParserBase>) => ParserBase

interface KazamConfig {
input: string[]
output: string
transformers: [Transformer, ...Transformer[]]
parsers: [Parser, ...Parser[]]
}

export abstract class ParserBase {
abstract load(config: KazamConfig): unknown | Promise<unknown>
Expand Down
19 changes: 0 additions & 19 deletions packages/parser-base/src/types/KazamConfig.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/transformer-react/src/transformer-react.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'node:path'

import { schemas } from '@whitebird/kaz-ast'
import * as schemas from '@whitebird/kaz-ast'
import { type ITransformerOutput, TransformerBase } from '@whitebird/kazam-transformer-base'
import prettier from 'prettier'
import type { z } from 'zod'
Expand Down
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d7b47f

Please sign in to comment.