Skip to content

Commit

Permalink
Minimize formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Sep 22, 2023
1 parent 4fc2934 commit 21bd09f
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 330 deletions.
12 changes: 6 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
env: {
es6: true,
es6: true
},
extends: ["airbnb-base", "prettier"],
plugins: ["@babel", "prettier", "prefer-import"],
parser: "@babel/eslint-parser",
extends: ['airbnb-base', 'prettier'],
plugins: ['@babel', 'prettier', 'prefer-import'],
parser: '@babel/eslint-parser',
rules: {
"node/no-unpublished-require": 0,
},
'node/no-unpublished-require': 0
}
};
3 changes: 0 additions & 3 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
- name: Install Depencencies
run: yarn install

- name: Ensure minification for stable releases
run: cat package.json | jq '.version' | grep '.beta' || grep 'stellar-sdk.min.js' package.json

- name: Build, Test, and Package
run: yarn preversion

Expand Down
26 changes: 13 additions & 13 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
const webpackConfig = require("./webpack.config.browser.js");
const webpackConfig = require('./webpack.config.browser.js');

delete webpackConfig.output;
delete 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"],
frameworks: ['mocha', 'sinon-chai'],
browsers: ['FirefoxHeadless', 'ChromeHeadless'],

files: [
"../dist/stellar-sdk.js", // webpack should build this first
"../test/test-browser.js",
"../test/unit/**/*.js",
'../dist/stellar-sdk.js', // webpack should build this first
'../test/test-browser.js',
'../test/unit/**/*.js'
],

preprocessors: {
"../test/**/*.js": ["webpack"],
'../test/**/*.js': ['webpack']
},

webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
noInfo: true
},

colors: true,
singleRun: true,

reporters: ["dots", "coverage"],
reporters: ['dots', 'coverage'],
coverageReporter: {
type: "text-summary",
type: 'text-summary',
instrumenterOptions: {
istanbul: { noCompact: true },
},
},
istanbul: { noCompact: true }
}
}
});
};
12 changes: 6 additions & 6 deletions config/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
arrowParens: "always",
arrowParens: 'always',
bracketSpacing: true,
bracketSameLine: false,
printWidth: 80,
proseWrap: "always",
proseWrap: 'always',
semi: true,
singleQuote: false,
singleQuote: true,
tabWidth: 2,
parser: "babel",
trailingComma: "all",
useTabs: false,
parser: 'babel',
trailingComma: 'none',
useTabs: false
};
70 changes: 35 additions & 35 deletions config/webpack.config.browser.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
var path = require("path");
var webpack = require("webpack");
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");
var ESLintPlugin = require('eslint-webpack-plugin');
var TerserPlugin = require('terser-webpack-plugin');
var NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

const config = {
target: "web",
target: 'web',
// https://stackoverflow.com/a/34018909
entry: {
"stellar-sdk": path.resolve(__dirname, "../src/browser.ts"),
"stellar-sdk.min": path.resolve(__dirname, "../src/browser.ts"),
'stellar-sdk': path.resolve(__dirname, '../src/browser.ts'),
'stellar-sdk.min': path.resolve(__dirname, '../src/browser.ts')
},
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
buffer: require.resolve("buffer"),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer')
},
extensions: [".ts", ".js"],
extensions: ['.ts', '.js']
},
output: {
clean: true,
library: {
name: "StellarSdk",
type: "umd",
umdNamedDefine: true,
name: 'StellarSdk',
type: 'umd',
umdNamedDefine: true
},
path: path.resolve(__dirname, "../dist"),
path: path.resolve(__dirname, '../dist')
},
mode: process.env.NODE_ENV ?? "development",
devtool: process.env.NODE_ENV === "production" ? false : "inline-source-map",
mode: process.env.NODE_ENV ?? 'development',
devtool: process.env.NODE_ENV === 'production' ? false : 'inline-source-map',
module: {
rules: [
{
test: /\.m?(ts|js)$/,
exclude: /node_modules\/(?!(stellar-base|js-xdr))/,
use: {
loader: "babel-loader",
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
},
],
cacheDirectory: true
}
}
}
]
},
optimization: {
minimize: true,
Expand All @@ -52,29 +52,29 @@ const config = {
include: /\.min\.js$/,
terserOptions: {
format: {
ascii_only: true,
},
},
}),
],
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"),
overrideConfigFile: path.resolve(__dirname, '../.eslintrc.js')
}),
// Ignore native modules (sodium-native)
new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }),
new NodePolyfillPlugin({
includeAliases: ["http", "https"], // others aren't needed
includeAliases: ['http', 'https'] // others aren't needed
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
Buffer: ['buffer', 'Buffer']
})
],
watchOptions: {
ignored: /(node_modules|coverage|lib|dist)/,
},
ignored: /(node_modules|coverage|lib|dist)/
}
};

module.exports = config;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stellar-sdk",
"version": "11.0.0-beta.4",
"version": "11.0.0-beta.3",
"description": "A library for working with the Stellar Horizon server.",
"keywords": [
"stellar"
Expand All @@ -17,7 +17,7 @@
"author": "Stellar Development Foundation <[email protected]>",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"browser": "./dist/stellar-sdk.min.js",
"browser": "./dist/stellar-sdk.js",
"files": [
"/types",
"/lib",
Expand All @@ -43,7 +43,7 @@
"_build": "yarn build:node && yarn build:test && yarn build:browser",
"_babel": "babel --extensions '.ts' --out-dir lib/ src/",
"_nyc": "nyc --nycrc-path config/.nycrc",
"_prettier": "prettier --config config/prettier.config.js --ignore-path config/.prettierignore --write './**/*.js'"
"_prettier": "prettier --ignore-path config/.prettierignore --write './test/**/*.js'"
},
"husky": {
"hooks": {
Expand Down
50 changes: 25 additions & 25 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
module.exports = {
env: {
es6: true,
es6: true
},
rules: {
// OFF
"import/prefer-default-export": 0,
"node/no-unsupported-features/es-syntax": 0,
"node/no-unsupported-features/es-builtins": 0,
'import/prefer-default-export': 0,
'node/no-unsupported-features/es-syntax': 0,
'node/no-unsupported-features/es-builtins': 0,
camelcase: 0,
"class-methods-use-this": 0,
"linebreak-style": 0,
"new-cap": 0,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"prefer-destructuring": 0,
"lines-between-class-members": 0,
'class-methods-use-this': 0,
'linebreak-style': 0,
'new-cap': 0,
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-use-before-define': 0,
'prefer-destructuring': 0,
'lines-between-class-members': 0,

// WARN
"prefer-import/prefer-import-over-require": [1],
"no-console": ["warn", { allow: ["assert"] }],
"no-debugger": 1,
"no-unused-vars": 1,
"arrow-body-style": 1,
"valid-jsdoc": [
'prefer-import/prefer-import-over-require': [1],
'no-console': ['warn', { allow: ['assert'] }],
'no-debugger': 1,
'no-unused-vars': 1,
'arrow-body-style': 1,
'valid-jsdoc': [
1,
{
requireReturnDescription: false,
},
requireReturnDescription: false
}
],
"prefer-const": 1,
"object-shorthand": 1,
"require-await": 1,
'prefer-const': 1,
'object-shorthand': 1,
'require-await': 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
'no-unused-expressions': [2, { allowTaggedTemplates: true }]
}
};
6 changes: 3 additions & 3 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* tslint:disable:no-var-requires */

export * from './index';
export * as StellarBase from 'stellar-base';
export * from "./index";
export * as StellarBase from "stellar-base";

import axios from 'axios'; // idk why axios is weird
import axios from "axios"; // idk why axios is weird
export { axios };

export default module.exports;
56 changes: 28 additions & 28 deletions src/soroban/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
module.exports = {
env: {
es6: true,
es6: true
},
parser: "@babel/eslint-parser",
extends: ["airbnb-base", "prettier"],
plugins: ["prettier", "prefer-import"],
parser: '@babel/eslint-parser',
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier', 'prefer-import'],
rules: {
// OFF
"import/prefer-default-export": 0,
"node/no-unsupported-features/es-syntax": 0,
"node/no-unsupported-features/es-builtins": 0,
'import/prefer-default-export': 0,
'node/no-unsupported-features/es-syntax': 0,
'node/no-unsupported-features/es-builtins': 0,
camelcase: 0,
"class-methods-use-this": 0,
"linebreak-style": 0,
"new-cap": 0,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"prefer-destructuring": 0,
"lines-between-class-members": 0,
'class-methods-use-this': 0,
'linebreak-style': 0,
'new-cap': 0,
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-use-before-define': 0,
'prefer-destructuring': 0,
'lines-between-class-members': 0,

// WARN
"prefer-import/prefer-import-over-require": [1],
"no-console": ["warn", { allow: ["assert"] }],
"no-debugger": 1,
"no-unused-vars": 1,
"arrow-body-style": 1,
"valid-jsdoc": [
'prefer-import/prefer-import-over-require': [1],
'no-console': ['warn', { allow: ['assert'] }],
'no-debugger': 1,
'no-unused-vars': 1,
'arrow-body-style': 1,
'valid-jsdoc': [
1,
{
requireReturnDescription: false,
},
requireReturnDescription: false
}
],
"prefer-const": 1,
"object-shorthand": 1,
"require-await": 1,
'prefer-const': 1,
'object-shorthand': 1,
'require-await': 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
'no-unused-expressions': [2, { allowTaggedTemplates: true }]
}
};
Loading

0 comments on commit 21bd09f

Please sign in to comment.