Skip to content

Commit 602bc8c

Browse files
committed
chore: make it easier to get started
1 parent 7c1fa3d commit 602bc8c

8 files changed

Lines changed: 69 additions & 76 deletions

File tree

README.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ The aim of [npmx.dev](https://npmx.dev) is to provide a better browser for the n
2020

2121
## Features
2222

23-
- **Dark mode by default** - Easy on the eyes, no toggle needed
24-
- **Package browsing** - Fast search, package details, READMEs, versions, dependencies
25-
- **Dependencies view** - Shows regular dependencies and peer dependencies (with optional badges)
26-
- **User profiles** - View any npm user's public packages at `/~username`
27-
- **Organization pages** - Browse org packages at `/org/orgname`
28-
- **Provenance indicators** - Verified build indicators for packages with npm provenance
29-
- **Admin features** - Org/team management, package access controls via local connector
23+
- **Dark mode by default** - easier on the eyes
24+
- **Package browsing** - fast search, package details, READMEs, versions, dependencies
25+
- **User profiles** - view any npm user's public packages at `/~username`
26+
- **Organization pages** - browse org packages at `/org/orgname`
27+
- **Provenance indicators** - verified build indicators for packages with npm provenance
28+
- **Admin features** - org/team management, package access controls via local connector (coming soon)
3029

3130
### URL Compatibility
3231

@@ -41,15 +40,13 @@ npmx.dev supports npm permalink patterns:
4140
| `/~<username>` | [`/~sindresorhus`](https://npmx.dev/~sindresorhus) |
4241
| `/org/<name>` | [`/org/nuxt`](https://npmx.dev/org/nuxt) |
4342

44-
**Coming soon** (with local connector): `/package/<name>/access`, `/package/<name>/collaborators`, `/settings/*`
45-
4643
## Tech Stack
4744

48-
- [Nuxt 4](https://nuxt.com/) - Vue framework
49-
- [Nitro](https://nuxt.com/docs/guide/concepts/server-engine) - Server engine with API routes
50-
- [UnoCSS](https://unocss.dev/) - Atomic CSS engine
51-
- [nuxt-og-image](https://github.com/nuxt-modules/og-image) - Dynamic OG images
52-
- [npm Registry API](https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md) - Package data
45+
- [Nuxt 4](https://nuxt.com/)
46+
- [Nitro](https://nuxt.com/docs/guide/concepts/server-engine)
47+
- [UnoCSS](https://unocss.dev/)
48+
- [nuxt-og-image](https://github.com/nuxt-modules/og-image)
49+
- [npm Registry API](https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md)
5350

5451
## Try it out locally
5552

@@ -86,6 +83,21 @@ pnpm test:browser
8683
pnpm test:types
8784
```
8885

86+
### Local Connector (CLI)
87+
88+
The `cli/` workspace contains a local connector that enables authenticated npm operations from the web UI. It runs on your machine and uses your existing npm credentials.
89+
90+
```bash
91+
# run the connector in dev mode
92+
pnpm --filter @npmx/connector dev
93+
94+
# or build and run the production version
95+
pnpm --filter @npmx/connector build
96+
node cli/dist/cli.mjs
97+
```
98+
99+
The connector will check your npm authentication, generate a connection token, and listen for requests from npmx.dev.
100+
89101
## License
90102

91103
Made with ❤️

cli/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
],
1919
"scripts": {
2020
"build": "unbuild",
21-
"dev": "tsx src/cli.ts",
22-
"typecheck": "tsc --noEmit"
21+
"dev": "node --experimental-strip-types src/cli.ts",
22+
"test:types": "tsc --noEmit"
2323
},
2424
"dependencies": {
2525
"@clack/prompts": "1.0.0-alpha.9",
@@ -32,8 +32,7 @@
3232
"picocolors": "^1.1.1"
3333
},
3434
"devDependencies": {
35-
"@types/node": "^25.0.10",
36-
"tsx": "^4.21.0",
35+
"@types/node": "^24.10.9",
3736
"typescript": "^5.9.3",
3837
"unbuild": "^3.6.1"
3938
}

cli/src/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { defineCommand, runMain } from 'citty'
33
import { listen } from 'listhen'
44
import { toNodeListener } from 'h3'
5-
import { createConnectorApp, generateToken, CONNECTOR_VERSION } from './server'
6-
import { getNpmUser } from './npm-client'
7-
import { initLogger, showToken, logInfo, showAuthRequired } from './logger'
5+
import { createConnectorApp, generateToken, CONNECTOR_VERSION } from './server.ts'
6+
import { getNpmUser } from './npm-client.ts'
7+
import { initLogger, showToken, logInfo, showAuthRequired } from './logger.ts'
88

99
const DEFAULT_PORT = 31415
1010

cli/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './types'
2-
export { createConnectorApp, generateToken } from './server'
1+
export * from './types.ts'
2+
export { createConnectorApp, generateToken } from './server.ts'

cli/src/npm-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { exec } from 'node:child_process'
22
import { promisify } from 'node:util'
3-
import { logCommand, logSuccess, logError } from './logger'
3+
import { logCommand, logSuccess, logError } from './logger.ts'
44

55
const execAsync = promisify(exec)
66

cli/src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
PendingOperation,
99
OperationType,
1010
ApiResponse,
11-
} from './types'
11+
} from './types.ts'
1212
import {
1313
getNpmUser,
1414
orgAddUser,
@@ -26,7 +26,7 @@ import {
2626
ownerAdd,
2727
ownerRemove,
2828
type NpmExecResult,
29-
} from './npm-client'
29+
} from './npm-client.ts'
3030

3131
// Read version from package.json
3232
const __dirname = dirname(fileURLToPath(import.meta.url))

cli/tsconfig.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
22
"compilerOptions": {
33
"target": "ES2022",
4-
"module": "ESNext",
5-
"moduleResolution": "bundler",
4+
"module": "nodenext",
65
"strict": true,
76
"esModuleInterop": true,
87
"skipLibCheck": true,
9-
"outDir": "dist",
8+
"noEmit": true,
9+
"allowImportingTsExtensions": true,
1010
"declaration": true,
1111
"declarationMap": true
1212
},
13-
"include": ["src/**/*.ts"],
14-
"exclude": ["node_modules", "dist"]
13+
"include": [
14+
"src/**/*.ts"
15+
],
16+
"exclude": [
17+
"node_modules",
18+
"dist"
19+
]
1520
}

pnpm-lock.yaml

Lines changed: 22 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)