Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
slient-coder committed Feb 22, 2023
0 parents commit efba16d
Show file tree
Hide file tree
Showing 9 changed files with 16,046 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = function (api) {
api.cache(true);

const ENV = process.env.BABEL_ENV || "umd";
// esm cjs
console.log("++++++++++++++++++++++++++++++");
console.log("BABEL_ENV: ", ENV);
console.log("++++++++++++++++++++++++++++++");
const presets = [
[
"@babel/preset-env",
{
modules: false,
browserslistEnv: ENV,
loose: true,
bugfixes: true,
},
],
"@babel/preset-typescript",
];
const plugins = [
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
},
],
];

return { presets, plugins, ignore: [/@babel[\\|/]runtime/] };
};
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
.vscode/*
dist/
.DS_Store
tests/
docs/build
docs/source/_build
lib
es
umd
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2022 Unisat

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# bitcoinjs-wallet
34 changes: 34 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const gulp = require("gulp");
const babel = require("gulp-babel");
const ts = require("gulp-typescript");
const tsProject = ts.createProject("tsconfig.json");
const SRC_PATH = "src";

const BUILD_MODE = {
ESM: {
PATH: "es",
},
CJS: {
PATH: "lib",
},
};
const CURRENT_MODE = BUILD_MODE[process.env.BABEL_ENV.toUpperCase()];
gulp.task("build-esm", () => {
return gulp
.src([`${SRC_PATH}/**/*.ts`])
.pipe(babel())
.pipe(gulp.dest(BUILD_MODE.ESM.PATH));
});

gulp.task("build-cjs", () => {
return gulp
.src([`${SRC_PATH}/**/*.ts`])
.pipe(tsProject())
.pipe(gulp.dest(BUILD_MODE.CJS.PATH));
});

if (CURRENT_MODE == BUILD_MODE.ESM) {
gulp.task("build", gulp.series("build-esm"));
} else if (CURRENT_MODE == BUILD_MODE.CJS) {
gulp.task("build", gulp.series("build-cjs"));
}
Loading

0 comments on commit efba16d

Please sign in to comment.