Skip to content

feat: Add Remix SDK package boilerplate. #5256

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 3 commits into from
Jun 15, 2022
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"packages/node",
"packages/node-integration-tests",
"packages/react",
"packages/remix",
"packages/serverless",
"packages/tracing",
"packages/types",
Expand Down
13 changes: 13 additions & 0 deletions packages/remix/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
env: {
browser: true,
node: true,
},
parserOptions: {
jsx: true,
},
extends: ['../../.eslintrc.js'],
rules: {
'@sentry-internal/sdk/no-async-await': 'off',
},
};
29 changes: 29 additions & 0 deletions packages/remix/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MIT License

Copyright (c) 2022, Sentry
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions packages/remix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
</a>
</p>

# Official Sentry SDK for Remix

This SDK is work in progress, and should not be used before officially released.
1 change: 1 addition & 0 deletions packages/remix/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../jest/jest.config.js');
70 changes: 70 additions & 0 deletions packages/remix/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@sentry/remix",
"version": "7.1.1",
"description": "Official Sentry SDK for Remix",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/remix",
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=14"
},
"private": true,
"dependencies": {
"@sentry/core": "7.1.1",
"@sentry/hub": "7.1.1",
"@sentry/integrations": "7.1.1",
"@sentry/node": "7.1.1",
"@sentry/react": "7.1.1",
"@sentry/tracing": "7.1.1",
"@sentry/utils": "7.1.1",
"@sentry/webpack-plugin": "1.18.9",
"tslib": "^1.9.3"
},
"devDependencies": {
"@sentry/types": "7.1.1",
"@types/webpack": "^4.41.31",
"@remix-run/node": "^1.4.3",
"@remix-run/react": "^1.4.3"
},
"peerDependencies": {
"@remix-run/node": "^1.4.3",
"@remix-run/react": "^1.4.3",
"react": "16.x || 17.x || 18.x",
"webpack": ">=4.0.0"
},
"peerDependenciesMeta": {
"webpack": {
"optional": true
}
},
"scripts": {
"build": "run-p build:rollup",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:dev": "run-s build",
"build:esm": "tsc -p tsconfig.esm.json",
"build:rollup": "rollup -c rollup.npm.config.js",
"build:types": "tsc -p tsconfig.types.json",
"build:watch": "run-p build:cjs:watch build:esm:watch",
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
"build:dev:watch": "run-s build:watch",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"clean": "rimraf build coverage",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
"link:yarn": "yarn link",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
"test": "run-s test:unit",
"test:unit": "jest --passWithNoTests",
"test:watch": "jest --watch"
},
"volta": {
"extends": "../../package.json"
}
}
8 changes: 8 additions & 0 deletions packages/remix/rollup.npm.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js';

export default makeNPMConfigVariants(
makeBaseNPMConfig({
// Todo: Replace with -> ['src/index.server.ts', 'src/index.client.tsx'],
entrypoints: 'src/index.ts',
}),
);
1 change: 1 addition & 0 deletions packages/remix/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null;
8 changes: 8 additions & 0 deletions packages/remix/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",

"compilerOptions": {
"module": "es6",
"outDir": "build/esm"
}
}
9 changes: 9 additions & 0 deletions packages/remix/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {
"jsx": "react"
}
}
9 changes: 9 additions & 0 deletions packages/remix/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",

"include": ["test/**/*"],

"compilerOptions": {
"types": ["node", "jest"]
}
}
10 changes: 10 additions & 0 deletions packages/remix/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",

"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "build/types"
}
}
9 changes: 7 additions & 2 deletions scripts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const NODE_8_SKIP_TESTS_PACKAGES = [
'@sentry/serverless',
'@sentry/nextjs',
'@sentry/angular',
'@sentry/remix',
];

// We have to downgrade some of our dependencies in order to run tests in Node 8 and 10.
Expand All @@ -26,8 +27,12 @@ const NODE_8_LEGACY_DEPENDENCIES = [
'[email protected]',
'[email protected]',
];

const NODE_10_SKIP_TESTS_PACKAGES = [...DEFAULT_SKIP_TESTS_PACKAGES, '@sentry/remix'];
const NODE_10_LEGACY_DEPENDENCIES = ['[email protected]'];

const NODE_12_SKIP_TESTS_PACKAGES = [...DEFAULT_SKIP_TESTS_PACKAGES, '@sentry/remix'];

type JSONValue = string | number | boolean | null | JSONArray | JSONObject;

type JSONObject = {
Expand Down Expand Up @@ -157,12 +162,12 @@ function runTests(): void {
else if (CURRENT_NODE_VERSION === '10') {
installLegacyDeps(NODE_10_LEGACY_DEPENDENCIES);
es6ifyTestTSConfig('utils');
runWithIgnores(DEFAULT_SKIP_TESTS_PACKAGES);
runWithIgnores(NODE_10_SKIP_TESTS_PACKAGES);
}
//
else if (CURRENT_NODE_VERSION === '12') {
es6ifyTestTSConfig('utils');
runWithIgnores(DEFAULT_SKIP_TESTS_PACKAGES);
runWithIgnores(NODE_12_SKIP_TESTS_PACKAGES);
}
//
else {
Expand Down
Loading