8000 fix: prefer mjs for cli · antfu-collective/ni@3355a81 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 3355a81

Browse files
committed
fix: prefer mjs for cli
1 parent af19dc0 commit 3355a81

26 files changed

+55
-40
lines changed

bin/na.js renamed to bin/na.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
'use strict'
3-
require('../dist/na')
3+
import '../dist/na.mjs'

bin/nci.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
import '../dist/nci.mjs'

bin/nci.js renamed to bin/ni.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
'use strict'
3-
require('../dist/nci')
3+
import '../dist/ni.mjs'

bin/ni.js renamed to bin/nr.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
'use strict'
3-
require('../dist/ni')
3+
import '../dist/nr.mjs'

bin/nu.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/nr.js renamed to bin/nu.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
'use strict'
3-
require('../dist/nr')
3+
import '../dist/nu.mjs'

bin/nun.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/nun.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
import '../dist/nun.mjs'

bin/nx.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/nx.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
import '../dist/nx.mjs'

src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '../index'

src/commands/na.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { parseNa } from '../parse'
2+
import { runCli } from '../runner'
3+
4+
runCli(parseNa)

src/nci.ts renamed to src/commands/nci.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { parseNi } from './commands'
2-
import { runCli } from './runner'
1+
import { parseNi } from '../parse'
2+
import { runCli } from '../runner'
33

44
runCli(
55
(agent, _, hasLock) => parseNi(agent, ['--frozen-if-present'], hasLock),

src/commands/ni.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { parseNi } from '../parse'
2+
import { runCli } from '../runner'
3+
4+
runCli(parseNi)

src/nr.ts renamed to src/commands/nr.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Choice } from 'prompts'
22
import prompts from 'prompts'
3-
import { dump, load } from './storage'
4-
import { parseNr } from './commands'
5-
import { getPackageJSON } from './fs'
6-
import { runCli } from './runner'
3+
import { dump, load } from '../storage'
4+
import { parseNr } from '../parse'
5+
import { getPackageJSON } from '../fs'
6+
import { runCli } from '../runner'
77

88
runCli(async(agent, args, ctx) => {
99
const storage = await load()

src/commands/nu.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { parseNu } from '../parse'
2+
import { runCli } from '../runner'
3+
4+
runCli(parseNu)

src/commands/nun.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { parseNun } from '../parse'
2+
import { runCli } from '../runner'
3+
4+
runCli(parseNun)

src/commands/nx.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { parseNx } from '../parse'
2+
import { runCli } from '../runner'
3+
4+
runCli(parseNx)

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from './commands'
1+
export * from './parse'
22
export * from './config'
33
export * from './detect'
44
export * from './runner'

src/na.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/ni.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/nu.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/nun.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/nx.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

tsup.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from 'tsup'
2+
3+
export default defineConfig({
4+
entry: [
5+
'src/commands/*.ts',
6+
],
7+
format: [
8+
'esm',
9+
'cjs',
10+
],
11+
dts: true,
12+
clean: true,
13+
splitting: true,
14+
})

0 commit comments

Comments
 (0)
0