Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/migrate-ts7-vite-plus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"zile": patch
---

Migrated the repository from Biome and Vitest to Vite+ (Oxlint, Oxfmt, Vitest 4), and from TypeScript 5 to TypeScript 7. JSDoc example checking (`zile examples:check`, `zile build --check-examples`) now uses the TypeScript 7 `typescript/unstable/ast` scanner and requires `typescript@>=7` to be installed; it is loaded lazily so the rest of the CLI keeps working without TypeScript installed.
30 changes: 21 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bun run test # Run tests
When you observe patterns or style preferences that emerge during development or code review, please proactively update this guide to capture them. This helps maintain consistency and provides clear guidance for future contributions (both human and AI).

Look for opportunities to document:

- New coding patterns or conventions
- Style preferences that come up in discussions
- Refactoring patterns that improve code quality
Expand Down Expand Up @@ -84,12 +85,14 @@ git push origin feature/my-feature
**Always use namespace imports, never named imports:**

✅ **Good:**

```typescript
import * as fs from 'node:fs/promises'
import * as path from 'node:path'
```

❌ **Bad:**

```typescript
import { readFile } from 'node:fs/promises'
import { join } from 'node:path'
Expand All @@ -100,10 +103,11 @@ import { join } from 'node:path'
**All exported functions must have a corresponding namespace for types:**

✅ **Good:**

```typescript
/**
* Does something useful.
*
*
* @param options - Configuration options
* @returns Result of the operation
*/
Expand All @@ -121,6 +125,7 @@ export declare namespace doSomething {
```

❌ **Bad:**

```typescript
// Don't inline types
export function doSomething(options: { value?: string }) {
Expand All @@ -138,6 +143,7 @@ export function doSomething({ value = 'default' }: Options) {
**Never destructure parameters in function definitions:**

✅ **Good:**

```typescript
export function process(options: process.Options) {
const { input = 'default', verbose = false } = options
Expand All @@ -146,6 +152,7 @@ export function process(options: process.Options) {
```

❌ **Bad:**

```typescript
export function process({ input = 'default', verbose = false }: process.Options) {
// ... implementation
Expand All @@ -157,14 +164,16 @@ export function process({ input = 'default', verbose = false }: process.Options)
**All exported functions must have complete JSDoc:**

Required JSDoc tags:

- `@param` for each parameter with description
- `@returns` or `@return` for return value with description

✅ **Good:**

```typescript
/**
* Finds all packages matching the given patterns.
*
*
* @param options - Search options
* @returns Array of package paths
*/
Expand All @@ -174,6 +183,7 @@ export async function findPackages(options: findPackages.Options) {
```

❌ **Bad:**

```typescript
// Missing parameter and return documentation
/**
Expand All @@ -189,6 +199,7 @@ export async function findPackages(options: findPackages.Options) {
**Avoid ternaries, use IIFEs for conditional assignments:**

✅ **Good:**

```typescript
const globPattern = (() => {
if (pattern.endsWith('package.json')) return pattern
Expand All @@ -197,24 +208,23 @@ const globPattern = (() => {
```

❌ **Bad:**

```typescript
const globPattern = pattern.endsWith('package.json')
? pattern
: `${pattern}/package.json`
const globPattern = pattern.endsWith('package.json') ? pattern : `${pattern}/package.json`
```

**Remove curly braces when possible:**

✅ **Good:**

```typescript
for (const item of items)
process(item)
for (const item of items) process(item)

if (condition)
doSomething()
if (condition) doSomething()
```

❌ **Bad:**

```typescript
for (const item of items) {
process(item)
Expand Down Expand Up @@ -249,6 +259,7 @@ bun run test -u # Update snapshots
**Test naming convention:**

✅ **Good:**

```typescript
it('finds package.json with default options', async () => {
// test implementation
Expand All @@ -260,6 +271,7 @@ it('returns empty array when no packages found', async () => {
```

❌ **Bad:**

```typescript
it('should find package.json with default options', async () => {
// test implementation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
run: bun install

- name: Prerelease
run: |
run: |
bun run build
bunx pkg-pr-new publish --bun
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ Point to your source file:
```

> **↓↓↓ Output**
> >
>
> Zile transforms this to point to the built file and generates `exports`, `module` and `types` fields:
>
> ```json
> {
> "name": "my-pkg",
Expand Down Expand Up @@ -213,8 +214,8 @@ Point to your source files directly:
```

> **↓↓↓ Output**
>
>Zile expands each entrypoint to include types and built files:
>
> Zile expands each entrypoint to include types and built files:
>
> ```json
> {
Expand Down Expand Up @@ -257,9 +258,9 @@ Point to your source file:
```

> **↓↓↓ Output**
>
>
> Zile creates both the built binary and preserves a `.src` reference:
>
>
> ```json
> {
> "name": "my-cli",
Expand Down Expand Up @@ -289,9 +290,9 @@ Use keys with `.src` suffix to indicate source files:
```

> **↓↓↓ Output**
>
>
> Zile creates built versions without the `.src` suffix:
>
>
> ```json
> {
> "name": "my-cli",
Expand Down Expand Up @@ -326,10 +327,10 @@ When using `zile publish:prepare`, only fields that appear **after** the `[!star
"scripts": {
"build": "zile build",
"publish": "zile publish:prepare && npm publish && zile publish:post",
"test": "vitest"
"test": "vp test"
},
"devDependencies": {
"typescript": "^5.0.0"
"typescript": "^7.0.0"
},
+ "[!start-pkg]": "",
"name": "my-pkg",
Expand Down Expand Up @@ -373,7 +374,7 @@ Usage:
$ zile [root]

Commands:
[root]
[root]
build Build package
dev Resolve package exports to source for development
new Create a new zile project
Expand All @@ -389,15 +390,14 @@ For more info, run any command with the `--help` flag:
$ zile publish:post --help

Options:
--cwd <directory> Working directory to build
--includes <patterns...> Glob patterns to include
--project <path> Path to tsconfig.json file, relative to the working directory.
--tsgo Use tsgo for transpilation
-v, --version Display version number
-h, --help Display this message
--cwd <directory> Working directory to build
--includes <patterns...> Glob patterns to include
--project <path> Path to tsconfig.json file, relative to the working directory.
--tsgo Use tsgo for transpilation
-v, --version Display version number
-h, --help Display this message
```

## License

[MIT](./LICENSE) License.

36 changes: 0 additions & 36 deletions biome.json

This file was deleted.

Loading
Loading