Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp committed Nov 13, 2024
1 parent 613852f commit 35b881b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SPDX-License-Identifier = "Apache-2.0"

# project configuration files
[[annotations]]
path = ["packages/livekit-rtc/.npmignore", ".prettierrc", ".prettierignore", ".eslintrc", "**.json", ".npmrc"]
path = ["packages/livekit-rtc/.npmignore", ".prettierrc", ".prettierignore", ".eslintrc", "**.json", ".npmrc", "**/tsup.config.ts"]
SPDX-FileCopyrightText = "2024 LiveKit, Inc."
SPDX-License-Identifier = "Apache-2.0"

Expand Down
12 changes: 6 additions & 6 deletions packages/livekit-rtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "dist/index.d.ts",
"import": "dist/index.js",
"require": "dist/index.cjs"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"type": "module",
Expand Down Expand Up @@ -65,9 +65,9 @@
},
"scripts": {
"prebuild": "node -p \"'export const SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"build:tsc": "pnpm prebuild && tsup --onSuccess \"tsc --declaration --emitDeclarationOnly\" && cp -r src/napi dist/",
"build": "pnpm build:tsc && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
"artifacts": "pnpm build:tsc && napi artifacts",
"build:ts": "pnpm prebuild && tsup --onSuccess \"tsc --declaration --emitDeclarationOnly\" && cp -r src/napi dist/ && cp -r src/napi/* dist/",
"build": "pnpm build:ts && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
"artifacts": "pnpm build:ts && napi artifacts",
"build:debug": "napi build --platform",
"lint": "eslint -f unix \"src/**/*.ts\" --ignore-pattern \"src/proto/*\"",
"universal": "napi universal",
Expand Down
6 changes: 5 additions & 1 deletion packages/livekit-rtc/src/video_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export class VideoSource {
this.ffiHandle = new FfiHandle(res.source!.handle!.id);
}

captureFrame(frame: VideoFrame, timestampUs = BigInt(0), rotation = VideoRotation.VIDEO_ROTATION_0) {
captureFrame(
frame: VideoFrame,
timestampUs = BigInt(0),
rotation = VideoRotation.VIDEO_ROTATION_0,
) {
const req = create(CaptureVideoFrameRequestSchema, {
sourceHandle: this.ffiHandle.handle,
buffer: frame.protoInfo(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import defaults from '../../tsup.config';

export default defineConfig({
...defaults,
external: [/\.\/.*\.cjs/, /\.\/.*.node/],
});
6 changes: 3 additions & 3 deletions packages/livekit-server-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"require": "dist/index.cjs",
"exports": {
".": {
"types": "dist/index.d.ts",
"import": "dist/index.js",
"require": "dist/index.cjs"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"files": [
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down
3 changes: 1 addition & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const defaultOptions: Options = {
// for the type maps to work, we use tsc's declaration-only command
dts: false,
clean: true,
target: 'es6',
external: [/\.\/.*.node/],
target: 'node16',
esbuildOptions: (options, context) => {
if (context.format === 'esm') {
options.packages = 'external';
Expand Down

0 comments on commit 35b881b

Please sign in to comment.