Skip to content

Commit d9936eb

Browse files
committed
ref(build): Rename dist directories to cjs (#4900)
rename the dist directories in all build dirs to cjs. Hence, also the tarballs' structure changes which is why this PR also introduces a breaking change. Additional change: cleanup `yarn clean` commands by removing no longer existing directories
1 parent 42a11c8 commit d9936eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+104
-106
lines changed

.eslintrc.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ module.exports = {
1010
ecmaVersion: 2018,
1111
},
1212
extends: ['@sentry-internal/sdk'],
13-
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'test/manual/**', 'types/**'],
13+
ignorePatterns: [
14+
'coverage/**',
15+
'build/**',
16+
'dist/**',
17+
'cjs/**',
18+
'esm/**',
19+
'examples/**',
20+
'test/manual/**',
21+
'types/**',
22+
],
1423
overrides: [
1524
{
1625
files: ['*.ts', '*.tsx', '*.d.ts'],

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323

2424
CACHED_BUILD_PATHS: |
2525
${{ github.workspace }}/packages/**/build
26-
${{ github.workspace }}/packages/**/dist
26+
${{ github.workspace }}/packages/**/cjs
2727
${{ github.workspace }}/packages/**/esm
2828
${{ github.workspace }}/packages/ember/*.d.ts
2929
${{ github.workspace }}/packages/ember/instance-initializers

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package-lock.json
55

66
# build and test
77
build/
8-
packages/*/dist/
8+
packages/*/cjs/
99
packages/*/esm/
1010
coverage/
1111
scratch/

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
*
55

6-
!/dist/**/*
6+
!/cjs/**/*
77
!/esm/**/*
88
!/types/**/*

.vscode/launch.json

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
"version": "0.2.0",
66
"inputs": [
77
{
8-
"id": "getPackageName",
9-
"type": "command",
10-
"command": "shellCommand.execute",
11-
"args": {
12-
"command": "echo '${file}' | sed s/'.*sentry-javascript\\/packages\\/'// | grep --extended-regexp --only-matching --max-count 1 '[^\\/]+' | head -1",
13-
"cwd": "${workspaceFolder}" ,
14-
// normally `input` commands bring up a selector for the user, but given that there should only be one
15-
// choice here, this lets us skip the prompt
16-
"useSingleResult": true
17-
}
8+
"id": "getPackageName",
9+
"type": "command",
10+
"command": "shellCommand.execute",
11+
"args": {
12+
"command": "echo '${file}' | sed s/'.*sentry-javascript\\/packages\\/'// | grep --extended-regexp --only-matching --max-count 1 '[^\\/]+' | head -1",
13+
"cwd": "${workspaceFolder}",
14+
// normally `input` commands bring up a selector for the user, but given that there should only be one
15+
// choice here, this lets us skip the prompt
16+
"useSingleResult": true
17+
}
1818
}
1919
],
2020
"configurations": [
@@ -25,18 +25,9 @@
2525
"cwd": "${workspaceFolder}/packages/${input:getPackageName}",
2626
"request": "launch",
2727
"runtimeExecutable": "yarn",
28-
"runtimeArgs": [
29-
"rollup",
30-
"-c",
31-
"${file}"
32-
],
33-
"skipFiles": [
34-
"<node_internals>/**"
35-
],
36-
"outFiles": [
37-
"${workspaceFolder}/**/*.js",
38-
"!**/node_modules/**"
39-
],
28+
"runtimeArgs": ["rollup", "-c", "${file}"],
29+
"skipFiles": ["<node_internals>/**"],
30+
"outFiles": ["${workspaceFolder}/**/*.js", "!**/node_modules/**"],
4031
"sourceMaps": true,
4132
"smartStep": true,
4233
"internalConsoleOptions": "openOnSessionStart",
@@ -67,14 +58,13 @@
6758
],
6859
"sourceMaps": true,
6960
"smartStep": true,
70-
// otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on
71-
// "outputCapture" option here; default is to show console logs), but not both
61+
// otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on
62+
// "outputCapture" option here; default is to show console logs), but not both
7263
"console": "integratedTerminal",
7364
// since we're not using it, don't automatically switch to it
74-
"internalConsoleOptions": "neverOpen",
65+
"internalConsoleOptions": "neverOpen"
7566
},
7667

77-
7868
// @sentry/nextjs - Run a specific integration test file
7969
// Must have test file in currently active tab when hitting the play button, and must already have run `yarn` in test app directory
8070
{
@@ -105,18 +95,17 @@
10595
// this controls which files are sourcemapped
10696
"outFiles": [
10797
// our SDK code
108-
"${workspaceFolder}/**/dist/**/*.js",
98+
"${workspaceFolder}/**/cjs/**/*.js",
10999
// the built test app
110100
"${workspaceFolder}/packages/nextjs/test/integration/.next/**/*.js",
111101
"!**/node_modules/**"
112102
],
113103
"resolveSourceMapLocations": [
114-
"${workspaceFolder}/**/dist/**",
104+
"${workspaceFolder}/**/cjs/**",
115105
"${workspaceFolder}/packages/nextjs/test/integration/.next/**",
116106
"!**/node_modules/**"
117107
],
118108
"internalConsoleOptions": "openOnSessionStart"
119-
120-
},
109+
}
121110
]
122111
}

packages/angular/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
2-
!/dist/**/*
2+
!/cjs/**/*
33
!/esm/**/*
44
!/build/types/**/*

packages/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"engines": {
1010
"node": ">=8"
1111
},
12-
"main": "dist/index.js",
12+
"main": "cjs/index.js",
1313
"module": "esm/index.js",
1414
"types": "build/types/index.d.ts",
1515
"publishConfig": {
@@ -47,7 +47,7 @@
4747
"build:types:watch": "tsc -p tsconfig.types.json --watch",
4848
"build:npm": "npm pack",
4949
"circularDepCheck": "madge --circular src/index.ts",
50-
"clean": "rimraf dist esm build coverage",
50+
"clean": "rimraf cjs esm build coverage",
5151
"fix": "run-s fix:eslint fix:prettier",
5252
"fix:eslint": "eslint . --format stylish --fix",
5353
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",

packages/angular/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
"compilerOptions": {
55
"module": "commonjs",
6-
"outDir": "dist"
6+
"outDir": "cjs"
77
}
88
}

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"engines": {
1010
"node": ">=8"
1111
},
12-
"main": "build/npm/dist/index.js",
12+
"main": "build/npm/cjs/index.js",
1313
"module": "build/npm/esm/index.js",
1414
"types": "build/npm/types/index.d.ts",
1515
"publishConfig": {

packages/browser/test/package/test-code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
2-
const Sentry = require('../../build/npm/dist/index.js');
3-
const Integrations = require('../../../integrations/build/npm/dist/dedupe.js');
2+
const Sentry = require('../../build/npm/cjs/index.js');
3+
const Integrations = require('../../../integrations/build/npm/cjs/dedupe.js');
44

55
// Init
66
Sentry.init({

0 commit comments

Comments
 (0)