Skip to content

Commit

Permalink
changed: retruct
Browse files Browse the repository at this point in the history
  • Loading branch information
binjospookie committed Dec 29, 2023
1 parent 59480de commit 5a53b9e
Show file tree
Hide file tree
Showing 42 changed files with 37 additions and 72 deletions.
35 changes: 0 additions & 35 deletions bin/__tests__/monorepo/__snapshots__/collectUsages.test.js.snap

This file was deleted.

6 changes: 0 additions & 6 deletions bin/__tests__/monorepo/packages/package-a/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions bin/__tests__/monorepo/packages/package-b/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions bin/__tests__/monorepo/packages/package-c/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions bin/__tests__/package-d/package.json

This file was deleted.

6 changes: 3 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import { collectUsages } from './collectUsages.js'
import { getConfig } from './getConfig.js'
import { main } from './main.js'
import { collectUsages } from '../src/collectUsages.js'
import { getConfig } from '../src/getConfig.js'
import { main } from '../src/main.js'

const config = await getConfig()

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.0.33",
"description": "Utility for monorepos. It helps to find unused exports from packages or get a list of all unique uses of any package",
"main": "./bin/index.js",
"main": "./src/index.js",
"bin": "./bin/index.js",
"author": "Viktor Pasynok",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`package-d 1`] = `
"
> check-exports
> node ../../index.js -s ../monorepo/app
> node ../../../bin/index.js -s ../monorepo/app
Failed Unused exports in package-d package found
Expand All @@ -18,7 +18,7 @@ exports[`package-d 1`] = `
exports[`package-d happy 1`] = `
"
> check-exports-happy
> node ../../index.js -s ../monorepo
> node ../../../bin/index.js -s ../monorepo
"
`;
Expand All @@ -31,7 +31,7 @@ exports[`package-d happy 2`] = `
exports[`package-d unhappy 1`] = `
"
> check-exports-unhappy
> node ../../index.js -s ../biba
> node ../../../bin/index.js -s ../biba
Failed Nothing is imported from package-d. Remove it.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getConfig } from '../../getConfig.js'
import { CONFIG } from './constants.js'

test('default value', async () => {
vi.mock('../../../bin/utils/getRepoRoot.js', () => ({
vi.mock('../../utils/getRepoRoot.js', () => ({
getRepoRoot: () => 'repo-root'
}))

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`run check-exports in package-a 1`] = `
"
> check-exports
> node ../../../../index.js
> node ../../../../../bin/index.js
Failed Unused exports in package-a package found
Expand All @@ -19,7 +19,7 @@ exports[`run check-exports in package-a 1`] = `
exports[`run check-exports in package-b 1`] = `
"
> check-exports
> node ../../../../index.js -e index.tsx
> node ../../../../../bin/index.js -e index.tsx
"
`;
Expand All @@ -32,7 +32,7 @@ exports[`run check-exports in package-b 2`] = `
exports[`run check-exports in package-c 1`] = `
"
> check-exports
> node ../../../../index.js
> node ../../../../../bin/index.js
Failed Nothing is imported from package-c. Remove it.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/__tests__/monorepo/packages/package-a/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "package-a",
"scripts": {
"check-exports": "node ../../../../../bin/index.js"
}
}
6 changes: 6 additions & 0 deletions src/__tests__/monorepo/packages/package-b/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "package-b",
"scripts": {
"check-exports": "node ../../../../../bin/index.js -e index.tsx"
}
}
6 changes: 6 additions & 0 deletions src/__tests__/monorepo/packages/package-c/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "package-c",
"scripts": {
"check-exports": "node ../../../../../bin/index.js"
}
}
File renamed without changes.
8 changes: 8 additions & 0 deletions src/__tests__/package-d/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "package-d",
"scripts": {
"check-exports": "node ../../../bin/index.js -s ../monorepo/app",
"check-exports-unhappy": "node ../../../bin/index.js -s ../biba",
"check-exports-happy": "node ../../../bin/index.js -s ../monorepo"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added src/index.js
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5a53b9e

Please sign in to comment.