Skip to content

Commit

Permalink
fixed package json not being created correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser committed Mar 30, 2024
1 parent d4e57a8 commit 7e35e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ async function main() {
// 2. Get Configs and modules
const { configs, modules } = getConfigs(preferences)

/*
await wrapInSpinner('Building `package.json`', buildPackage, template.dir, configs, modules)
*/
// 3. Build `package.json`
await wrapInSpinner('Building `package.json`', buildPackage, preferences, configs, modules)

// 4. Build `nuxt.config.ts`
await wrapInSpinner('Building `nuxt.config.ts`', buildNuxtConfig, template.dir, configs, modules)

Expand Down
8 changes: 4 additions & 4 deletions src/steps/3.buildPackage.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Config, Dependency, ModuleConfig, Script } from '../types'
import type { Config, Dependency, ModuleConfig, Preferences, Script } from '../types'
import { addPackageDependencies } from '../utils/package/addPackageDependency'
import { addPackageScripts } from '../utils/package/addPackageScript'

export default async function (templateDir: string, configs: Config[], modules: ModuleConfig[]) {
export default async function (preferences: Preferences, configs: Config[], modules: ModuleConfig[]) {
// If no configs or modules were passed, skip.
if (configs.length === 0 && modules.length === 0) {
return
Expand All @@ -23,13 +23,13 @@ export default async function (templateDir: string, configs: Config[], modules:

// 2. Add the dependencies to the `package.json`
await addPackageDependencies({
projectDir: templateDir,
projectDir: preferences.setProjectName,
dependencies: dependenciesToAdd
})

// 3. Add the scripts to the `package.json`
await addPackageScripts({
projectDir: templateDir,
projectDir: preferences.setProjectName,
scripts: scriptsToAdd
})
}

0 comments on commit 7e35e0f

Please sign in to comment.