-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK Modernization #584
Merged
SDK Modernization #584
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8319913
WIP: Massive modernization of the entire SDK
Shaptic 2dbcc25
Remove unnecessary files + changes
Shaptic 000ffdf
Universal prettier-ification
Shaptic 9d5e339
Update GHA to new commands
Shaptic 947a699
Upgrade *all* the things, drop unused sauce
Shaptic 82315bd
Update library to conform to the new BigNumber API
Shaptic f565717
Fixups: JSDoc generating, CI testing steps, unused libs, etc.
Shaptic 6d687b9
Add typescript+linter 'fixes'
Shaptic fe9a525
Fix linting parser
Shaptic 7197fc5
Add proper code coverage to node/browser
Shaptic 67d10ad
Fixup the prettier support/workflow
Shaptic b413b53
Run prettier on the whole codebase
Shaptic b6583c2
Dropping unneeded rule till I learn why it was there
Shaptic 15fcb6d
Add prod-specific build script
Shaptic 2b0108e
Undo version bump: there may be more PRs later
Shaptic 7a4d6df
Generate the node package via Babel not Webpack
Shaptic 15f13d3
Add build scripts for proper CI
Shaptic 738ccb8
Shuffle around dependencies
Shaptic 0860f74
Temporarily add lib folder
Shaptic 0aa2cdd
Set BigNumber debugging globally
Shaptic 3f894e2
Clean up yarn scripts to make more sense
Shaptic 7abe525
Undo XDR changes as they should be irrelevant
Shaptic 8a8a731
Only generate code coverage in dev mode
Shaptic b5ad486
Update README with new yarn scripts
Shaptic 95e8d25
Fixup commit hook
Shaptic 732d92a
Merge branch 'soroban' into modernize
Shaptic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"targets": { | ||
"ie": "11" | ||
} | ||
}] | ||
] | ||
"@babel/preset-env" | ||
], | ||
"plugins": ["istanbul"] | ||
} |
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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
.nvmrc | ||
.nyc_output/ | ||
/node_modules/ | ||
/tmp/ | ||
/lib/ | ||
/dist/ | ||
/config/dist/ | ||
/coverage/ | ||
/jsdoc/ | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,3 @@ | ||
{ | ||
"extends": "@istanbuljs/nyc-config-babel" | ||
} |
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,7 @@ | ||
../package.json | ||
../node_modules | ||
../lib | ||
../dist | ||
../src/generated | ||
../src/vendor | ||
../docs |
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,37 @@ | ||
const webpackConfig = require('./webpack.config.browser.js'); | ||
|
||
delete webpackConfig.output; | ||
webpackConfig.entry = {}; // karma fills these in | ||
webpackConfig.plugins.shift(); // drop eslinter plugin | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
frameworks: ['mocha', 'sinon-chai'], | ||
browsers: ['FirefoxHeadless', 'ChromeHeadless'], | ||
|
||
files: [ | ||
'../dist/stellar-base.js', // webpack should build this first | ||
'../test/unit/**/*.js' | ||
], | ||
|
||
preprocessors: { | ||
'../test/unit/**/*.js': ['webpack'] | ||
}, | ||
|
||
webpack: webpackConfig, | ||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
|
||
colors: true, | ||
singleRun: true, | ||
|
||
reporters: ['dots', 'coverage'], | ||
coverageReporter: { | ||
type: 'text-summary', | ||
instrumenterOptions: { | ||
istanbul: { noCompact: 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,12 +1,13 @@ | ||
module.exports = { | ||
arrowParens: 'always', | ||
bracketSpacing: true, | ||
jsxBracketSameLine: false, | ||
bracketSameLine: false, | ||
printWidth: 80, | ||
proseWrap: 'always', | ||
semi: true, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
parser: 'babel', | ||
trailingComma: 'none', | ||
useTabs: false | ||
}; |
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,75 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
|
||
var ESLintPlugin = require('eslint-webpack-plugin'); | ||
var TerserPlugin = require('terser-webpack-plugin'); | ||
var NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); | ||
|
||
const config = { | ||
target: 'web', | ||
// https://stackoverflow.com/a/34018909 | ||
entry: { | ||
'stellar-base': path.resolve(__dirname, '../src/index.js'), | ||
'stellar-base.min': path.resolve(__dirname, '../src/index.js') | ||
}, | ||
resolve: { | ||
fallback: { | ||
crypto: require.resolve('crypto-browserify'), | ||
stream: require.resolve('stream-browserify'), | ||
buffer: require.resolve('buffer') | ||
}, | ||
extensions: ['.ts', '.js'] | ||
}, | ||
output: { | ||
clean: true, | ||
library: 'StellarBase', | ||
compareBeforeEmit: true, | ||
path: path.resolve(__dirname, '../dist') | ||
}, | ||
mode: process.env.NODE_ENV ?? 'development', | ||
devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.m?js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
cacheDirectory: true | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
include: /\.min\.js$/, | ||
terserOptions: { | ||
format: { | ||
ascii_only: true | ||
} | ||
} | ||
}) | ||
] | ||
}, | ||
plugins: [ | ||
// this must be first for karma to work (see line 5 of karma.conf.js) | ||
new ESLintPlugin({ | ||
overrideConfigFile: path.resolve(__dirname, './.eslintrc.js') | ||
}), | ||
// Ignore native modules (sodium-native) | ||
new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }), | ||
new NodePolyfillPlugin(), | ||
new webpack.ProvidePlugin({ | ||
Buffer: ['buffer', 'Buffer'] | ||
}) | ||
], | ||
watchOptions: { | ||
ignored: /(node_modules|coverage|lib|dist)/ | ||
} | ||
}; | ||
|
||
module.exports = config; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be using the url for current:
https://github.com/stellar/stellar-core/tree/master/src/protocol-curr/xdr
for next:
https://github.com/stellar/stellar-core/tree/master/src/protocol-next
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main xdr repository has moved out of core to https://github.com/stellar/stellar-xdr repo,
curr
andnext
branches respectively.