Skip to content

Commit 47cecb8

Browse files
authored
Revert "Replaces gateway with near-bos-webcomponent (#128)" (#142)
This reverts commit 4fd70ce.
1 parent 3510230 commit 47cecb8

File tree

119 files changed

+13378
-696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+13378
-696
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ bw deploy [app name] --deploy-account-id [deployAccountId] --signer-account-id [
291291

292292
* `--signer-public-key <signerPublicKey>` (Optional): Public key for signing transactions in the format: `ed25519:<public_key>`. Will default to interactive [near-cli-rs](https://github.com/near/near-cli-rs) if not provided.
293293

294-
* `--signer-private-key <signerPrivateKey>` (Optional): Private key for signing transactions in the format: `ed25519:<private_key>`. Will default to interactive [near-cli-rs](https://github.com/near/near-cli-rs) if not provided.
294+
* `--signer-private-key <signerPrivateKey>` (Optional): Private key in `ed25519:<private_key>` format for signing transactions. Will default to interactive [near-cli-rs](https://github.com/near/near-cli-rs) if not provided.
295295

296296
* `-n, --network <network>` (Optional): Network to deploy for (default: "mainnet").
297297

gateway/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/env", "@babel/preset-react"]
3+
}

gateway/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
.wrangler/
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
#IDE
27+
.idea
28+
29+
target
30+
neardev

gateway/config/flags.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const envConfig = document.getElementById("env-config").textContent;
2+
const config = JSON.parse(envConfig);
3+
4+
export const flags = {
5+
bosLoaderUrl:
6+
process.env.BOS_LOADER_URL ||
7+
config.bosLoaderUrl ||
8+
"http://127.0.0.1:4040",
9+
bosLoaderWs:
10+
process.env.BOS_LOADER_WS || config.bosLoaderWs || "ws://127.0.0.1:4040",
11+
enableHotReload:
12+
process.env.ENABLE_HOT_RELOAD ?? config.enableHotReload ?? true,
13+
network:
14+
process.env.NETWORK || config.network || "mainnet",
15+
};

gateway/config/paths.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const path = require("path");
2+
3+
const srcPath = path.resolve(__dirname, "../src");
4+
const distPath = path.resolve(__dirname, "../dist");
5+
const publicPath = path.resolve(__dirname, "../public");
6+
const nodeModulesPath = path.resolve(__dirname, "../node_modules");
7+
8+
module.exports = {
9+
srcPath,
10+
distPath,
11+
publicPath,
12+
nodeModulesPath,
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { merge } = require("webpack-merge");
2+
3+
const loadPresets = (env = { presets: [] }) => {
4+
const presets = env.presets || [];
5+
/** @type {string[]} */
6+
const mergedPresets = [].concat(...[presets]);
7+
const mergedConfigs = mergedPresets.map((presetName) =>
8+
require(`./webpack.${presetName}.js`)(env),
9+
);
10+
11+
return merge({}, ...mergedConfigs);
12+
};
13+
module.exports = loadPresets;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const WebpackBundleAnalyzer =
2+
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
3+
4+
module.exports = () => ({
5+
plugins: [new WebpackBundleAnalyzer()],
6+
});
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const path = require("path");
2+
const { HotModuleReplacementPlugin } = require("webpack");
3+
4+
module.exports = () => ({
5+
devtool: false,
6+
module: {
7+
rules: [
8+
{
9+
test: /\.(scss|css)$/,
10+
use: [
11+
{
12+
// inject CSS to page
13+
loader: "style-loader",
14+
},
15+
{
16+
// translates CSS into CommonJS modules
17+
loader: "css-loader",
18+
},
19+
{
20+
// Run postcss actions
21+
loader: "postcss-loader",
22+
options: {
23+
// `postcssOptions` is needed for postcss 8.x;
24+
// if you use postcss 7.x skip the key
25+
postcssOptions: {
26+
// postcss plugins, can be exported to postcss.config.js
27+
plugins: function () {
28+
return [require("autoprefixer")];
29+
},
30+
},
31+
},
32+
},
33+
{
34+
// compiles Sass to CSS
35+
loader: "sass-loader",
36+
options: {
37+
// Prefer `dart-sass`
38+
implementation: require("sass"),
39+
sassOptions: {
40+
quietDeps: true,
41+
},
42+
},
43+
},
44+
],
45+
},
46+
],
47+
},
48+
devServer: {
49+
open: true,
50+
static: path.resolve(__dirname, "../dist"),
51+
port: 3000,
52+
compress: true,
53+
historyApiFallback: {
54+
disableDotRule: true,
55+
},
56+
client: {
57+
overlay: false,
58+
},
59+
},
60+
plugins: [new HotModuleReplacementPlugin()],
61+
});
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2+
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
3+
const path = require("path");
4+
5+
module.exports = () => {
6+
return {
7+
output: {
8+
path: path.resolve(__dirname, "../dist"),
9+
publicPath: "/",
10+
filename: "[name].[contenthash].bundle.js",
11+
},
12+
devtool: false,
13+
module: {
14+
rules: [
15+
// {
16+
// test: /\.(css)$/,
17+
// use: [MiniCssExtractPlugin.loader, "css-loader"],
18+
// // options: {
19+
// // sourceMap: false,
20+
// // },
21+
// },
22+
{
23+
test: /\.(scss|css)$/,
24+
use: [
25+
{
26+
// inject CSS to page
27+
loader: "style-loader",
28+
},
29+
{
30+
// translates CSS into CommonJS modules
31+
loader: "css-loader",
32+
},
33+
{
34+
// Run postcss actions
35+
loader: "postcss-loader",
36+
options: {
37+
// `postcssOptions` is needed for postcss 8.x;
38+
// if you use postcss 7.x skip the key
39+
postcssOptions: {
40+
// postcss plugins, can be exported to postcss.config.js
41+
plugins: function () {
42+
return [require("autoprefixer")];
43+
},
44+
},
45+
},
46+
},
47+
{
48+
// compiles Sass to CSS
49+
loader: "sass-loader",
50+
options: {
51+
// Prefer `dart-sass`
52+
implementation: require("sass"),
53+
sassOptions: {
54+
quietDeps: true,
55+
},
56+
},
57+
},
58+
],
59+
},
60+
],
61+
},
62+
plugins: [
63+
new MiniCssExtractPlugin({
64+
filename: "styles/[name].[contenthash].css",
65+
chunkFilename: "[id].css",
66+
}),
67+
],
68+
optimization: {
69+
minimize: true,
70+
minimizer: [new CssMinimizerPlugin(), "..."],
71+
runtimeChunk: {
72+
name: "runtime",
73+
},
74+
},
75+
performance: {
76+
hints: false,
77+
maxEntrypointSize: 512000,
78+
maxAssetSize: 512000,
79+
},
80+
};
81+
};

gateway/dist/1234.45819a346281db80fbd9.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)