Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 30 additions & 28 deletions .buildkite/basic/browser-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ steps:
- safari_10
- ios_15
- android_8
- chrome_43
# TODO: Move these to BitBar
# - chrome_43
- chrome_72
- firefox_78
depends_on: "browser-maze-runner-bs"
Expand Down Expand Up @@ -144,30 +145,31 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager

- label: ":bitbar: ie_11 Browser tests"
depends_on: "browser-maze-runner-bb"
timeout_in_minutes: 30
plugins:
docker-compose#v4.12.0:
pull: browser-maze-runner-bb
run: browser-maze-runner-bb
service-ports: true
use-aliases: true
command:
- "--farm=bb"
- "--browser=ie_11"
- "--no-tunnel"
- "--aws-public-ip"
artifacts#v1.5.0:
upload:
- "./test/browser/maze_output/failed/**/*"
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^main|next$$"
api-token-env-name: "BROWSER_BUILDKITE_ANALYTICS_TOKEN"
concurrency: 25
concurrency_group: "bitbar"
concurrency_method: eager
env:
HOST: "localhost" # IE11 needs the host set to localhost for some reason
# Uncomment the following block to enable IE11 tests on BitBar
# - label: ":bitbar: ie_11 Browser tests"
# depends_on: "browser-maze-runner-bb"
# timeout_in_minutes: 30
# plugins:
# docker-compose#v4.12.0:
# pull: browser-maze-runner-bb
# run: browser-maze-runner-bb
# service-ports: true
# use-aliases: true
# command:
# - "--farm=bb"
# - "--browser=ie_11"
# - "--no-tunnel"
# - "--aws-public-ip"
# artifacts#v1.5.0:
# upload:
# - "./test/browser/maze_output/failed/**/*"
# test-collector#v1.10.2:
# files: "reports/TEST-*.xml"
# format: "junit"
# branch: "^main|next$$"
# api-token-env-name: "BROWSER_BUILDKITE_ANALYTICS_TOKEN"
# concurrency: 25
# concurrency_group: "bitbar"
# concurrency_method: eager
# env:
# HOST: "localhost" # IE11 needs the host set to localhost for some reason
2 changes: 1 addition & 1 deletion .buildkite/basic/electron-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
- echo "Running on Node `node -v`"
- npm install electron@${ELECTRON_VERSION} --no-audit --progress=false --no-save
- npm ci --no-audit --progress=false
- npm run build:electron
- npm run build
- defaults write com.apple.CrashReporter DialogType none
- npm run test:unit:electron-runner
- npm run test:electron
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

94 changes: 0 additions & 94 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ permissions: read-all

on:
push:
branches: [ "next", integration/*, main ]
branches: [ "next", "integration/*", main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "next", "main" ]
branches: [ "next", "integration/*", "main" ]
schedule:
- cron: '23 13 * * 5'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- run: npm ci --no-audit --progress=false
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build:electron
- run: npm run build
shell: bash
- run: sudo apt-get install cppcheck --assume-yes
name: Install cppcheck
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Gemfile.lock
# IDE files
.idea/
*.iml
.ts38-validation
68 changes: 68 additions & 0 deletions .rollup/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import typescript from '@rollup/plugin-typescript'
import replace from '@rollup/plugin-replace'
import fs from 'fs'

const defaultOptions = () => ({
// additional variables to define with '@rollup/plugin-replace'
// e.g. '{ ABC: 123 }' is equivalent to running 'globalThis.ABC = 123'
additionalReplacements: {},
// additional external dependencies, such as '@bugsnag/browser'
external: [],
// the entry point for the bundle
input: undefined,
// output directory for the bundle
output: undefined
})

export const sharedOutput = {
dir: 'dist',
generatedCode: {
preset: 'es2015',
}
}

function createRollupConfig (options = defaultOptions()) {
const packageJson = JSON.parse(fs.readFileSync(`${process.cwd()}/package.json`))

return {
input: options.input || 'src/index.ts',
output: options.output || [
{
...sharedOutput,
entryFileNames: '[name].js',
format: 'cjs'
},
{
...sharedOutput,
preserveModules: true,
entryFileNames: '[name].mjs',
format: 'esm'
}
],
external: options.external,
plugins: [
replace({
preventAssignment: true,
values: {
__VERSION__: packageJson.version,
...options.additionalReplacements,
}
}),
typescript({
removeComments: true,
// don't output anything if there's a TS error
noEmitOnError: true,
// turn on declaration files and declaration maps
compilerOptions: {
declaration: true,
declarationMap: true,
emitDeclarationOnly: true,
declarationDir: 'dist/types',
}
}),
...(options.plugins ?? [])
]
}
}

export default createRollupConfig
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 18.20.5
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ npm run test:types

## Linting

Lints the entire repo with ESLint. On JavaScript files this uses the [standard](https://github.com/standard/eslint-config-standard) ruleset and on TypeScript files this uses the [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) recommended set of rules.
Lints the entire repo with ESLint.

```sh
npm run test:lint
Expand Down
38 changes: 18 additions & 20 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
module.exports = api => {
// NB: This function can be called without an api argument, e.g. by bin/bundle
// NB: This function can be called without an api argument

const presets = []
const plugins = []
const overrides = []

if (api && api.env('test')) {
presets.push(['@babel/preset-env', {targets: {node: 'current'}}])
presets.push('@babel/preset-typescript')
plugins.push(['@babel/plugin-proposal-class-properties', { loose: true }])
plugins.push('@babel/plugin-transform-modules-commonjs')
plugins.push('@babel/plugin-proposal-optional-chaining')
overrides.push({
test: 'node_modules/react-native/**/*',
presets: ['module:metro-react-native-babel-preset']
Expand All @@ -22,24 +20,24 @@ module.exports = api => {
test: './packages/plugin-react-navigation/**/*',
presets: ['@babel/preset-react', 'module:metro-react-native-babel-preset']
})
} else {
plugins.push(
['@babel/plugin-transform-arrow-functions'],
['@babel/plugin-transform-block-scoping'],
['@babel/plugin-transform-classes', { loose: true }],
['@babel/plugin-transform-computed-properties', { loose: true }],
['@babel/plugin-transform-destructuring', { loose: true }],
['@babel/plugin-transform-member-expression-literals'],
['@babel/plugin-transform-property-literals'],
['@babel/plugin-transform-parameters', { loose: true }],
['@babel/plugin-transform-shorthand-properties'],
['@babel/plugin-transform-spread', { loose: true }],
['@babel/plugin-transform-template-literals', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
['@babel/syntax-object-rest-spread']
)
}

plugins.push(
['@babel/plugin-transform-arrow-functions'],
['@babel/plugin-transform-block-scoping'],
['@babel/plugin-transform-classes', { loose: true }],
['@babel/plugin-transform-computed-properties', { loose: true }],
['@babel/plugin-transform-destructuring', { loose: true }],
['@babel/plugin-transform-member-expression-literals'],
['@babel/plugin-transform-property-literals'],
['@babel/plugin-transform-parameters', { loose: true }],
['@babel/plugin-transform-shorthand-properties'],
['@babel/plugin-transform-spread', { loose: true }],
['@babel/plugin-transform-template-literals', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
['@babel/syntax-object-rest-spread']
)

if (api && !api.env('test')) {
api.cache(false)
}
Expand Down
5 changes: 4 additions & 1 deletion bin/local-test-util
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function buildNotifiers (notifier) {
async function packNotifiers (notifier) {
const notifiers = notifier
? [ notifier ]
: [ 'js', 'browser', 'node', 'web-worker', 'plugin-angular', 'plugin-react', 'plugin-vue' ]
: [ 'core', 'js', 'browser', 'node', 'web-worker', 'plugin-angular', 'plugin-react', 'plugin-vue' ]
for (const n of notifiers) {
let packageLocation = `packages/${n}/`
if (n === 'plugin-angular') packageLocation += 'dist/'
Expand All @@ -138,9 +138,11 @@ async function installNotifiers (notifier) {
`--no-save`,
].concat(notifier
? [
`../../../../bugsnag-core-${require(`../packages/core/package.json`).version}.tgz`,
`../../../../bugsnag-${notifier}-${require(`../packages/${notifier}/package.json`).version}.tgz`
]
: [
`../../../../bugsnag-core-${require('../packages/core/package.json').version}.tgz`,
`../../../../bugsnag-browser-${require('../packages/browser/package.json').version}.tgz`,
`../../../../bugsnag-web-worker-${require('../packages/web-worker/package.json').version}.tgz`,
`../../../../bugsnag-plugin-react-${require('../packages/plugin-react/package.json').version}.tgz`,
Expand All @@ -158,6 +160,7 @@ async function installNgNotifier (notifier, version = '12') {
`install`,
`--no-package-lock`,
`--no-save`,
`../../../../../../bugsnag-core-${require('../packages/core/package.json').version}.tgz`,
`../../../../../../bugsnag-browser-${require('../packages/browser/package.json').version}.tgz`,
`../../../../../../bugsnag-js-${require('../packages/js/package.json').version}.tgz`,
`../../../../../../bugsnag-node-${require('../packages/node/package.json').version}.tgz`,
Expand Down
2 changes: 2 additions & 0 deletions config/electron-jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
projects: [
{
resolver: '<rootDir>/jest/node-exports-resolver',
setupFilesAfterEnv: ['<rootDir>/test/electron/setup.ts'],
clearMocks: true,
modulePathIgnorePatterns: ['.verdaccio', 'fixtures', 'examples'],
Expand All @@ -9,6 +10,7 @@ module.exports = {
testMatch: ['**/test/**/*.test-main.ts']
},
{
resolver: '<rootDir>/jest/node-exports-resolver',
setupFilesAfterEnv: ['<rootDir>/test/electron/setup.ts'],
clearMocks: true,
modulePathIgnorePatterns: ['.verdaccio', 'fixtures', 'examples'],
Expand Down
Loading
Loading