Skip to content

Commit

Permalink
chore(deps): update all non-major dependencies (#74)
Browse files Browse the repository at this point in the history
* chore(deps): update all non-major dependencies

* chore(build): upgrade support lower node version, fix test case

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cphayim <i@cphayim.me>
  • Loading branch information
renovate[bot] and Cphayim authored Feb 26, 2024
1 parent e60b0dc commit b9044b5
Show file tree
Hide file tree
Showing 16 changed files with 1,171 additions and 1,371 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "git@github.com:vrn-deco/cli.git",
"license": "MIT",
"engines": {
"node": "^14.13.1 || >=16.0.0"
"node": ">=16.14.0"
},
"packageManager": "pnpm@8.15.4",
"scripts": {
Expand Down Expand Up @@ -40,27 +40,27 @@
]
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@ombro/eslint-config-typescript": "^0.1.3",
"@ombro/eslint-config-typescript": "^0.1.4",
"@ombro/logger": "^1.5.5",
"@ombro/tsconfig": "^1.4.3",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/fs-extra": "^11.0.2",
"@types/node": "^18.16.16",
"@vitest/coverage-c8": "^0.31.1",
"@vitest/ui": "^0.31.1",
"@ombro/tsconfig": "^2.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/fs-extra": "^11.0.4",
"@types/node": "^18.19.18",
"@vitest/coverage-v8": "^0.34.6",
"@vitest/ui": "^0.34.7",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.41.0",
"eslint": "^8.57.0",
"execa": "^6.1.0",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"tsx": "^3.12.7",
"typescript": "^4.8.2",
"vitest": "^0.31.1"
"tsx": "^4.6.2",
"typescript": "^5.3.3",
"vitest": "^0.34.6"
}
}
4 changes: 2 additions & 2 deletions packages/check-update/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-npm-helper": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"semver": "^7.5.1"
"semver": "^7.6.0"
},
"devDependencies": {
"@types/semver": "^7.5.0"
"@types/semver": "^7.5.8"
}
}
2 changes: 1 addition & 1 deletion packages/check-update/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import semver from 'semver'

import { BaseConfig, readConfig, updateConfig } from '@vrn-deco/cli-config-helper'
import { type BaseConfig, readConfig, updateConfig } from '@vrn-deco/cli-config-helper'
import { boxen, colors, dedent, logger } from '@vrn-deco/cli-log'
import { queryPackageLatestVersion } from '@vrn-deco/cli-npm-helper'

Expand Down
14 changes: 7 additions & 7 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/vrn-deco/cli#readme",
"license": "MIT",
"engines": {
"node": "^14.13.1 || >=16.0.0"
"node": ">=16.14.0"
},
"bin": {
"vrn": "bin/vrn-cli.js",
Expand Down Expand Up @@ -44,16 +44,16 @@
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-npm-helper": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"dotenv": "^16.3.1",
"fs-extra": "^11.1.1",
"dotenv": "^16.4.5",
"fs-extra": "^11.2.0",
"gradient-string": "^2.0.2",
"import-local": "^3.1.0",
"root-check": "^2.0.0",
"semver": "^7.5.1"
"semver": "^7.6.0"
},
"devDependencies": {
"@types/gradient-string": "^1.1.2",
"@types/root-check": "^1.0.0",
"@types/semver": "^7.5.0"
"@types/gradient-string": "^1.1.5",
"@types/root-check": "^1.0.2",
"@types/semver": "^7.5.8"
}
}
8 changes: 4 additions & 4 deletions packages/command-boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-npm-helper": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"compressing": "^1.9.0",
"compressing": "^1.10.0",
"execa": "^6.1.0",
"fs-extra": "^11.1.1",
"node-fetch": "^3.3.1",
"yaml": "^2.3.1"
"fs-extra": "^11.2.0",
"node-fetch": "^3.3.2",
"yaml": "^2.3.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,28 @@ const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const MOCK_MANIFEST_MAIN_SCRIPT = path.join(__dirname, '..', '__mocks__', 'mock-manifest.cjs')

// hoist to mock variables
// @see https://vitest.dev/api/vi.html#vi-mock
const { mockReadConfig, json, fetch } = vi.hoisted(() => {
// mock node-fetch
const json = vi.fn(() => ({}))
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const fetch = vi.fn((_url: string) => Promise.resolve({ json, ok: true, body: {}, statusText: 'ok' }))
return {
mockReadConfig: vi.fn(() => ({ npmRegistry: NPMRegistry.NPM, packageManager: PackageManager.NPM })),
json,
fetch,
}
})

// mock readConfig
const readConfig = vi.fn(() => ({ npmRegistry: NPMRegistry.NPM, packageManager: PackageManager.NPM }))
vi.mock('@vrn-deco/cli-config-helper', async () => {
const cliConfigHelper = await vi.importActual<typeof import('@vrn-deco/cli-config-helper')>(
'@vrn-deco/cli-config-helper',
)
return {
...cliConfigHelper,
readConfig,
readConfig: mockReadConfig,
}
})

Expand All @@ -35,9 +48,6 @@ const NPMPackageLoadSpy = vi.spyOn(NPMPackage.prototype, 'load').mockImplementat
const getMainScriptSpy = vi.spyOn(NPMPackage.prototype, 'mainScript', 'get').mockReturnValue(MOCK_MANIFEST_MAIN_SCRIPT)

// mock node-fetch
const json = vi.fn(() => ({}))
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const fetch = vi.fn((_url: string) => Promise.resolve({ json, ok: true, body: {}, statusText: 'ok' }))
vi.mock('node-fetch', () => ({ default: fetch }))

// mock fs.createWriteStream and pipeline
Expand All @@ -57,20 +67,20 @@ beforeAll(() => {

describe('@vrn-deco/cli-command-boilerplate -> services -> boilerplate.service.ts -> PackageBoilerplateService', () => {
beforeEach(() => {
readConfig.mockClear()
mockReadConfig.mockClear()
NPMPackageLoadSpy.mockClear()
getMainScriptSpy.mockClear()
})

afterAll(() => {
readConfig.mockRestore()
mockReadConfig.mockRestore()
NPMPackageLoadSpy.mockRestore()
getMainScriptSpy.mockRestore()
})

it('Can correct load and cache manifest', async () => {
const service = new PackageBoilerplateService()
expect(readConfig).toBeCalled()
expect(mockReadConfig).toBeCalled()
const manifest = await service.loadManifest()
expect(NPMPackageLoadSpy).toBeCalled()
expect(getMainScriptSpy).toBeCalled()
Expand Down
2 changes: 1 addition & 1 deletion packages/command-boilerplate/src/clear/clear.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import fs from 'fs-extra'

import { Action, ActionArgs } from '@vrn-deco/cli-command'
import { Action, type ActionArgs } from '@vrn-deco/cli-command'
import { logger } from '@vrn-deco/cli-log'

import { getCacheDirectory } from '../utils.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/command-boilerplate/src/create/create.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from 'node:path'
import fs from 'fs-extra'

import type { APIBoilerplate, Boilerplate, Lang } from '@vrn-deco/boilerplate-protocol'
import { Action, ActionArgs, prompt } from '@vrn-deco/cli-command'
import { Action, type ActionArgs, prompt } from '@vrn-deco/cli-command'
import { colors, logger } from '@vrn-deco/cli-log'

import type { ModeOptions, PostGit } from '../common.js'
Expand Down
4 changes: 2 additions & 2 deletions packages/command-boilerplate/src/list/list.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import fs from 'fs-extra'
import YAML from 'yaml'

import type { Manifest } from '@vrn-deco/boilerplate-protocol'
import { Action, ActionArgs } from '@vrn-deco/cli-command'
import { Action, type ActionArgs } from '@vrn-deco/cli-command'
import { colors } from '@vrn-deco/cli-log'

import { IBoilerplateProvider, PackageBoilerplateService } from '../services/boilerplate.service.js'
import { type IBoilerplateProvider, PackageBoilerplateService } from '../services/boilerplate.service.js'

type ListArguments = []
type ListOptions = {
Expand Down
4 changes: 2 additions & 2 deletions packages/command-config/src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* @Date: 2021-07-23 15:33:13
* @Description: config command action
*/
import { Action, ActionArgs, prompt } from '@vrn-deco/cli-command'
import { BaseConfig, readConfig, updateConfig } from '@vrn-deco/cli-config-helper'
import { Action, type ActionArgs, prompt } from '@vrn-deco/cli-command'
import { type BaseConfig, readConfig, updateConfig } from '@vrn-deco/cli-config-helper'
import { colors, logger } from '@vrn-deco/cli-log'
import { NPMRegistry, PackageManager, noop } from '@vrn-deco/cli-shared'

Expand Down
4 changes: 2 additions & 2 deletions packages/command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"commander": "^11.1.0",
"inquirer": "^9.2.10"
"inquirer": "^9.2.15"
},
"devDependencies": {
"@types/inquirer": "^9.0.3"
"@types/inquirer": "^9.0.7"
}
}
2 changes: 1 addition & 1 deletion packages/config-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"dependencies": {
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"fs-extra": "^11.1.1"
"fs-extra": "^11.2.0"
}
}
4 changes: 2 additions & 2 deletions packages/npm-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@vrn-deco/cli-log": "workspace:*",
"@vrn-deco/cli-shared": "workspace:*",
"execa": "^6.1.0",
"fs-extra": "^11.1.1",
"node-fetch": "^3.3.1"
"fs-extra": "^11.2.0",
"node-fetch": "^3.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/npm-helper/src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { logger } from '@vrn-deco/cli-log'
import { NPMRegistry, PackageManager } from '@vrn-deco/cli-shared'

import { DistTag } from './common.js'
import { InstallOptions, installPackage } from './install.js'
import { type InstallOptions, installPackage } from './install.js'
import { queryPackageVersion } from './querier.js'
import { isDistTagVersion, isPackage, parseModuleMap } from './utils.js'

Expand Down
Loading

0 comments on commit b9044b5

Please sign in to comment.