Skip to content

Commit

Permalink
refactor: rewrite with typescript and module-builder (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: Rafal Chlodnicki <rchl2k@gmail.com>
  • Loading branch information
rtibaldo and rchl committed Mar 17, 2023
1 parent 31f2810 commit 994f333
Show file tree
Hide file tree
Showing 42 changed files with 2,212 additions and 1,369 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
!.nuxt/sentry.*.js

dist/
lib/plugin.*
lib/templates/*.*
templates/
node_modules

0 .eslintrc.js → .eslintrc.cjs
100755 → 100644
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
CI: true
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]
name: Use Node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
Expand Down
54 changes: 48 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,51 @@
# Dependencies
node_modules
*.iml
.idea

# Logs
*.log*
.nuxt*
.vscode
.DS_STORE
coverage

# Temp directories
.temp
.tmp
.cache

# Yarn
**/.yarn/cache
**/.yarn/*state*

# Generated dirs
dist

# Nuxt
.nuxt
.output
.vercel_build_output
.build-*
.env
.netlify

# Env
.env

# Testing
reports
coverage
*.lcov
.nyc_output

# VSCode
.vscode

# Intellij idea
*.iml
.idea

# OSX
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
File renamed without changes.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
- [&nbsp;Release Notes](https://sentry.nuxtjs.org/releases)
- [📖 &nbsp;Documentation](https://sentry.nuxtjs.org)

## Contributing

1. Install dependencies with `yarn`.
2. Run `yarn dev:prepare` to generate stubbed `dist` directory.
3. Make your changes.
4. Run `yarn lint` and `yarn test` to verify that there is no issues (consider adding new test for your changes).
5. Submit a PR.

## License

[MIT License](./LICENSE)
Expand Down
30 changes: 30 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
{
builder: 'mkdist',
input: './src/templates/',
outDir: './dist/templates',
ext: 'js',
declaration: false,
},
],
externals: [
'@nuxt/types',
'@sentry/browser',
'@sentry/cli',
'@sentry/core',
'@sentry/node',
'@sentry/tracing',
'@sentry/types',
'@sentry/webpack-plugin',
'consola',
'hash-sum',
'hookable',
'pathe',
'unctx',
'webpack',
'vuex',
],
})
19 changes: 0 additions & 19 deletions jest.config.js

This file was deleted.

17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
// Crashes on CI - https://github.com/facebook/jest/issues/10662
// collectCoverage: true,
// collectCoverageFrom: [
// 'dist/module.mjs',
// ],
setupFilesAfterEnv: [
'./test/setup.ts',
],
moduleFileExtensions: ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json', 'node', 'd.ts'],
}

export default jestConfig
53 changes: 0 additions & 53 deletions lib/core/utils.js

This file was deleted.

151 changes: 0 additions & 151 deletions lib/module.js

This file was deleted.

0 comments on commit 994f333

Please sign in to comment.