Skip to content

Add initial structure of @sentry/lynx/plugin #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"scripts": {
"build": "lerna run build",
"build:tarball": "lerna run build:tarball",
"clean": "lerna run clean"
"clean": "lerna run clean",
"postinstall": "patch-package"
},
"devDependencies": {
"@sentry-internal/eslint-config-sdk": "9.10.1",
"@sentry-internal/eslint-plugin-sdk": "9.10.1",
"@sentry-internal/typescript": "9.10.1",
"lerna": "^8.2.1"
"lerna": "^8.2.1",
"patch-package": "^8.0.0"
},
"workspaces": [
"packages/*"
Expand Down
3 changes: 3 additions & 0 deletions packages/lynx-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.tgz
README.md
dist
7 changes: 7 additions & 0 deletions packages/lynx-plugin/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*

# Included to the final package
!LICENSE.md
!CHANGELOG.md
!README.md
!/dist/**/*
46 changes: 46 additions & 0 deletions packages/lynx-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@sentry-internal/lynx-plugin",
"homepage": "https://github.com/getsentry/sentry-lynx",
"repository": "https://github.com/getsentry/sentry-lynx",
"version": "0.0.0",
"description": "Official Sentry Plugin for lynx",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "run-s clean build:ts",
"build:ts": "tsc",
"build:tarball": "run-s build build:tarball:archive",
"build:tarball:archive": "bash scripts/build-tarball.sh",
"clean": "rimraf dist",
"circularDepCheck": "madge --circular dist/index.js",
"test": "vitest run",
"test:watch": "vitest watch"
},
"keywords": [
"lynx-js",
"sentry",
"crashreporting"
],
"publishConfig": {
"access": "public"
},
"author": "Sentry",
"license": "MIT",
"dependencies": {
"@sentry/webpack-plugin": "3.2.4"
},
"devDependencies": {
"@types/node": "^20.9.3",
"madge": "^6.1.0",
"npm-run-all2": "^7.0.2",
"rimraf": "^5.0.10",
"typescript": "~5.0.0",
"vitest": "^3.1.1"
}
}
7 changes: 7 additions & 0 deletions packages/lynx-plugin/scripts/build-tarball.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

rm -f $(dirname "$0")/../*.tgz

cp $(dirname "$0")/../../../README.md $(dirname "$0")/../README.md

npm pack
1 change: 1 addition & 0 deletions packages/lynx-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@sentry/webpack-plugin';
8 changes: 8 additions & 0 deletions packages/lynx-plugin/test/lib/public-api.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, test, expect } from 'vitest'
import { sentryWebpackPlugin } from '../../src/index.js'

describe('public api', () => {
test('sentryWebpackPlugin should be a function', () => {
expect(sentryWebpackPlugin).toBeInstanceOf(Function)
})
})
3 changes: 3 additions & 0 deletions packages/lynx-plugin/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../tsconfig.test.json"
}
10 changes: 10 additions & 0 deletions packages/lynx-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@sentry-internal/typescript/tsconfig.json",
"include": [
"src/**/*.ts",
],
"compilerOptions": {
"skipLibCheck": true,
"outDir": "dist",
}
}
11 changes: 11 additions & 0 deletions packages/lynx-plugin/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@sentry-internal/typescript/tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"paths": {
"@lib/*": ["src/*"],
"@lib": ["src"]
}
}
10 changes: 10 additions & 0 deletions packages/lynx-plugin/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineProject } from 'vitest/config'
import type { UserWorkspaceConfig } from 'vitest/config'

const config: UserWorkspaceConfig = defineProject({
test: {
name: '@sentry/lynx',
},
})

export default config
5 changes: 5 additions & 0 deletions packages/lynx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./plugin": {
"import": "./plugin/index.js",
"types": "./plugin/index.d.ts"
}
},
"scripts": {
Expand All @@ -33,6 +37,7 @@
"author": "Sentry",
"license": "MIT",
"dependencies": {
"@sentry-internal/lynx-plugin": "0.0.0",
"@sentry/browser": "9.10.1",
"@sentry/core": "9.10.1"
},
Expand Down
1 change: 1 addition & 0 deletions packages/lynx/plugin/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@sentry-internal/lynx-plugin';
1 change: 1 addition & 0 deletions packages/lynx/plugin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@sentry-internal/lynx-plugin'
14 changes: 14 additions & 0 deletions patches/@sentry+webpack-plugin+3.2.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs b/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
index 6cbb125..704e782 100644
--- a/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
+++ b/node_modules/@sentry/webpack-plugin/dist/esm/index.mjs
@@ -2,7 +2,8 @@ import { sentryUnpluginFactory, createComponentNameAnnotateHooks, stringToUUID,
export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
import * as path from 'path';
import { v4 } from 'uuid';
-import * as webpack4or5 from 'webpack';
+// import * as webpack4or5 from 'webpack';
+const webpack4or5 = undefined;

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
Loading