Skip to content

Commit 5d67d78

Browse files
committed
add dev-utils package
1 parent c8d9905 commit 5d67d78

File tree

12 files changed

+152
-0
lines changed

12 files changed

+152
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"packages/angular",
3232
"packages/browser",
3333
"packages/core",
34+
"packages/dev-utils",
3435
"packages/ember",
3536
"packages/eslint-config-sdk",
3637
"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/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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
## Links
11+
12+
- [Contribution Guide](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md)
13+
- [SDK Developer Docs](https://develop.sentry.dev/sdk/)
14+
15+
## General
16+
17+
Common utilities used during development of the Sentry JavaScript SDKs. Internal only, does not follow semver.

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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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": ">=8"
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+
"scripts": {
19+
"build": "run-p build:rollup build:types",
20+
"build:dev": "run-s build",
21+
"build:rollup": "rollup -c rollup.npm.config.js",
22+
"build:types": "tsc -p tsconfig.types.json",
23+
"build:watch": "run-p build:rollup:watch build:types:watch",
24+
"build:dev:watch": "run-s build:watch",
25+
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
26+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
27+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
28+
"circularDepCheck": "madge --circular src/index.ts",
29+
"clean": "rimraf build coverage cjs esm sentry-dev-utils-*.tgz",
30+
"fix": "run-s fix:eslint fix:prettier",
31+
"fix:eslint": "eslint . --format stylish --fix",
32+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
33+
"link:yarn": "yarn link",
34+
"lint": "run-s lint:prettier lint:eslint",
35+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
36+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
37+
"test": "jest",
38+
"test:watch": "jest --watch"
39+
},
40+
"volta": {
41+
"extends": "../../package.json"
42+
},
43+
"sideEffects": false
44+
}
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// we need some import or export to exist, to satisfy the tsconfig --isolatedModules setting
2+
export const dummyExport = {};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// we need some import or export to exist, to satisfy the tsconfig --isolatedModules setting
2+
import { dummyExport } from '../src';
3+
4+
describe('placeholder tests', () => {
5+
it('holds a place', () => {
6+
expect(dummyExport).toEqual({});
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
// `es2020` is the recommended `lib` and `target` for Node 14
13+
// see https://github.com/tsconfig/bases/blob/main/bases/node14.json
14+
"lib": ["dom", "es2020"],
15+
"target": "es2020",
16+
17+
// so we don't have to worry about how libraries we use export things
18+
"esModuleInterop": true
19+
}
20+
}
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)