Skip to content
Snippets Groups Projects
Commit af6a5d7e authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

MAINT: Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #16952 canceled
node_modules
src/generated/
*.tgz
dist
package-lock.json
.gitignore
.gitmodules
node_modules/
caosdb-proto/
src/
test/
babel.config.js
webpack.config.js
.git/
*.tgz
generate_sources.sh
# CaosDB WebUI 2 - Module for Entity Service
This module contains the JavaScript implementation of the CaosDB Entity API.
See [docs.indiscale.com](https://docs.indiscale.com) for more information about the CaosDB Project.
## Generate the WebGRPC Code
* clone/pull git repo `git@gitlab.indiscale.com:caosdb/src/caosdb-proto` (or init/update the submodule).
* Run `./generate_sources.sh`
## Copyright
Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
Copyright (C) 2021 Florian Spreckelsen <f.spreckelsen@indiscale.com>
Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
(unless stated otherwise in the files)
## Licence
AGPL-3.0-or-later
module.exports = {
presets: ['@babel/preset-env'],
};
#!/bin/bash
# if not on PATH export these:
# export PROTOC=/path/to/protoc
# export GRPCWEB_PLUGIN=/path/to/protoc-gen-grpc-web
set -e
PROTOC=${PROTOC:-$(command -v protoc)}
echo "PROTOC: $PROTOC"
GRPCWEB_PLUGIN=${GRPCWEB_PLUGIN:-$(command -v protoc-gen-grpc-web)}
echo "GRPCWEB_PLUGIN: $GRPCWEB_PLUGIN"
SRC_DIR=${SRC_DIR:-$PWD/src}
echo "SRC_DIR: $SRC_DIR"
PROTO_DIR=${PROTO_DIR:-$PWD/caosdb-proto/proto}
echo "PROTO_DIR: $PROTO_DIR"
_OUT_DIR=$SRC_DIR/generated/
mkdir -p $_OUT_DIR
PROTO_MODULE=info/v1
echo "generate javascript module proto/caosdb/$PROTO_MODULE"
PROTO_FILE=${PROTO_DIR}/caosdb/${PROTO_MODULE}/main.proto
${PROTOC} --plugin=${GRPCWEB_PLUGIN} -I=${PROTO_DIR} ${PROTO_FILE} \
--js_out=import_style=commonjs:$_OUT_DIR \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:$_OUT_DIR
{
"name": "@indiscale/caosdb-webui-entity-service",
"version": "0.0.1",
"description": "CaosDB WebUI 2 - Module for Entity Service",
"repository": {
"type": "git",
"url": "https://gitlab.indiscale.com/caosdb/src/caosdb-webui-entity-service"
},
"main": "dist/caosdb-webui-entity-service.js",
"src": "src/index.js",
"scripts": {
"generate": "./generate_sources.sh",
"test": "jest",
"build": "webpack --mode production",
"build:dev": "webpack --mode development",
"prepublish": "rm -rf ./dist && npm run build"
},
"author": "Florian Spreckelsen",
"license": "AGPL-3.0-or-later",
"dependencies": {
"google-protobuf": "^3.19.1",
"grpc-web": "^1.3.0"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"babel-loader": "^8.2.3",
"jest": "^27.3.1",
"webpack": "^5.64.2",
"webpack-cli": "^4.9.1"
}
}
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
resolve: {
extensions: ['*', '.js', '.js'],
},
module: {
rules: [
{
test: /\.(js|js)$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
output: {
path: path.resolve(__dirname, './dist'),
filename: 'caosdb-webui-info-service.js',
library: 'CaosDBInfoService',
libraryTarget: 'umd',
},
devServer: {
contentBase: path.resolve(__dirname, './dist'),
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment