Skip to content

Commit

Permalink
fix(cleanup): dont nest files utils dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 24, 2024
1 parent dd39de7 commit 4ab6401
Show file tree
Hide file tree
Showing 19 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/base-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class BaseCommand {
const relativeFrom = prefixInsideCwd ? this.npm.localPrefix : process.cwd()

const filters = this.npm.config.get('workspace')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const getWorkspaces = require('./utils/get-workspaces.js')
const ws = await getWorkspaces(filters, {
path: this.npm.localPrefix,
includeWorkspaceRoot,
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const { resolve } = require('path')
const { lstat } = require('fs/promises')
const cp = require('child_process')
const completion = require('../utils/completion/installed-shallow.js')
const completion = require('../utils/installed-shallow.js')
const BaseCommand = require('../base-command.js')

const splitPackageNames = (path) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/explain.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Explain extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
static async completion (opts, npm) {
const completion = require('../utils/completion/installed-deep.js')
const completion = require('../utils/installed-deep.js')
return completion(npm, opts)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const pkgJson = require('@npmcli/package-json')
const runScript = require('@npmcli/run-script')
const { join, relative } = require('path')
const { log, output } = require('proc-log')
const completion = require('../utils/completion/installed-shallow.js')
const completion = require('../utils/installed-shallow.js')
const BaseCommand = require('../base-command.js')

class Explore extends BaseCommand {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Fund extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
static async completion (opts, npm) {
const completion = require('../utils/completion/installed-deep.js')
const completion = require('../utils/installed-deep.js')
return completion(npm, opts)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const libexec = require('libnpmexec')
const mapWorkspaces = require('@npmcli/map-workspaces')
const PackageJson = require('@npmcli/package-json')
const { log, output } = require('proc-log')
const updateWorkspaces = require('../workspaces/update-workspaces.js')
const updateWorkspaces = require('../utils/update-workspaces.js')
const BaseCommand = require('../base-command.js')

const posixPath = p => p.split('\\').join('/')
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LS extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
static async completion (opts, npm) {
const completion = require('../utils/completion/installed-deep.js')
const completion = require('../utils/installed-deep.js')
return completion(npm, opts)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/rebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Rebuild extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
static async completion (opts, npm) {
const completion = require('../utils/completion/installed-deep.js')
const completion = require('../utils/installed-deep.js')
return completion(npm, opts)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { resolve } = require('path')
const pkgJson = require('@npmcli/package-json')

const reifyFinish = require('../utils/reify-finish.js')
const completion = require('../utils/completion/installed-shallow.js')
const completion = require('../utils/installed-shallow.js')

const ArboristWorkspaceCmd = require('../arborist-cmd.js')
class Uninstall extends ArboristWorkspaceCmd {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Update extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
static async completion (opts, npm) {
const completion = require('../utils/completion/installed-deep.js')
const completion = require('../utils/installed-deep.js')
return completion(npm, opts)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Version extends BaseCommand {
}

async changeWorkspaces (args) {
const updateWorkspaces = require('../workspaces/update-workspaces.js')
const updateWorkspaces = require('../utils/update-workspaces.js')
const libnpmversion = require('libnpmversion')
const prefix = this.npm.config.get('tag-version-prefix')
const {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/lib/arborist-cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ t.test('arborist-cmd', async t => {
t.test('handle getWorkspaces raising an error', async t => {
const { cmd } = await mockArboristCmd(t, null, 'a', {
mocks: {
'{LIB}/workspaces/get-workspaces.js': async () => {
'{LIB}/utils/get-workspaces.js': async () => {
throw new Error('oopsie')
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { resolve } = require('path')
const t = require('tap')
const getWorkspaces = require('../../../lib/workspaces/get-workspaces.js')
const getWorkspaces = require('../../../lib/utils/get-workspaces.js')

const normalizePath = p => p
.replace(/\\+/g, '/')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const t = require('tap')
const installedDeep = require('../../../../lib/utils/completion/installed-deep.js')
const installedDeep = require('../../../lib/utils/installed-deep.js')
const mockNpm = require('../../../fixtures/mock-npm')

const fixture = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const t = require('tap')
const installed = require('../../../../lib/utils/completion/installed-shallow.js')
const installed = require('../../../lib/utils/installed-shallow.js')
const mockNpm = require('../../../fixtures/mock-npm')

const mockShallow = async (t, config) => {
Expand Down

0 comments on commit 4ab6401

Please sign in to comment.