Skip to content

Commit 706d9c6

Browse files
Add initial structure of @sentry/lynx/plugin (#7)
1 parent 7578c9a commit 706d9c6

File tree

16 files changed

+858
-21
lines changed

16 files changed

+858
-21
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
"scripts": {
66
"build": "lerna run build",
77
"build:tarball": "lerna run build:tarball",
8-
"clean": "lerna run clean"
8+
"clean": "lerna run clean",
9+
"postinstall": "patch-package"
910
},
1011
"devDependencies": {
1112
"@sentry-internal/eslint-config-sdk": "9.10.1",
1213
"@sentry-internal/eslint-plugin-sdk": "9.10.1",
1314
"@sentry-internal/typescript": "9.10.1",
14-
"lerna": "^8.2.1"
15+
"lerna": "^8.2.1",
16+
"patch-package": "^8.0.0"
1517
},
1618
"workspaces": [
1719
"packages/*"

packages/lynx-plugin/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.tgz
2+
README.md
3+
dist

packages/lynx-plugin/.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
3+
# Included to the final package
4+
!LICENSE.md
5+
!CHANGELOG.md
6+
!README.md
7+
!/dist/**/*

packages/lynx-plugin/package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "@sentry-internal/lynx-plugin",
3+
"homepage": "https://github.com/getsentry/sentry-lynx",
4+
"repository": "https://github.com/getsentry/sentry-lynx",
5+
"version": "0.0.0",
6+
"description": "Official Sentry Plugin for lynx",
7+
"module": "dist/index.js",
8+
"types": "dist/index.d.ts",
9+
"exports": {
10+
".": {
11+
"import": "./dist/index.js",
12+
"types": "./dist/index.d.ts"
13+
}
14+
},
15+
"scripts": {
16+
"build": "run-s clean build:ts",
17+
"build:ts": "tsc",
18+
"build:tarball": "run-s build build:tarball:archive",
19+
"build:tarball:archive": "bash scripts/build-tarball.sh",
20+
"clean": "rimraf dist",
21+
"circularDepCheck": "madge --circular dist/index.js",
22+
"test": "vitest run",
23+
"test:watch": "vitest watch"
24+
},
25+
"keywords": [
26+
"lynx-js",
27+
"sentry",
28+
"crashreporting"
29+
],
30+
"publishConfig": {
31+
"access": "public"
32+
},
33+
"author": "Sentry",
34+
"license": "MIT",
35+
"dependencies": {
36+
"@sentry/webpack-plugin": "3.2.4"
37+
},
38+
"devDependencies": {
39+
"@types/node": "^20.9.3",
40+
"madge": "^6.1.0",
41+
"npm-run-all2": "^7.0.2",
42+
"rimraf": "^5.0.10",
43+
"typescript": "~5.0.0",
44+
"vitest": "^3.1.1"
45+
}
46+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
rm -f $(dirname "$0")/../*.tgz
4+
5+
cp $(dirname "$0")/../../../README.md $(dirname "$0")/../README.md
6+
7+
npm pack

packages/lynx-plugin/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@sentry/webpack-plugin';
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { describe, test, expect } from 'vitest'
2+
import { sentryWebpackPlugin } from '../../src/index.js'
3+
4+
describe('public api', () => {
5+
test('sentryWebpackPlugin should be a function', () => {
6+
expect(sentryWebpackPlugin).toBeInstanceOf(Function)
7+
})
8+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../tsconfig.test.json"
3+
}

packages/lynx-plugin/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "@sentry-internal/typescript/tsconfig.json",
3+
"include": [
4+
"src/**/*.ts",
5+
],
6+
"compilerOptions": {
7+
"skipLibCheck": true,
8+
"outDir": "dist",
9+
}
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "@sentry-internal/typescript/tsconfig.json",
3+
"include": [
4+
"src/**/*.ts",
5+
"test/**/*.ts"
6+
],
7+
"paths": {
8+
"@lib/*": ["src/*"],
9+
"@lib": ["src"]
10+
}
11+
}

packages/lynx-plugin/vitest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineProject } from 'vitest/config'
2+
import type { UserWorkspaceConfig } from 'vitest/config'
3+
4+
const config: UserWorkspaceConfig = defineProject({
5+
test: {
6+
name: '@sentry/lynx',
7+
},
8+
})
9+
10+
export default config

packages/lynx/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
".": {
1111
"import": "./dist/index.js",
1212
"types": "./dist/index.d.ts"
13+
},
14+
"./plugin": {
15+
"import": "./plugin/index.js",
16+
"types": "./plugin/index.d.ts"
1317
}
1418
},
1519
"scripts": {
@@ -33,6 +37,7 @@
3337
"author": "Sentry",
3438
"license": "MIT",
3539
"dependencies": {
40+
"@sentry-internal/lynx-plugin": "0.0.0",
3641
"@sentry/browser": "9.10.1",
3742
"@sentry/core": "9.10.1"
3843
},

packages/lynx/plugin/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@sentry-internal/lynx-plugin';

packages/lynx/plugin/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@sentry-internal/lynx-plugin'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs b/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
2+
index 6cbb125..704e782 100644
3+
--- a/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
4+
+++ b/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
5+
@@ -2,7 +2,8 @@ import { sentryUnpluginFactory, createComponentNameAnnotateHooks, stringToUUID,
6+
export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
7+
import * as path from 'path';
8+
import { v4 } from 'uuid';
9+
-import * as webpack4or5 from 'webpack';
10+
+// import * as webpack4or5 from 'webpack';
11+
+const webpack4or5 = undefined;
12+
13+
function ownKeys(object, enumerableOnly) {
14+
var keys = Object.keys(object);

0 commit comments

Comments
 (0)