Skip to content

Commit

Permalink
Babel v7 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed Mar 14, 2024
1 parent 4808054 commit 76f9655
Show file tree
Hide file tree
Showing 9 changed files with 1,588 additions and 1,107 deletions.
8 changes: 2 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"presets": [
[
"es2015"
]
]
}
"presets": [["@babel/preset-env"]]
}
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:

# Publish the package
- name: "Publishing to Npm registry"
run: yarn publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion dist/browser.es6.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/browser.js

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions dist/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ declare class ForceIndex extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function forceindex(input: ForceIndexInput): number[];
declare class VWAPInput extends IndicatorInput {
high: number[];
low: number[];
close: number[];
volume: number[];
}
declare class VWAP extends Indicator {
result: number[];
generator: IterableIterator<number>;
constructor(input: VWAPInput);
static calculate: typeof vwap;
nextValue(price: CandleData): number;
}
declare function vwap(input: VWAPInput): number[];
declare class VolumeProfileInput extends IndicatorInput {
high: number[];
open: number[];
Expand All @@ -33,20 +47,17 @@ declare class VolumeProfile extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function volumeprofile(input: VolumeProfileInput): number[];
declare class VWAPInput extends IndicatorInput {
high: number[];
low: number[];
close: number[];
volume: number[];
declare class AvgGainInput extends IndicatorInput {
period: number;
values: number[];
}
declare class VWAP extends Indicator {
result: number[];
generator: IterableIterator<number>;
constructor(input: VWAPInput);
static calculate: typeof vwap;
nextValue(price: CandleData): number;
declare class AverageGain extends Indicator {
generator: IterableIterator<number | undefined>;
constructor(input: AvgGainInput);
static calculate: typeof averagegain;
nextValue(price: number): number | undefined;
}
declare function vwap(input: VWAPInput): number[];
declare function averagegain(input: AvgGainInput): number[];
declare class AvgLossInput extends IndicatorInput {
values: number[];
period: number;
Expand All @@ -58,17 +69,6 @@ declare class AverageLoss extends Indicator {
nextValue(price: number): number | undefined;
}
declare function averageloss(input: AvgLossInput): number[];
declare class AvgGainInput extends IndicatorInput {
period: number;
values: number[];
}
declare class AverageGain extends Indicator {
generator: IterableIterator<number | undefined>;
constructor(input: AvgGainInput);
static calculate: typeof averagegain;
nextValue(price: number): number | undefined;
}
declare function averagegain(input: AvgGainInput): number[];
/**
* Created by AAravindan on 5/4/16.
*/
Expand Down Expand Up @@ -116,6 +116,28 @@ declare function heikinashi(input: HeikinAshiInput): CandleList;
* @returns {number[]}
*/
declare function fibonacciretracement(start: number, end: number): number[];
declare class IchimokuCloudInput extends IndicatorInput {
high: number[];
low: number[];
conversionPeriod: number;
basePeriod: number;
spanPeriod: number;
displacement: number;
}
declare class IchimokuCloudOutput {
conversion: number;
base: number;
spanA: number;
spanB: number;
}
declare class IchimokuCloud extends Indicator {
result: IchimokuCloudOutput[];
generator: IterableIterator<IchimokuCloudOutput | undefined>;
constructor(input: IchimokuCloudInput);
static calculate: typeof ichimokucloud;
nextValue(price: CandleData): IchimokuCloudOutput;
}
declare function ichimokucloud(input: IchimokuCloudInput): IchimokuCloudOutput[];
declare class KeltnerChannelsInput extends IndicatorInput {
maPeriod: number;
atrPeriod: number;
Expand Down Expand Up @@ -156,28 +178,6 @@ declare class ChandelierExit extends Indicator {
nextValue(price: ChandelierExitInput): ChandelierExitOutput | undefined;
}
declare function chandelierexit(input: ChandelierExitInput): number[];
declare class IchimokuCloudInput extends IndicatorInput {
high: number[];
low: number[];
conversionPeriod: number;
basePeriod: number;
spanPeriod: number;
displacement: number;
}
declare class IchimokuCloudOutput {
conversion: number;
base: number;
spanA: number;
spanB: number;
}
declare class IchimokuCloud extends Indicator {
result: IchimokuCloudOutput[];
generator: IterableIterator<IchimokuCloudOutput | undefined>;
constructor(input: IchimokuCloudInput);
static calculate: typeof ichimokucloud;
nextValue(price: CandleData): IchimokuCloudOutput;
}
declare function ichimokucloud(input: IchimokuCloudInput): IchimokuCloudOutput[];
class StockData {
open: number[];
high: number[];
Expand All @@ -202,16 +202,6 @@ declare class CandleList {
volume?: number[];
timestamp?: number[];
}
declare class EMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof ema;
nextValue(price: number): number;
}
declare function ema(input: MAInput): number[];
/**
* Created by AAravindan on 5/7/16.
*/
Expand All @@ -232,21 +222,6 @@ declare function ema(input: MAInput): number[];
calculatePeriodHigh(): void;
calculatePeriodLow(): void;
}
declare class MAInput extends IndicatorInput {
period: number;
values: number[];
constructor(period: number, values: number[]);
}
declare class SMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof sma;
nextValue(price: number): number | undefined;
}
declare function sma(input: MAInput): number[];
declare class IndicatorInput {
reversedInput?: boolean;
format?: (data: number) => number;
Expand All @@ -267,6 +242,21 @@ declare class Indicator {
static reverseInputs(input: any): void;
getResult(): any;
}
declare class MAInput extends IndicatorInput {
period: number;
values: number[];
constructor(period: number, values: number[]);
}
declare class SMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof sma;
nextValue(price: number): number | undefined;
}
declare function sma(input: MAInput): number[];
declare class ATRInput extends IndicatorInput {
low: number[];
high: number[];
Expand All @@ -281,6 +271,17 @@ declare class ATR extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function atr(input: ATRInput): number[];
declare class EMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof ema;
nextValue(price: number): number;
}
declare function ema(input: MAInput): number[];
declare function format(v: number): number;
declare class LinkedList {
private _head;
private _tail;
Expand All @@ -301,7 +302,6 @@ declare class LinkedList {
resetCursor(): this;
next(): any;
}
declare function format(v: number): number;
declare class WEMA extends Indicator {
period: number;
price: number[];
Expand Down
2 changes: 1 addition & 1 deletion dist/custom.js

Large diffs are not rendered by default.

29 changes: 10 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,23 @@
"jsnext:main": "lib/index.js",
"types": "./declarations/index.d.ts",
"scripts": {
"build": "tsc -p . && babel-node --presets es2015 rollup.js",
"build": "tsc -p . && babel-node rollup.js",
"cover": "babel-istanbul --include-all-sources cover -x dist/**/*.* ./node_modules/mocha/bin/_mocha -- -R spec && open coverage/lcov-report/index.html",
"generateDts": "./generateTsDefinitions.sh",
"start": "sh test.sh",
"test": "mocha --recursive --require babel-core/register --require babel-polyfill",
"test:watch": "mocha --watch --require babel-core/register --require babel-polyfill"
},
"dependencies": {
"@tensorflow/tfjs": "0.10.0"
"test": "mocha --recursive --require @babel/register",
"test:watch": "mocha --watch --require @babel/register"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/core": "^7.0.0",
"@babel/node": "^7.23.9",
"@babel/plugin-external-helpers": "^7.23.3",
"@babel/preset-env": "^7.24.0",
"@babel/register": "^7.23.7",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@types/node": "^20.11.27",
"babel-cli": "^6.8.0",
"babel-core": "^6.8.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-rollup": "^3.0.0",
"babel-register": "^6.8.0",
"babel-runtime": "^6.23.0",
"bl": "^6.0.12",
"draw-candlestick": "2.0.3",
"dts-bundle": "^0.7.3",
Expand All @@ -136,9 +129,7 @@
"mocha": "^10.3.0",
"monaco-editor": "^0.47.0",
"rimraf": "^5.0.5",
"rollup": "^1.26.3",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-babel-minify": "^3.1.2",
"rollup": "^1.32.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-ignore": "^1.0.3",
"rollup-plugin-node-builtins": "^2.1.2",
Expand Down
17 changes: 8 additions & 9 deletions rollup.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// import babel from "@rollup/plugin-babel";
// import minify from "@rollup/plugin-terser";
import babel from "@rollup/plugin-babel";
import minify from "@rollup/plugin-terser";
import { rollup } from "rollup";
import babel from "rollup-plugin-babel";
import minify from "rollup-plugin-babel-minify";
import commonjs from "rollup-plugin-commonjs";
import builtins from "rollup-plugin-node-builtins";
import resolve from "rollup-plugin-node-resolve";
Expand Down Expand Up @@ -31,16 +29,17 @@ async function doBuild() {
babelrc: false,
presets: [
[
"es2015",
"@babel/preset-env",
{
modules: false,
},
],
],
plugins: ["external-helpers"],
plugins: ["@babel/plugin-external-helpers"],
babelHelpers: "external",
}),
minify({
comments: false,
// comments: false,
}),
],
external: ["@babel/polyfill"],
Expand Down Expand Up @@ -110,7 +109,7 @@ async function doBuild() {
}),
commonjs({}),
minify({
comments: false,
// comments: false,
}),
],
external: ["@babel/polyfill"],
Expand Down Expand Up @@ -143,7 +142,7 @@ async function doBuild() {
}),
commonjs({}),
minify({
comments: false,
// comments: false,
}),
],
external: ["@babel/polyfill"],
Expand Down
Loading

0 comments on commit 76f9655

Please sign in to comment.