-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert module code from JS to TypeScript (#5)
- Loading branch information
Showing
22 changed files
with
6,030 additions
and
15,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
.vscode | ||
build | ||
dist | ||
jestCodeCoverage | ||
node_modules | ||
vitestCodeCoverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Changelog | ||
|
||
## 2.0.0 | ||
|
||
- Convert code to TypeScript | ||
- Convert code building from Rollup to Vite v4 | ||
- Convert unit testing from Jest to Vitest | ||
|
||
## 1.0.0 | ||
|
||
- Initial package publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
{ | ||
"root": true, | ||
"extends": ["./config/eslint/eslintBaseConfig.json", "eslint-config-prettier"], | ||
"extends": [ | ||
"./config/eslint/eslintBaseConfig.json", | ||
"./config/eslint/eslintTypescriptConfig.json", | ||
"eslint-config-prettier" | ||
], | ||
"env": { | ||
"browser": false, | ||
"node": true | ||
}, | ||
"rules": { | ||
"no-console": "off" | ||
"no-console": "off", | ||
"@typescript-eslint/lines-between-class-members": "off" | ||
}, | ||
|
||
"overrides": [ | ||
{ | ||
"files": ["src/**/*.test.js"], | ||
"extends": ["./config/eslint/eslintJestConfig.json"] | ||
"files": ["src/*.mts"], | ||
"rules": { | ||
"import/extensions": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["src/RollbarClient*.js"], | ||
"files": ["src/RollbarClient*.mts"], | ||
"env": { | ||
"browser": true | ||
}, | ||
"rules": { | ||
"@typescript-eslint/unbound-method": "off", | ||
"no-console": ["error", { "allow": ["debug", "error", "info", "warn"] }], | ||
"unicorn/filename-case": ["error", { "case": "pascalCase" }] | ||
} | ||
}, | ||
{ | ||
"files": ["./src/**/*.test.js"], | ||
"files": ["./src/**/*.test.mts"], | ||
"parserOptions": { | ||
"project": ["./tsconfig.test.json"] | ||
}, | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"unicorn/filename-case": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["./config/rollup/rollup.config.mjs"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dist | ||
jestCodeCoverage | ||
node_modules | ||
vitestCodeCoverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": ["./tsconfig.json"] | ||
}, | ||
"plugins": ["@typescript-eslint/eslint-plugin"], | ||
"extends": [ | ||
"./eslintBaseConfig.json", | ||
"eslint-config-airbnb-typescript/base", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"eslint-config-prettier" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dist | ||
jestCodeCoverage | ||
node_modules | ||
vitestCodeCoverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// <reference types="vitest" /> | ||
|
||
import { defineConfig } from 'vite'; // eslint-disable-line import/no-extraneous-dependencies -- this is a dev-only dependency | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
// eslint-disable-next-line import/no-default-export -- default export is a Vite requirement | ||
export default defineConfig({ | ||
build: { | ||
emptyOutDir: true, | ||
lib: { | ||
entry: fileURLToPath(new URL('/src/RollbarClient.mts', import.meta.url)), | ||
fileName: 'RollbarClient', | ||
formats: ['es'], | ||
}, | ||
minify: 'esbuild', | ||
modulePreload: false, | ||
outDir: 'dist', | ||
sourcemap: true, | ||
target: 'modules', | ||
}, | ||
test: { | ||
clearMocks: true, | ||
coverage: { | ||
provider: 'c8', | ||
reportsDirectory: './vitestCodeCoverage', | ||
}, | ||
environment: 'happy-dom', | ||
}, | ||
}); |
Oops, something went wrong.