Skip to content

Commit

Permalink
fix: remove bluebird in favor of p-map
Browse files Browse the repository at this point in the history
  • Loading branch information
tusbar committed Dec 23, 2024
1 parent a6d7f4a commit 2e25af5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
12 changes: 4 additions & 8 deletions codegen/generate-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import os from 'node:os'
import {basename, parse as parsePath} from 'node:path'
import {promisify} from 'node:util'

import Bluebird from 'bluebird'
import camelCase from 'camelcase'
import {globby} from 'globby'
import jsonfile from 'jsonfile'
import {kebabCase, reduce} from 'lodash-es'
import {type OpenAPIV3} from 'openapi-types'
import pMap from 'p-map'
import {remark} from 'remark'
import remarkStrip from 'strip-markdown'
import {type PackageJson} from 'type-fest'
Expand Down Expand Up @@ -270,11 +270,7 @@ export async function generateClients() {
cwd: 'selling-partner-api-models/models',
})

await Bluebird.map(
modelFilePaths,
async (modelFilePath) => generateClientVersion(modelFilePath),
{
concurrency: os.cpus().length,
},
)
await pMap(modelFilePaths, async (modelFilePath) => generateClientVersion(modelFilePath), {
concurrency: os.cpus().length,
})
}
4 changes: 2 additions & 2 deletions codegen/generate-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import fs, {mkdir} from 'node:fs/promises'
import os from 'node:os'
import {basename, parse as parsePath} from 'node:path'

import Bluebird from 'bluebird'
import camelCase from 'camelcase'
import {globby} from 'globby'
import {kebabCase} from 'lodash-es'
import pMap from 'p-map'

import {logger} from './utils/logger.js'

Expand Down Expand Up @@ -93,7 +93,7 @@ export async function generateDirectorySchemas(schemaDirectory: string, director
const outputDirectory = `packages/schemas/src/${directoryName}`
await mkdir(outputDirectory, {recursive: true})

const schemas = await Bluebird.map(
const schemas = await pMap(
schemaFilePaths,
async (schemaFilePath) => generateSchema(schemaFilePath, outputDirectory),
{
Expand Down
3 changes: 1 addition & 2 deletions codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
},
"dependencies": {
"@openapitools/openapi-generator-cli": "^2.15.3",
"bluebird": "^3.7.2",
"camelcase": "^8.0.0",
"chalk": "^5.4.1",
"fast-json-patch": "^3.1.1",
"globby": "^14.0.2",
"jsonfile": "^6.1.0",
"lodash-es": "^4.17.21",
"mustache": "^4.2.0",
"p-map": "^7.0.3",
"remark": "^15.0.1",
"strip-markdown": "^6.0.0",
"winston": "^3.17.0"
},
"devDependencies": {
"@types/bluebird": "^3.5.42",
"@types/jsonfile": "^6.1.4",
"@types/lodash-es": "^4.17.12",
"@types/mustache": "^4.2.5",
Expand Down
19 changes: 3 additions & 16 deletions pnpm-lock.yaml

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

0 comments on commit 2e25af5

Please sign in to comment.