Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 2, 2024
1 parent d8f9d50 commit 4c91fd8
Show file tree
Hide file tree
Showing 13 changed files with 814 additions and 472 deletions.
16 changes: 8 additions & 8 deletions clean-publish.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env node

import { parseListArg } from './utils.js'
import {
createTempDirectory,
createFilesFilter,
copyFiles,
readPackageJSON,
cleanComments,
cleanDocs,
clearPackageJSON,
writePackageJSON,
copyFiles,
createFilesFilter,
createTempDirectory,
publish,
cleanComments,
readPackageJSON,
removeTempDirectory,
runScript,
cleanDocs
writePackageJSON
} from './core.js'
import { getConfig } from './get-config.js'
import { parseListArg } from './utils.js'

const HELP =
'npx clean-publish\n' +
Expand Down
8 changes: 4 additions & 4 deletions clear-package-json.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

import { clearPackageJSON } from './core.js'
import { getConfig } from './get-config.js'
import {
parseListArg,
readJSON,
readJSONFromStdin,
writeJSON,
parseListArg
writeJSON
} from './utils.js'
import { clearPackageJSON } from './core.js'
import { getConfig } from './get-config.js'

const HELP =
'npx clear-package-json <input> [options]\n' +
Expand Down
24 changes: 12 additions & 12 deletions core.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { promises as fs } from 'fs'
import { join, basename } from 'path'
import spawn from 'cross-spawn'
import glob from 'fast-glob'
import micromatch from 'micromatch'
import { promises as fs } from 'node:fs'
import { basename, join } from 'node:path'

import IGNORE_FIELDS from './exception/ignore-fields.js'
import IGNORE_FILES from './exception/ignore-files.js'
import NPM_SCRIPTS from './exception/npm-scripts.js'
import {
writeJSON,
readJSON,
copy,
remove,
filterObjectByKey,
isObject,
filterObjectByKey
readJSON,
remove,
writeJSON
} from './utils.js'
import IGNORE_FILES from './exception/ignore-files.js'
import IGNORE_FIELDS from './exception/ignore-fields.js'
import NPM_SCRIPTS from './exception/npm-scripts.js'

const PUBLISH_CONFIG_FIELDS = [
'bin',
Expand Down Expand Up @@ -150,16 +150,16 @@ export async function copyFiles(tempDir, filter) {

export function publish(
cwd,
{ packageManager, packageManagerOptions = [], access, tag, dryRun }
{ access, dryRun, packageManager, packageManagerOptions = [], tag }
) {
return new Promise((resolve, reject) => {
const args = ['publish', ...packageManagerOptions]
if (access) args.push('--access', access)
if (tag) args.push('--tag', tag)
if (dryRun) args.push('--dry-run')
spawn(packageManager, args, {
stdio: 'inherit',
cwd
cwd,
stdio: 'inherit'
})
.on('close', (code, signal) => {
resolve({
Expand Down
32 changes: 16 additions & 16 deletions get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
*/

import { lilconfig } from 'lilconfig'
import { relative } from 'path'
import { relative } from 'node:path'

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

const PACKAGE_ERRORS = {
notObject:
'The `"clean-publish"` section of package.json ' + 'must be `an object`',
empty: 'The `"clean-publish"` section of package.json must `not be empty`',
fieldsNotStrings:
'The `fields` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`',
filesNotStringsOrRegExps:
'The `files` in the `"clean-publish"` section ' +
'of package.json must be ' +
'`an array of strings or RegExps`',
fieldsNotStrings:
'The `fields` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`',
tempDirNotString:
'The `tempDir` in the `"clean-publish"` section ' +
'of package.json must be `an string`',
notObject:
'The `"clean-publish"` section of package.json ' + 'must be `an object`',
packageManagerNotString:
'The `packageManager` in the `"clean-publish"` section ' +
'of package.json must be `an string`',
packageManagerOptionsNotStrings:
'The `packageManagerOptions` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`'
'of package.json must be `an array of strings`',
tempDirNotString:
'The `tempDir` in the `"clean-publish"` section ' +
'of package.json must be `an string`'
}
const FILE_ERRORS = {
notObject: 'Clean Publish config must contain `an object`',
empty: 'Clean Publish config must `not be empty`',
fieldsNotStrings:
'The `fields` in Clean Publish config ' + 'must be `an array of strings`',
filesNotStringsOrRegExps:
'The `files` in the Clean Publish config ' +
'must be `an array of strings or RegExps`',
fieldsNotStrings:
'The `fields` in Clean Publish config ' + 'must be `an array of strings`',
tempDirNotString:
'The `tempDir` in Clean Publish config ' + 'must be `an string`',
notObject: 'Clean Publish config must contain `an object`',
packageManagerNotString:
'The `packageManager` in Clean Publish config ' +
'must be `an string`',
packageManagerOptionsNotStrings:
'The `packageManagerOptions` in Clean Publish config ' +
'must be `an array of strings`'
'must be `an array of strings`',
tempDirNotString:
'The `tempDir` in Clean Publish config ' + 'must be `an string`'
}

const PACKAGE_EXAMPLE =
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
},
"dependencies": {
"cross-spawn": "^7.0.3",
"fast-glob": "^3.2.12",
"lilconfig": "^2.1.0",
"fast-glob": "^3.3.2",
"lilconfig": "^3.1.1",
"micromatch": "^4.0.5"
},
"devDependencies": {
"@logux/eslint-config": "^49.0.0",
"eslint": "^8.38.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"@logux/eslint-config": "^52.0.2",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.1.1",
"ts-json-schema-generator": "^1.2.0",
"ts-json-schema-generator": "^1.5.0",
"tsm": "^2.3.0",
"uvu": "^0.5.6"
}
Expand Down
Loading

0 comments on commit 4c91fd8

Please sign in to comment.