Skip to content

Commit d4998de

Browse files
committed
Merge branch 'main' of https://github.com/zce/velite
2 parents 4153bc4 + 146a4d8 commit d4998de

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/guide/using-collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export { default as others } from './others.json'
3434
```
3535

3636
```js [index.d.ts]
37-
import config from '../velite.config'
37+
import type __vc from '../velite.config.js'
3838

39-
type Collections = typeof config.collections
39+
type Collections = typeof __vc.collections
4040

4141
export type Post = Collections['posts']['schema']['_output']
4242
export declare const posts: Post[]

src/output.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export const outputEntry = async (dest: string, format: Output['format'], config
3737
const configModPath = relative(dest, configPath).replace(/\\/g, '/')
3838

3939
const entry: string[] = []
40-
const dts: string[] = [`import type config from '${configModPath}'\n`]
41-
dts.push('type Collections = typeof config.collections\n')
40+
const dts: string[] = [`import type __vc from '${configModPath}'\n`]
41+
dts.push('type Collections = typeof __vc.collections\n')
4242

4343
Object.entries(collections).map(([name, collection]) => {
4444
if (format === 'cjs') {

test/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test('standalone fixtures', async t => {
1212
equal(entry.length, 288, 'entry output length should be 288')
1313

1414
const dts = await readFile('examples/basic/.velite/index.d.ts', 'utf8')
15-
equal(dts.length, 636, 'dts output length should be 636')
15+
equal(dts.length, 632, 'dts output length should be 632')
1616

1717
const options = await readFile('examples/basic/.velite/options.json', 'utf8')
1818
equal(options.length, 1121, 'options output length should be 1121')

test/nextjs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('integration with nextjs fixtures', async t => {
1111
equal(entry.length, 288, 'entry output length should be 288')
1212

1313
const dts = await readFile('examples/nextjs/.velite/index.d.ts', 'utf8')
14-
equal(dts.length, 636, 'dts output length should be 636')
14+
equal(dts.length, 632, 'dts output length should be 632')
1515

1616
const options = await readFile('examples/nextjs/.velite/options.json', 'utf8')
1717
equal(options.length, 775, 'options output length should be 775')

0 commit comments

Comments
 (0)