Skip to content

Commit ecd9351

Browse files
authored
Merge pull request #2738 from bugsnag/typescript-integration-rebase-next-catchup
Typescript & ESM migration
2 parents 1495764 + fa3a60f commit ecd9351

501 files changed

Lines changed: 34008 additions & 83766 deletions

File tree

Some content is hidden

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

.buildkite/basic/browser-pipeline.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ steps:
5959
run: "browser-maze-runner-bs"
6060
use-aliases: true
6161
command:
62-
- "--fail-fast"
6362
- "--farm=bs"
6463
- "--browser={{matrix}}"
6564
artifacts#v1.5.0:
@@ -83,7 +82,7 @@ steps:
8382
- "safari_10"
8483
- "ios_15"
8584
- "android_9"
86-
- "chrome_43"
85+
- "chrome_53" # TODO: Revert to Chrome 47 when Maze Runner supports it again (see PLAT-16280)
8786
- "chrome_72"
8887
- "firefox_78"
8988
depends_on: "browser-maze-runner-bs"
@@ -94,7 +93,6 @@ steps:
9493
run: "browser-maze-runner-bs"
9594
use-aliases: true
9695
command:
97-
- "--fail-fast"
9896
- "--https"
9997
- "--farm=bs"
10098
- "--browser={{matrix}}"
@@ -127,7 +125,6 @@ steps:
127125
service-ports: true
128126
use-aliases: true
129127
command:
130-
- "--fail-fast"
131128
- "--https"
132129
- "--farm=bb"
133130
- "--browser={{matrix}}"
@@ -145,31 +142,3 @@ steps:
145142
concurrency_group: "bitbar"
146143
concurrency_method: "eager"
147144

148-
- label: ":bitbar: ie_11 Browser tests (EU hub)"
149-
depends_on: "browser-maze-runner-bb"
150-
timeout_in_minutes: 30
151-
plugins:
152-
docker-compose#v4.12.0:
153-
pull: "browser-maze-runner-bb"
154-
run: "browser-maze-runner-bb"
155-
service-ports: true
156-
use-aliases: true
157-
command:
158-
- "--fail-fast"
159-
- "--farm=bb"
160-
- "--browser=ie_11"
161-
- "--no-tunnel"
162-
- "--aws-public-ip"
163-
artifacts#v1.5.0:
164-
upload:
165-
- "./test/browser/maze_output/failed/**/*"
166-
test-collector#v1.10.2:
167-
files: "reports/TEST-*.xml"
168-
format: "junit"
169-
branch: "^main|next$$"
170-
api-token-env-name: "BROWSER_BUILDKITE_ANALYTICS_TOKEN"
171-
concurrency: 25
172-
concurrency_group: "bitbar"
173-
concurrency_method: "eager"
174-
env:
175-
HOST: "localhost" # IE11 needs the host set to localhost

.buildkite/basic/electron-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
- echo "Running on Node `node -v`"
2727
- npm install electron@${ELECTRON_VERSION} --no-audit --progress=false --no-save
2828
- npm ci --no-audit --progress=false
29-
- npm run build:electron
29+
- npm run build
3030
- defaults write com.apple.CrashReporter DialogType none
3131
- npm run test:unit:electron-runner
3232
- npm run test:electron

.buildkite/pipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ steps:
7777
plugins:
7878
docker-compose#v4.12.0:
7979
run: ci
80-
command: "npm run test:unit"
80+
command:
81+
- "npm run test:unit"
8182

8283
- label: "Type checks/tests"
8384
depends_on: "ci-image"

.eslintignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ permissions: read-all
1414

1515
on:
1616
push:
17-
branches: [ "next", integration/*, main ]
17+
branches: [ "next", "integration/*", main ]
1818
pull_request:
1919
# The branches below must be a subset of the branches above
20-
branches: [ "next", "main" ]
20+
branches: [ "next", "integration/*", "main" ]
2121
schedule:
2222
- cron: '23 13 * * 5'
2323

.github/workflows/test-electron.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- run: npm ci --no-audit --progress=false
4545
env:
4646
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
47-
- run: npm run build:electron
47+
- run: npm run build
4848
shell: bash
4949
- run: sudo apt-get install cppcheck --assume-yes
5050
name: Install cppcheck

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ Gemfile.lock
2222
# IDE files
2323
.idea/
2424
*.iml
25-
zscaler-root-ca.crt*
25+
zscaler-root-ca.crt*
26+
.ts38-validation

.rollup/index.mjs

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
import typescript from '@rollup/plugin-typescript'
3+
import commonjs from '@rollup/plugin-commonjs'
4+
import nodeResolve from '@rollup/plugin-node-resolve'
5+
import replace from '@rollup/plugin-replace'
6+
import fs from 'fs'
7+
8+
const defaultOptions = () => ({
9+
// additional variables to define with '@rollup/plugin-replace'
10+
// e.g. '{ ABC: 123 }' is equivalent to running 'globalThis.ABC = 123'
11+
additionalReplacements: {},
12+
// additional external dependencies, such as '@bugsnag/browser'
13+
external: [],
14+
// the entry point for the bundle
15+
input: undefined,
16+
// additional rollup plugins
17+
plugins: []
18+
})
19+
20+
function createRollupConfig (options = defaultOptions()) {
21+
const packageJson = JSON.parse(fs.readFileSync(`${process.cwd()}/package.json`))
22+
23+
return [
24+
// ESM build
25+
{
26+
input: options.input || './src/index.ts',
27+
output: {
28+
dir: 'dist/esm',
29+
entryFileNames: '[name].js',
30+
format: 'es',
31+
sourcemap: true,
32+
generatedCode: {
33+
preset: 'es2015',
34+
}
35+
},
36+
external: options.external,
37+
plugins: [
38+
replace({
39+
preventAssignment: true,
40+
values: {
41+
__BUGSNAG_NOTIFIER_VERSION__: packageJson.version,
42+
...options.additionalReplacements,
43+
}
44+
}),
45+
nodeResolve({
46+
preferBuiltins: true
47+
}),
48+
commonjs(),
49+
typescript({
50+
tsconfig: './tsconfig.json',
51+
declarationDir: 'dist/esm',
52+
outDir: 'dist/esm',
53+
noEmitOnError: true
54+
}),
55+
...(options.plugins ?? [])
56+
]
57+
},
58+
// CJS build
59+
{
60+
input: options.input || './src/index.ts',
61+
output: {
62+
dir: 'dist/cjs',
63+
entryFileNames: '[name].js',
64+
format: 'cjs',
65+
sourcemap: true,
66+
generatedCode: {
67+
preset: 'es2015',
68+
},
69+
exports: 'named',
70+
interop: 'auto',
71+
footer: 'module.exports = Object.assign(exports.default || {}, exports);'
72+
},
73+
external: options.external,
74+
plugins: [
75+
replace({
76+
preventAssignment: true,
77+
values: {
78+
__BUGSNAG_NOTIFIER_VERSION__: packageJson.version,
79+
...options.additionalReplacements,
80+
}
81+
}),
82+
nodeResolve({
83+
preferBuiltins: true
84+
}),
85+
commonjs(),
86+
typescript({
87+
tsconfig: './tsconfig.json',
88+
declarationDir: 'dist/cjs',
89+
outDir: 'dist/cjs',
90+
noEmitOnError: true
91+
}),
92+
{
93+
name: 'emit-cjs-package-json',
94+
generateBundle() {
95+
this.emitFile({
96+
type: 'asset',
97+
fileName: 'package.json',
98+
source: JSON.stringify({ type: 'commonjs' }, null, 2)
99+
});
100+
}
101+
},
102+
...(options.plugins ?? [])
103+
]
104+
}
105+
]
106+
}
107+
108+
export default createRollupConfig

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 18.20.5

0 commit comments

Comments
 (0)