Skip to content

Commit

Permalink
chore: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Apr 3, 2024
1 parent b5a8ee7 commit fe35d4d
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 51 deletions.
33 changes: 33 additions & 0 deletions .aeria/aeria.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// this file will be overwritten
import type {} from '@aeriajs/types'

declare global {
type UnpackCollections<TCollections> = {
[P in keyof TCollections]: TCollections[P] extends infer Candidate
? Candidate extends (...args: any[]) => infer Coll
? Coll
: Candidate
: never
}

type Collections = typeof import('../src/index.ts') extends infer EntrypointModule
? 'collections' extends keyof EntrypointModule
? UnpackCollections<EntrypointModule['collections']>
: 'default' extends keyof EntrypointModule
? EntrypointModule['default'] extends infer Entrypoint
? 'options' extends keyof Entrypoint
? 'collections' extends keyof Entrypoint['options']
? UnpackCollections<Entrypoint['options']['collections']>
: never
: never
: never
: never
: never
}

declare module 'aeria' {
import type { Context } from 'aeria'
export const useAeria: () => Promise<Context>
export const aeria: Context
}
//
204 changes: 165 additions & 39 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"typescript": "^5.4.0-beta"
},
"dependencies": {
"aeria": "^0.0.66",
"husky": "^9.0.10"
}
}
13 changes: 1 addition & 12 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const moveFolder = async (workspace, origin) => {
const updateDependency = async (workspace, dependencies) => {
const proc = spawn(
'npm',
['install', '--lockfile-only'].concat(dependencies.map((dep) => `${dep}@latest`)),
['install'].concat(dependencies.map((dep) => `${dep}@latest`)),
workspace
? { cwd: workspace }
: {}
Expand Down Expand Up @@ -83,17 +83,6 @@ const main = async () => {
])

await fs.promises.writeFile(LOCK_FILENAME, '')

const proc = spawn('npm', ['install'])

/** @type Promise<void> */
const promise = new Promise((resolve) => {
proc.on('close', () => {
resolve()
})
})

await promise
}

}
Expand Down

0 comments on commit fe35d4d

Please sign in to comment.