Skip to content

Commit 5635d9f

Browse files
authored
Merge pull request #2 from lightpanda-io/fix/publish
Fix/publish
2 parents 9c568ff + 75d0e51 commit 5635d9f

File tree

15 files changed

+419
-358
lines changed

15 files changed

+419
-358
lines changed

.changeset/cuddly-memes-kiss.md

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

.changeset/many-boats-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lightpanda/browser-test": patch
3+
---
4+
5+
New test

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
//registry.npmjs.org/:_authToken=$LIGHTPANDA_NPM_TOKEN
1+
scope=@lightpanda
2+
@lightpanda:registry=https://registry.npmjs.org/

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,25 @@ See [benchmark details](https://github.com/lightpanda-io/demo)._
5353

5454
This repository contains all the [NPM](https://npmjs.com) packages created for Lightpanda
5555

56-
<!-- USAGE EXAMPLES -->
56+
### Build
57+
58+
```
59+
$ yarn build
60+
```
61+
62+
### Publish
63+
To publish packages, we use [changesets](https://github.com/changesets/changesets). Make sure to have commited & pushed all your code before publishing.
64+
65+
1. Run the following command to create a new version (patch, minor, major)
66+
67+
```
68+
$ yarn changeset add
69+
```
70+
71+
2. Publish all the packages
72+
73+
```
74+
$ yarn publish-packages
75+
```
76+
77+
3. Push the new commits & merge to main

packages/browser/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
lightpanda
2+
src/*
3+
cli/*
4+
scripts/*
5+
.turbo
6+
tsconfig.json

packages/browser/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @lightpanda/browser
2+
3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- [#1](https://github.com/lightpanda-io/node-packages/pull/1) [`c5c17b7`](https://github.com/lightpanda-io/node-packages/commit/c5c17b708e10ea1373033873cd308e6ed1e3783f) Thanks [@nrigaudiere](https://github.com/nrigaudiere)! - Initial deployment

packages/browser/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ or
6767
```bash
6868
pnpm add @lightpanda/browser
6969
```
70+
71+
## Upgrade browser
72+
73+
At some point in time, you might want to upgrade Lightpanda browser to a more recent version. To do so, you can run the following command:
74+
```bash
75+
npx @lightpanda/browser
76+
```
77+
7078
<!-- USAGE EXAMPLES -->
7179

7280
## Examples
@@ -99,6 +107,10 @@ const options: LightpandaServeOptions = {
99107
const proc = await lightpanda.serve(options)
100108

101109
// Do your magic ✨
110+
111+
proc.stdout.destroy()
112+
proc.stderr.destroy()
113+
proc.kill()
102114
```
103115

104116
ℹ️ _Lightpanda's CDP server can be used alongside projects like [Puppeteer](https://pptr.dev/) or [Playwright](https://playwright.dev/)._

packages/browser/cli/install.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node
2+
3+
import packageJson from './../package.json' with { type: 'json' }
4+
import { download } from './../src/download'
5+
6+
download(`node_modules/${packageJson.name}/dist/lightpanda`)

packages/browser/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { fetch } from './src/fetch'
2+
import { serve } from './src/serve'
3+
4+
export { LightpandaFetchOptions } from './src/fetch'
5+
export { LightpandaServeOptions } from './src/serve'
6+
7+
export const lightpanda = {
8+
fetch,
9+
serve,
10+
}

packages/browser/package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
{
22
"name": "@lightpanda/browser",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "Lightpanda for Node.js",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
7-
"types": "./dist/index.d.ts",
7+
"types": "./dist/types/index.d.ts",
8+
"type": "module",
89
"scripts": {
9-
"dev": "tsup src/index.ts --target node22 --format cjs,esm --dts --watch",
10-
"build": "tsup src/index.ts --target node22 --format cjs,esm --minify terser && yarn dlx --package=typescript tsc --emitDeclarationOnly --declaration",
11-
"postinstall": "npx tsup scripts/postinstall.ts --target node22 && node dist/postinstall.js",
10+
"dev": "tsup index.ts --target node22 --format cjs,esm --dts --watch",
11+
"build:index": "tsup index.ts --target node22 --format cjs,esm --minify terser",
12+
"build:decl": "yarn dlx --package=typescript tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
13+
"build:cli": "tsup cli/install.ts --target node22 --format cjs,esm --minify terser -d dist/cli",
14+
"build:postinstall": "tsup scripts/postinstall.ts --target node22 --format cjs,esm --minify terser -d dist/scripts",
15+
"build": "yarn build:index && yarn build:decl && yarn build:cli && yarn build:postinstall",
16+
"postinstall": "node dist/scripts/postinstall.js || true",
1217
"lint": "biome ci . --diagnostic-level=error",
1318
"typecheck": "yarn dlx --package=typescript tsc --noEmit"
1419
},
20+
"bin": {
21+
"lightpanda": "./dist/cli/install.js"
22+
},
1523
"repository": {
1624
"type": "git",
1725
"url": "https://github.com/lightpanda-io/node-packages/tree/main/packages/browser"

0 commit comments

Comments
 (0)