Skip to content

Commit 7bd7170

Browse files
authored
feat: Add Remix SDK package boilerplate (#5256)
1 parent 0d07854 commit 7bd7170

14 files changed

+330
-10
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"packages/node",
4646
"packages/node-integration-tests",
4747
"packages/react",
48+
"packages/remix",
4849
"packages/serverless",
4950
"packages/tracing",
5051
"packages/types",

packages/remix/.eslintrc.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
node: true,
5+
},
6+
parserOptions: {
7+
jsx: true,
8+
},
9+
extends: ['../../.eslintrc.js'],
10+
rules: {
11+
'@sentry-internal/sdk/no-async-await': 'off',
12+
},
13+
};

packages/remix/LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
MIT License
2+
3+
Copyright (c) 2022, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/remix/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Official Sentry SDK for Remix
8+
9+
This SDK is work in progress, and should not be used before officially released.

packages/remix/jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../jest/jest.config.js');

packages/remix/package.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "@sentry/remix",
3+
"version": "7.1.1",
4+
"description": "Official Sentry SDK for Remix",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/remix",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"engines": {
10+
"node": ">=14"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@sentry/core": "7.1.1",
15+
"@sentry/hub": "7.1.1",
16+
"@sentry/integrations": "7.1.1",
17+
"@sentry/node": "7.1.1",
18+
"@sentry/react": "7.1.1",
19+
"@sentry/tracing": "7.1.1",
20+
"@sentry/utils": "7.1.1",
21+
"@sentry/webpack-plugin": "1.18.9",
22+
"tslib": "^1.9.3"
23+
},
24+
"devDependencies": {
25+
"@sentry/types": "7.1.1",
26+
"@types/webpack": "^4.41.31",
27+
"@remix-run/node": "^1.4.3",
28+
"@remix-run/react": "^1.4.3"
29+
},
30+
"peerDependencies": {
31+
"@remix-run/node": "^1.4.3",
32+
"@remix-run/react": "^1.4.3",
33+
"react": "16.x || 17.x || 18.x",
34+
"webpack": ">=4.0.0"
35+
},
36+
"peerDependenciesMeta": {
37+
"webpack": {
38+
"optional": true
39+
}
40+
},
41+
"scripts": {
42+
"build": "run-p build:rollup",
43+
"build:cjs": "tsc -p tsconfig.cjs.json",
44+
"build:dev": "run-s build",
45+
"build:esm": "tsc -p tsconfig.esm.json",
46+
"build:rollup": "rollup -c rollup.npm.config.js",
47+
"build:types": "tsc -p tsconfig.types.json",
48+
"build:watch": "run-p build:cjs:watch build:esm:watch",
49+
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
50+
"build:dev:watch": "run-s build:watch",
51+
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
52+
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
53+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
54+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
55+
"clean": "rimraf build coverage",
56+
"fix": "run-s fix:eslint fix:prettier",
57+
"fix:eslint": "eslint . --format stylish --fix",
58+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
59+
"link:yarn": "yarn link",
60+
"lint": "run-s lint:prettier lint:eslint",
61+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
62+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
63+
"test": "run-s test:unit",
64+
"test:unit": "jest --passWithNoTests",
65+
"test:watch": "jest --watch"
66+
},
67+
"volta": {
68+
"extends": "../../package.json"
69+
}
70+
}

packages/remix/rollup.npm.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js';
2+
3+
export default makeNPMConfigVariants(
4+
makeBaseNPMConfig({
5+
// Todo: Replace with -> ['src/index.server.ts', 'src/index.client.tsx'],
6+
entrypoints: 'src/index.ts',
7+
}),
8+
);

packages/remix/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default null;

packages/remix/tsconfig.esm.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "es6",
6+
"outDir": "build/esm"
7+
}
8+
}

packages/remix/tsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
4+
"include": ["src/**/*"],
5+
6+
"compilerOptions": {
7+
"jsx": "react"
8+
}
9+
}

packages/remix/tsconfig.test.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*"],
5+
6+
"compilerOptions": {
7+
"types": ["node", "jest"]
8+
}
9+
}

packages/remix/tsconfig.types.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"declaration": true,
6+
"declarationMap": true,
7+
"emitDeclarationOnly": true,
8+
"outDir": "build/types"
9+
}
10+
}

scripts/test.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const NODE_8_SKIP_TESTS_PACKAGES = [
1616
'@sentry/serverless',
1717
'@sentry/nextjs',
1818
'@sentry/angular',
19+
'@sentry/remix',
1920
];
2021

2122
// We have to downgrade some of our dependencies in order to run tests in Node 8 and 10.
@@ -26,8 +27,12 @@ const NODE_8_LEGACY_DEPENDENCIES = [
2627
2728
2829
];
30+
31+
const NODE_10_SKIP_TESTS_PACKAGES = [...DEFAULT_SKIP_TESTS_PACKAGES, '@sentry/remix'];
2932
const NODE_10_LEGACY_DEPENDENCIES = ['[email protected]'];
3033

34+
const NODE_12_SKIP_TESTS_PACKAGES = [...DEFAULT_SKIP_TESTS_PACKAGES, '@sentry/remix'];
35+
3136
type JSONValue = string | number | boolean | null | JSONArray | JSONObject;
3237

3338
type JSONObject = {
@@ -157,12 +162,12 @@ function runTests(): void {
157162
else if (CURRENT_NODE_VERSION === '10') {
158163
installLegacyDeps(NODE_10_LEGACY_DEPENDENCIES);
159164
es6ifyTestTSConfig('utils');
160-
runWithIgnores(DEFAULT_SKIP_TESTS_PACKAGES);
165+
runWithIgnores(NODE_10_SKIP_TESTS_PACKAGES);
161166
}
162167
//
163168
else if (CURRENT_NODE_VERSION === '12') {
164169
es6ifyTestTSConfig('utils');
165-
runWithIgnores(DEFAULT_SKIP_TESTS_PACKAGES);
170+
runWithIgnores(NODE_12_SKIP_TESTS_PACKAGES);
166171
}
167172
//
168173
else {

0 commit comments

Comments
 (0)