Skip to content

Commit 3da1afa

Browse files
committed
add dev-utils package
1 parent fc8012c commit 3da1afa

15 files changed

+183
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"packages/angular",
3535
"packages/browser",
3636
"packages/core",
37+
"packages/dev-utils",
3738
"packages/ember",
3839
"packages/eslint-config-sdk",
3940
"packages/eslint-plugin-sdk",

packages/dev-utils/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['../../.eslintrc.js'],
3+
};

packages/dev-utils/.npmignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
2+
# into it by the prepack script `scripts/prepack.ts`.
3+
4+
*
5+
6+
!/cjs/**/*
7+
!/esm/**/*
8+
!/types/**/*
9+
10+
# TODO: Do we need this in this package?
11+
# These paths are necessary for Node AWS Lambda layer creation
12+
# This package is a (transitive) dependency of @sentry/serverless and thus it is pulled into
13+
# the lambda layer zip file.
14+
!/build/cjs/**/*
15+
!/build/esm/**/*
16+
!/build/types/**/*

packages/dev-utils/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, 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/dev-utils/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<p align="center">
2+
<a href="https://sentry.io" target="_blank" align="center">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4+
</a>
5+
<br />
6+
</p>
7+
8+
# Sentry JavaScript SDK Developer Utilities
9+
10+
[![npm version](https://img.shields.io/npm/v/@sentry-internal/dev-utils.svg)](https://www.npmjs.com/package/@sentry-internal/dev-utils)
11+
[![npm dm](https://img.shields.io/npm/dm/@sentry-internal/dev-utils.svg)](https://www.npmjs.com/package/@sentry-internal/dev-utils)
12+
[![npm dt](https://img.shields.io/npm/dt/@sentry-internal/dev-utils.svg)](https://www.npmjs.com/package/@sentry-internal/dev-utils)
13+
[![typedoc](https://img.shields.io/badge/docs-typedoc-blue.svg)](http://getsentry.github.io/sentry-javascript/)
14+
15+
## Links
16+
17+
- [Contribution Guide](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md)
18+
- [SDK Developer Docs](https://develop.sentry.dev/sdk/)
19+
20+
## General
21+
22+
Common utilities used during development of the Sentry JavaScript SDKs.

packages/dev-utils/jest.config.js

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

packages/dev-utils/package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "@sentry-internal/dev-utils",
3+
"version": "7.0.0-beta.0",
4+
"description": "Development utilities for all Sentry JavaScript SDKs",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/dev-utils",
7+
"author": "Sentry",
8+
"license": "BSD-3-Clause",
9+
"engines": {
10+
"node": ">=14"
11+
},
12+
"main": "build/cjs/index.js",
13+
"module": "build/esm/index.js",
14+
"types": "build/types/index.d.ts",
15+
"publishConfig": {
16+
"access": "public"
17+
},
18+
"dependencies": {
19+
"@sentry/types": "7.0.0-beta.0",
20+
"tslib": "^1.9.3"
21+
},
22+
"scripts": {
23+
"build": "run-p build:cjs build:esm build:types",
24+
"build:cjs": "tsc -p tsconfig.cjs.json",
25+
"build:dev": "run-s build",
26+
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
27+
"build:esm": "tsc -p tsconfig.esm.json",
28+
"build:rollup": "rollup -c rollup.npm.config.js",
29+
"build:types": "tsc -p tsconfig.types.json",
30+
"build:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
31+
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
32+
"build:dev:watch": "run-s build:watch",
33+
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
34+
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
35+
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
36+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
37+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
38+
"circularDepCheck": "madge --circular src/index.ts",
39+
"clean": "rimraf build coverage",
40+
"fix": "run-s fix:eslint fix:prettier",
41+
"fix:eslint": "eslint . --format stylish --fix",
42+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
43+
"link:yarn": "yarn link",
44+
"lint": "run-s lint:prettier lint:eslint",
45+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
46+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
47+
"test": "jest",
48+
"test:watch": "jest --watch",
49+
"test:package": "node test/types/index.js"
50+
},
51+
"volta": {
52+
"extends": "../../package.json"
53+
},
54+
"sideEffects": false
55+
}
Lines changed: 8 additions & 0 deletions
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+
// This way we don't have to worry about whether third-party packages have updated to ESM yet.
6+
esModuleInterop: true,
7+
}),
8+
);

packages/dev-utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty placeholder

packages/dev-utils/test/git-keep

Whitespace-only changes.

packages/dev-utils/tsconfig.cjs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "build/cjs"
7+
}
8+
}

packages/dev-utils/tsconfig.esm.json

Lines changed: 8 additions & 0 deletions
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/dev-utils/tsconfig.json

Lines changed: 9 additions & 0 deletions
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+
// package-specific options
8+
}
9+
}

packages/dev-utils/tsconfig.test.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
"types": ["node", "jest"],
9+
10+
// other package-specific, test-specific options
11+
}
12+
}
Lines changed: 10 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)