Skip to content

Commit

Permalink
chore: update postinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Mar 24, 2024
1 parent 10c22be commit 0d7586c
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ const moveFolder = async (workspace, origin) => {
}

/**
* @param {string} workspace
* @param {string | null} workspace
* @param {string[]} dependencies
*/
const updateDependency = async (workspace, dependencies) => {
const proc = spawn('npm', ['install'].concat(dependencies), {
cwd: workspace
})
const proc = spawn(
'npm',
['install'].concat(dependencies),
workspace
? { cwd: workspace }
: {}
)

proc.stdout.pipe(process.stdout)
proc.stderr.pipe(process.stderr)
Expand All @@ -56,17 +60,25 @@ const main = async () => {
await moveFolder('api', '.aeria')
await moveFolder('web', '.aeria-ui')

console.log('[info] updating dependencies...')

await updateDependency(null, [
'dualist',
'eslint-config-aeria',
])

await updateDependency('api', [
'aeria',
'aeria-build',
'aeria-sdk'
'aeria-sdk',
])

await updateDependency('web', [
'@aeria-ui/i18n-en',
'aeria-app-layout',
'aeria-ui',
'aeria-ui-build',
'aeria-app-layout',
'@aeria-ui/i18n-en'
'eslint-config-aeriaui',
])
}

Expand Down

0 comments on commit 0d7586c

Please sign in to comment.