Skip to content
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

Add clone endpoint #19

Merged
merged 6 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .erb/configs/webpack.config.backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* Webpack config for production electron main process
*/

import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import TerserPlugin from 'terser-webpack-plugin';
import baseConfig from './webpack.config.base';
import webpackPaths from './webpack.paths';
// import checkNodeEnv from '../scripts/check-node-env';

// checkNodeEnv('production');

const configuration: webpack.Configuration = {
target: 'node',

mode: 'production',

entry: {
main: path.join(webpackPaths.srcBackendPath, 'run.ts'),
},

output: {
path: webpackPaths.distBackendPath,
filename: '[name].js',
library: {
type: 'umd',
},
},

optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
}),
],
},

plugins: [
// new BundleAnalyzerPlugin({
// analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
// analyzerPort: 8888,
// }),
// /**
// * Create global constants which can be configured at compile time.
// *
// * Useful for allowing different behaviour between development builds and
// * release builds
// *
// * NODE_ENV should be production so that modules do not perform certain
// * development checks
// */
// new webpack.EnvironmentPlugin({
// NODE_ENV: 'production',
// DEBUG_PROD: false,
// START_MINIMIZED: false,
// }),
// new webpack.DefinePlugin({
// 'process.type': '"browser"',
// }),
],

/**
* Disables webpack processing of __dirname and __filename.
* If you run the bundle in node.js it falls back to these values of node.js.
* https://github.com/webpack/webpack/issues/2010
*/
node: {
__dirname: false,
__filename: false,
},
};

export default merge(baseConfig, configuration);
4 changes: 4 additions & 0 deletions .erb/configs/webpack.paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const dllPath = path.join(__dirname, '../dll');
const srcPath = path.join(rootPath, 'src');
const srcMainPath = path.join(srcPath, 'main');
const srcRendererPath = path.join(srcPath, 'renderer');
const srcBackendPath = path.join(srcPath, 'backend');

const releasePath = path.join(rootPath, 'release');
const appPath = path.join(releasePath, 'app');
Expand All @@ -16,6 +17,7 @@ const srcNodeModulesPath = path.join(srcPath, 'node_modules');

const distPath = path.join(appPath, 'dist');
const distMainPath = path.join(distPath, 'main');
const distBackendPath = path.join(rootPath, 'docker');
const distRendererPath = path.join(distPath, 'renderer');

const buildPath = path.join(releasePath, 'build');
Expand All @@ -35,4 +37,6 @@ export default {
distMainPath,
distRendererPath,
buildPath,
srcBackendPath,
distBackendPath,
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ npm-debug.log.*
*.scss.d.ts

mock-data-test
docker/*
!.package.json
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM timbru31/node-alpine-git

COPY docker/* .

EXPOSE 1512 3000-3050

CMD [ "npm", "start" ]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ To apply a preset:
1. Select the desired preset from the list.
2. Apply the preset to update all active responses.

## Using Docker

Folder contains scripts to run the project as a standalone server.

npm run build:backend to build teh JS files required for the standalone server.

Then use docker build . -t mockingbird to create the image.

## Licensing

Mockingbird is dual-licensed under the GNU Affero General Public License v3.0 (AGPLv3) for open-source use and a commercial license for proprietary use. For more details, see [LICENSE](./LICENSE) and [COMMERCIAL_LICENSE](./COMMERCIAL_LICENSE).
Expand Down
12 changes: 12 additions & 0 deletions docker/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "dist",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node main.js"
},
"author": "",
"license": "ISC"
}
Loading
Loading