-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
18,874 additions
and
1,269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*.{js,ts,json}] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
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,3 @@ | ||
module.exports = { | ||
extends: ['@stacks/eslint-config'], | ||
}; |
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 @@ | ||
npx @commitlint/cli --extends @commitlint/config-conventional --edit $1 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const fetchMock = require('jest-fetch-mock'); | ||
fetchMock.enableFetchMocks(); |
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,13 @@ | ||
/** | ||
* @type {import('semantic-release').GlobalConfig} | ||
*/ | ||
export default { | ||
dryRun: true, | ||
debug: true, | ||
branches: ['main', { name: 'next', prerelease: true }], | ||
plugins: [ | ||
'@semantic-release/release-notes-generator', | ||
// '@semantic-release/npm', | ||
// '@semantic-release/github', | ||
], | ||
}; |
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,51 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
|
||
// Run with ANALYZE ENV to show bundle size (only works with cjs) | ||
// e.g.: ANALYZE=true npm run build | ||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | ||
const { DuplicatesPlugin } = require('inspectpack/plugin'); | ||
|
||
const NODE_ENV_PRODUCTION = 'production'; | ||
const NODE_ENV_DEVELOPMENT = 'development'; | ||
|
||
const isAnalyze = !!process.env.ANALYZE; | ||
const isProduction = process.env.NODE_ENV === NODE_ENV_PRODUCTION; | ||
|
||
module.exports = { | ||
mode: isProduction ? NODE_ENV_PRODUCTION : NODE_ENV_DEVELOPMENT, | ||
entry: ['./src/index.ts'], | ||
output: { | ||
library: { | ||
name: 'StacksRpcClient', | ||
type: isAnalyze ? 'commonjs' : 'umd', | ||
}, | ||
filename: 'index.js', | ||
path: path.resolve(process.cwd(), 'dist/umd'), | ||
globalObject: 'this', // recommended for umd bundles in webpack | ||
}, | ||
plugins: [ | ||
isAnalyze && new DuplicatesPlugin(), | ||
isAnalyze && new BundleAnalyzerPlugin({ analyzerMode: 'static' }), | ||
].filter(Boolean), | ||
optimization: { | ||
minimize: isProduction, | ||
}, | ||
devtool: 'source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: [ | ||
{ | ||
loader: 'esbuild-loader', | ||
options: { | ||
target: 'es2017', | ||
tsconfig: 'tsconfig.build.json', | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}; |
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,25 @@ | ||
const makeJestConfig = require('../../configs/jestConfig'); | ||
if (process.env.SKIP_TESTS) { | ||
console.log('Skipping tests...'); | ||
process.exit(0); | ||
} | ||
|
||
module.exports = makeJestConfig(__dirname); | ||
module.exports = packageDirname => { | ||
return { | ||
rootDir: packageDirname, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
coverageDirectory: './coverage/', | ||
collectCoverage: true, | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: './tsconfig.json', | ||
diagnostics: { | ||
ignoreCodes: ['TS151001'], | ||
}, | ||
}, | ||
}, | ||
moduleFileExtensions: ['js', 'ts', 'd.ts'], | ||
setupFilesAfterEnv: ['./config/jest.setup.js'], | ||
testTimeout: 10_000, | ||
}; | ||
}; |
Oops, something went wrong.