mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-23 18:17:45 +01:00
- feat(cognitron): Repair JS build
1 internal commit(s) GitOrigin-RevId: a636499568b3ea7a0b979be07265e434052bffc4
This commit is contained in:
parent
6ce4308da5
commit
1ca0b80fe0
@ -26,8 +26,8 @@ http_archive(
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "build_bazel_rules_nodejs",
|
name = "build_bazel_rules_nodejs",
|
||||||
sha256 = "1134ec9b7baee008f1d54f0483049a97e53a57cd3913ec9d6db625549c98395a",
|
sha256 = "a160d9ac88f2aebda2aa995de3fa3171300c076f06ad1d7c2e1385728b8442fa",
|
||||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.4.0/rules_nodejs-3.4.0.tar.gz"],
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.4.1/rules_nodejs-3.4.1.tar.gz"],
|
||||||
)
|
)
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
load("//rules/nodejs:common.bzl", "js_library")
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||||
|
|
||||||
js_library(
|
js_library(
|
||||||
name = "base-client",
|
name = "base-client",
|
||||||
|
package_name = "base-client",
|
||||||
srcs = ["base-client.js"],
|
srcs = ["base-client.js"],
|
||||||
data = [
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
"//library/js:utils",
|
"//library/js:utils",
|
||||||
"@npm//axios",
|
"@npm//axios",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
js_library(
|
js_library(
|
||||||
name = "utils",
|
name = "utils",
|
||||||
|
package_name = "utils",
|
||||||
srcs = ["utils.js"],
|
srcs = ["utils.js"],
|
||||||
data = [
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
"@npm//lodash",
|
"@npm//lodash",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { removeUndefined, toCamel, toSnake } from '~/library/js/utils'
|
import { removeUndefined, toCamel, toSnake } from 'utils'
|
||||||
import Axios from 'axios'
|
import Axios from 'axios'
|
||||||
|
|
||||||
export default class BaseClient {
|
export default class BaseClient {
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
load("//rules/nodejs:common.bzl", "js_library")
|
|
||||||
|
|
||||||
js_library(
|
|
||||||
name = "components",
|
|
||||||
srcs = glob(["**/*.vue"]),
|
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
|
@ -1,21 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
b-container
|
|
||||||
b-modal(ref="newElementModal", :title="'New ' + typeName", @ok="handleAddElementOk", @cancel="handleAddElementCancel", @shown="$refs.newElement.focus()")
|
|
||||||
p.text-modal
|
|
||||||
b-form-input.form-control-sm(ref="newElement", v-model="newElement")
|
|
||||||
b-badge.ml-2(v-for="(element, elementIndex) of value", :key="elementIndex")
|
|
||||||
span {{ getDisplayName(element) }}
|
|
||||||
i.ml-1.fa.fa-sm.fa-remove(@click="deleteElement(elementIndex)", v-if="mutable")
|
|
||||||
b-badge.ml-2(@click="handleAddElementInit", variant="danger", v-if="mutable")
|
|
||||||
i.fa.fa-md.fa-plus
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import BaseList from '~/library/js/components/BaseList'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'BadgeList',
|
|
||||||
extends: BaseList
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,56 +0,0 @@
|
|||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'BaseList',
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: Array,
|
|
||||||
default: function () { return [] }
|
|
||||||
},
|
|
||||||
typeName: {
|
|
||||||
type: String,
|
|
||||||
default: 'element'
|
|
||||||
},
|
|
||||||
getDisplayName: {
|
|
||||||
type: Function,
|
|
||||||
default: function (x) {
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
},
|
|
||||||
afterProcess: {
|
|
||||||
type: Function,
|
|
||||||
default: function (x) {
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mutable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
newElement: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleAddElementInit () {
|
|
||||||
this.$refs.newElementModal.show()
|
|
||||||
},
|
|
||||||
handleAddElementOk () {
|
|
||||||
let processed = this.afterProcess(this.newElement)
|
|
||||||
this.value.push(processed)
|
|
||||||
this.$emit('added', processed)
|
|
||||||
this.newElement = null
|
|
||||||
},
|
|
||||||
handleAddElementCancel () {
|
|
||||||
this.newElement = null
|
|
||||||
},
|
|
||||||
deleteElement (elementIndex) {
|
|
||||||
let deleted = this.value[elementIndex]
|
|
||||||
this.value.splice(elementIndex, 1)
|
|
||||||
this.$emit('deleted', deleted)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,21 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
b-container
|
|
||||||
b-modal(ref="newElementModal", :title="'New ' + typeName", @ok="handleAddElementOk", @cancel="handleAddElementCancel", @shown="$refs.newElement.focus()")
|
|
||||||
p.text-modal
|
|
||||||
b-form-input.form-control-sm(ref="newElement", v-model="newElement")
|
|
||||||
div(v-for="(element, elementIndex) of value", :key="elementIndex")
|
|
||||||
span {{ getDisplayName(element) }}
|
|
||||||
i.ml-1.fa.fa-sm.fa-remove.float-right(@click="deleteElement(elementIndex)", v-if="mutable")
|
|
||||||
hr
|
|
||||||
b-button.btn-sm.float-right(@click="handleAddElementInit", variant="primary", v-if="mutable") Add
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import BaseList from '~/library/js/components/BaseList'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'CommonList',
|
|
||||||
extends: BaseList
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,45 +0,0 @@
|
|||||||
<template lang="pug">
|
|
||||||
b-container(v-if="visible")
|
|
||||||
.loader
|
|
||||||
.message {{text}}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Loader',
|
|
||||||
props: {
|
|
||||||
text: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.loader {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 100;
|
|
||||||
background-color: black;
|
|
||||||
opacity: 0.3;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.message {
|
|
||||||
padding: 50px 20px;
|
|
||||||
background: white;
|
|
||||||
width: 30%;
|
|
||||||
text-align: center;
|
|
||||||
position: fixed;
|
|
||||||
left: 35%;
|
|
||||||
top: 100px;
|
|
||||||
z-index: 1000;
|
|
||||||
font-size: 26px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -2,14 +2,14 @@
|
|||||||
services:
|
services:
|
||||||
nexus-cognitron-web:
|
nexus-cognitron-web:
|
||||||
depends_on:
|
depends_on:
|
||||||
- summa
|
- nexus-meta-api-envoy
|
||||||
environment:
|
environment:
|
||||||
ENV_TYPE: production
|
ENV_TYPE: production
|
||||||
NEXUS_COGNITRON_WEB_ipfs.gateway.url: https://cloudflare-ipfs.com
|
NEXUS_COGNITRON_WEB_ipfs.gateway.url: https://cloudflare-ipfs.com
|
||||||
NEXUS_COGNITRON_WEB_meta_api.url: http://nexus-meta-api:8080
|
NEXUS_COGNITRON_WEB_meta_api.url: http://localhost:8080
|
||||||
image: thesuperpirate/cognitron-web:latest
|
image: thesuperpirate/cognitron-web:latest
|
||||||
ports:
|
ports:
|
||||||
- '3000:80'
|
- '3000:3000'
|
||||||
nexus-meta-api:
|
nexus-meta-api:
|
||||||
depends_on:
|
depends_on:
|
||||||
- summa
|
- summa
|
||||||
@ -19,15 +19,12 @@ services:
|
|||||||
NEXUS_META_API_grpc.port: 9090
|
NEXUS_META_API_grpc.port: 9090
|
||||||
NEXUS_META_API_summa.url: 'http://summa:8082'
|
NEXUS_META_API_summa.url: 'http://summa:8082'
|
||||||
image: thesuperpirate/meta-api:latest
|
image: thesuperpirate/meta-api:latest
|
||||||
ports:
|
|
||||||
- '9090:9090'
|
|
||||||
nexus-meta-api-envoy:
|
nexus-meta-api-envoy:
|
||||||
depends_on:
|
depends_on:
|
||||||
- nexus-meta-api
|
- nexus-meta-api
|
||||||
image: envoyproxy/envoy-dev:latest
|
image: envoyproxy/envoy-dev:latest
|
||||||
ports:
|
ports:
|
||||||
- '8080:8080'
|
- '8080:8080'
|
||||||
- '9901:9901'
|
|
||||||
volumes:
|
volumes:
|
||||||
- './nexus-meta-api-envoy.yaml:/etc/envoy/envoy.yaml'
|
- './nexus-meta-api-envoy.yaml:/etc/envoy/envoy.yaml'
|
||||||
summa:
|
summa:
|
||||||
@ -37,8 +34,6 @@ services:
|
|||||||
SUMMA_http.address: '0.0.0.0'
|
SUMMA_http.address: '0.0.0.0'
|
||||||
SUMMA_http.port: '8082'
|
SUMMA_http.port: '8082'
|
||||||
image: izihawa/summa:latest
|
image: izihawa/summa:latest
|
||||||
ports:
|
|
||||||
- '8082:8082'
|
|
||||||
volumes:
|
volumes:
|
||||||
- '${DATA_PATH}:/summa/data'
|
- '${DATA_PATH}:/summa/data'
|
||||||
version: "3"
|
version: "3"
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||||
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
||||||
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
|
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
|
||||||
load("@npm//nuxt:index.bzl", "nuxt")
|
load("@npm//nuxt:index.bzl", "nuxt")
|
||||||
load("//rules/nodejs:common.bzl", "js_library")
|
|
||||||
|
files = ["nuxt.config.js"] + glob([
|
||||||
|
"assets/**",
|
||||||
|
"components/**/*.vue",
|
||||||
|
"layouts/*.vue",
|
||||||
|
"middleware/*.js",
|
||||||
|
"pages/**/*.vue",
|
||||||
|
"plugins/*.js",
|
||||||
|
"static/*",
|
||||||
|
"store/*.js",
|
||||||
|
])
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"@npm//@nuxtjs/axios",
|
"@npm//@nuxtjs/axios",
|
||||||
@ -18,27 +29,20 @@ deps = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
js_library(
|
js_library(
|
||||||
name = "nuxt-srcs",
|
name = "nexus-cognitron-web",
|
||||||
srcs = ["nuxt.config.js"] + glob([
|
package_name = "nexus-cognitron-web",
|
||||||
"assets/**",
|
srcs = files,
|
||||||
"components/**/*.vue",
|
deps = deps,
|
||||||
"layouts/*.vue",
|
|
||||||
"middleware/*.js",
|
|
||||||
"pages/**/*.vue",
|
|
||||||
"plugins/*.js",
|
|
||||||
"static/*",
|
|
||||||
"store/*.js",
|
|
||||||
]),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
nuxt(
|
nuxt(
|
||||||
name = "web_dev",
|
name = "web-dev",
|
||||||
args = [
|
args = [
|
||||||
"-c",
|
"-c",
|
||||||
"nexus/cognitron/web/nuxt.config.js",
|
"nexus/cognitron/web/nuxt.config.js",
|
||||||
"--watch-poll",
|
"--watch-poll",
|
||||||
],
|
],
|
||||||
data = [":nuxt-srcs"] + deps,
|
data = [":nexus-cognitron-web"],
|
||||||
)
|
)
|
||||||
|
|
||||||
nuxt(
|
nuxt(
|
||||||
@ -50,7 +54,8 @@ nuxt(
|
|||||||
"nexus/cognitron/web/nuxt.config.js",
|
"nexus/cognitron/web/nuxt.config.js",
|
||||||
"--buildDir=$(@D)",
|
"--buildDir=$(@D)",
|
||||||
],
|
],
|
||||||
data = [":nuxt-srcs"] + deps,
|
data = files + deps,
|
||||||
|
link_workspace_root = True,
|
||||||
output_dir = True,
|
output_dir = True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ if (buildDir) {
|
|||||||
buildDir = 'nexus/cognitron/web/.nuxt'
|
buildDir = 'nexus/cognitron/web/.nuxt'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
module.exports = {
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 8082
|
port: 3000
|
||||||
},
|
},
|
||||||
buildDir: buildDir,
|
buildDir: buildDir,
|
||||||
srcDir: 'nexus/cognitron/web',
|
srcDir: 'nexus/cognitron/web',
|
||||||
@ -40,11 +40,11 @@ export default {
|
|||||||
|
|
||||||
publicRuntimeConfig: {
|
publicRuntimeConfig: {
|
||||||
meta_api: {
|
meta_api: {
|
||||||
url: process.env.NEXUS_COGNITRON_WEB_meta_api.url || 'http://nexus-meta-api:8080'
|
url: process.env['NEXUS_COGNITRON_WEB_meta_api.url'] || 'http://localhost:8080'
|
||||||
},
|
},
|
||||||
ipfs: {
|
ipfs: {
|
||||||
gateway: {
|
gateway: {
|
||||||
url: process.env.NEXUS_COGNITRON_WEB_ipfs.gateway.url || 'https://ipfs.io'
|
url: process.env['NEXUS_COGNITRON_WEB_ipfs.gateway.url'] || 'https://ipfs.io'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -80,6 +80,7 @@ export default {
|
|||||||
build: {
|
build: {
|
||||||
extend (config) {
|
extend (config) {
|
||||||
config.resolve.alias['~'] = process.cwd()
|
config.resolve.alias['~'] = process.cwd()
|
||||||
}
|
},
|
||||||
|
transpile: ['nexus-meta-api-js-client'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import MetaApi from '~/nexus/meta_api/js/client'
|
import MetaApi from 'nexus-meta-api-js-client'
|
||||||
|
|
||||||
export default ({ $config }, inject) => {
|
export default ({ $config }, inject) => {
|
||||||
const metaApi = new MetaApi($config.metaApi)
|
const metaApi = new MetaApi($config.meta_api)
|
||||||
inject('meta_api', metaApi)
|
inject('meta_api', metaApi)
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ py3_image(
|
|||||||
"//library/aiopostgres",
|
"//library/aiopostgres",
|
||||||
"//library/configurator",
|
"//library/configurator",
|
||||||
"//library/logging",
|
"//library/logging",
|
||||||
"//nexus/meta_api/proto:meta_api_grpc_py",
|
"//nexus/meta_api/proto:meta-api-grpc-py",
|
||||||
"//nexus/meta_api/query_extensionner",
|
"//nexus/meta_api/query_extensionner",
|
||||||
"//nexus/models/proto:models_proto_py",
|
"//nexus/models/proto:models_proto_py",
|
||||||
"//nexus/nlptools",
|
"//nexus/nlptools",
|
||||||
|
@ -11,8 +11,8 @@ py_library(
|
|||||||
requirement("tenacity"),
|
requirement("tenacity"),
|
||||||
requirement("aiogrpcclient"),
|
requirement("aiogrpcclient"),
|
||||||
requirement("aiokit"),
|
requirement("aiokit"),
|
||||||
"//nexus/meta_api/proto:meta_api_grpc_py",
|
"//nexus/meta_api/proto:meta-api-grpc-py",
|
||||||
"//nexus/meta_api/proto:meta_api_proto_py",
|
"//nexus/meta_api/proto:meta-api-proto-py",
|
||||||
"//nexus/models/proto:models_proto_py",
|
"//nexus/models/proto:models_proto_py",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
load("//rules/nodejs:common.bzl", "js_library")
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||||
|
|
||||||
js_library(
|
js_library(
|
||||||
name = "client",
|
name = "client",
|
||||||
|
package_name = "nexus-meta-api-js-client",
|
||||||
srcs = glob(["*.js"]),
|
srcs = glob(["*.js"]),
|
||||||
data = [
|
|
||||||
"//library/js:base-client",
|
|
||||||
"//library/js:utils",
|
|
||||||
"//nexus/meta_api/proto:meta_api_grpc_web_js",
|
|
||||||
],
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//nexus/meta_api/proto:meta-api-grpc-web-js",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import documentsProto from '~/nexus/meta_api/proto/documents_service_grpc_web_pb'
|
import documentsProto from 'meta-api-grpc-web-js/meta-api-grpc-web-js_pb/nexus/meta_api/proto/documents_service_grpc_web_pb'
|
||||||
import searchProto from '~/nexus/meta_api/proto/search_service_grpc_web_pb'
|
import searchProto from 'meta-api-grpc-web-js/meta-api-grpc-web-js_pb/nexus/meta_api/proto/search_service_grpc_web_pb'
|
||||||
|
|
||||||
export default class MetaApi {
|
export default class MetaApi {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
|
@ -6,7 +6,7 @@ load("@rules_proto_grpc//js:defs.bzl", "js_grpc_web_library")
|
|||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
proto_library(
|
proto_library(
|
||||||
name = "meta_api_proto",
|
name = "meta-api-proto",
|
||||||
srcs = glob([
|
srcs = glob([
|
||||||
"*.proto",
|
"*.proto",
|
||||||
]),
|
]),
|
||||||
@ -17,27 +17,29 @@ proto_library(
|
|||||||
)
|
)
|
||||||
|
|
||||||
py_proto_library(
|
py_proto_library(
|
||||||
name = "meta_api_proto_py",
|
name = "meta-api-proto-py",
|
||||||
deps = [":meta_api_proto"],
|
deps = [":meta-api-proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_grpc_library(
|
py_grpc_library(
|
||||||
name = "meta_api_grpc_py",
|
name = "meta-api-grpc-py",
|
||||||
srcs = [":meta_api_proto"],
|
srcs = [":meta-api-proto"],
|
||||||
deps = [":meta_api_proto_py"],
|
deps = [":meta-api-proto-py"],
|
||||||
)
|
)
|
||||||
|
|
||||||
rust_proto_library(
|
rust_proto_library(
|
||||||
name = "meta_api_proto_rust",
|
name = "meta-api-proto-rust",
|
||||||
rust_deps = ["//rules/rust/cargo:protobuf"],
|
rust_deps = ["//rules/rust/cargo:protobuf"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [":meta_api_proto"],
|
deps = [":meta-api-proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
js_grpc_web_library(
|
js_grpc_web_library(
|
||||||
name = "meta_api_grpc_web_js",
|
name = "meta-api-grpc-web-js",
|
||||||
prefix_path = "../../../../",
|
protos = [
|
||||||
protos = [":meta_api_proto"],
|
":meta-api-proto",
|
||||||
|
"//nexus/models/proto:models_proto",
|
||||||
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["//nexus/models/proto:models_proto_js"],
|
deps = ["//nexus/models/proto:models_proto_js"],
|
||||||
)
|
)
|
||||||
|
@ -26,7 +26,6 @@ rust_proto_library(
|
|||||||
|
|
||||||
js_proto_library(
|
js_proto_library(
|
||||||
name = "models_proto_js",
|
name = "models_proto_js",
|
||||||
prefix_path = "../../../../",
|
|
||||||
protos = [":models_proto"],
|
protos = [":models_proto"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user