Skip to content

Commit

Permalink
feat: upgrade to untyped 0.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 18, 2021
1 parent 3ed5d48 commit a7f50b8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"rollup-plugin-esbuild": "^4.7.1",
"scule": "^0.2.1",
"typescript": "^4.5.2",
"untyped": "^0.2.9"
"untyped": "^0.3.0"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "latest",
Expand Down
2 changes: 1 addition & 1 deletion src/builder/untyped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function typesBuild (ctx: BuildContext) {
await writeFile(resolve(distDir, `${entry.name}.schema.json`), JSON.stringify(schema, null, 2))
await writeFile(resolve(distDir, `${entry.name}.defaults.json`), JSON.stringify(defaults, null, 2))
if (entry.declaration) {
await writeFile(resolve(distDir, `${entry.name}.d.ts`), 'export ' + generateTypes(schema, pascalCase(entry.name + '-schema')))
await writeFile(resolve(distDir, `${entry.name}.d.ts`), generateTypes(schema, pascalCase(entry.name + '-schema')))
}
}
}
1 change: 1 addition & 0 deletions test/fixture/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { BuildConfig } from 'unbuild'

export default <BuildConfig>{
cjsBridge: true,
declaration: true,
entries: [
'src/index',
{ input: 'src/schema', builder: 'untyped' }
Expand Down
1 change: 1 addition & 0 deletions test/fixture/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ console.log(require('os').arch())
console.log(require.resolve('rollup'))
import('os').then(os => console.log(os.arch()))

// @ts-ignore
import('./test.html').then(console.log)

export const foo = 'bar'
6 changes: 5 additions & 1 deletion test/fixture/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export const config = {
foo: 'bar'
foo: 'bar',
/**
* @type {typeof import('untyped').BuildConfig}
*/
build: {}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3117,10 +3117,10 @@ universalify@^2.0.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

untyped@^0.2.9:
version "0.2.13"
resolved "https://registry.yarnpkg.com/untyped/-/untyped-0.2.13.tgz#31be48c9cf1d81b65d05f762a0332b2b5e9a9cb3"
integrity sha512-dnvCmDKTb+zg504JyQ9h1sWINAyxnP6KgmvUH6s6BjLV+3fvjZTiUklL15VvEqpDjy4Leq/xzlZ+JxskeoM5mg==
untyped@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/untyped/-/untyped-0.3.0.tgz#854df4dec055cc6a0a2217aa2d20152277b6ada9"
integrity sha512-n4M5/T1wWlHFmohk0EhS+yM7W/h5dOtQldOV3MVEbZY1fTy5A47UL8+d8GLW1iwmaAwNrM5ERy3qe1k0T/Yc7A==

uri-js@^4.2.2:
version "4.4.1"
Expand Down

0 comments on commit a7f50b8

Please sign in to comment.