mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
chore(NA): moving @kbn/tinymath into bazel (#97022)
* chore(NA): moving @kbn/tinymath into bazel * chore(NA): fixed jest tests * chore(NA): simplified tsconfig file Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
3bc2952216
commit
0bfa5aaf01
12 changed files with 82 additions and 1571 deletions
|
@ -64,4 +64,5 @@ yarn kbn watch-bazel
|
|||
- @elastic/datemath
|
||||
- @kbn/apm-utils
|
||||
- @kbn/config-schema
|
||||
- @kbn/tinymath
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
|
||||
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
|
||||
"@kbn/std": "link:packages/kbn-std",
|
||||
"@kbn/tinymath": "link:packages/kbn-tinymath",
|
||||
"@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath/npm_module",
|
||||
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
|
||||
"@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps",
|
||||
"@kbn/utility-types": "link:packages/kbn-utility-types",
|
||||
|
|
|
@ -5,6 +5,7 @@ filegroup(
|
|||
srcs = [
|
||||
"//packages/elastic-datemath:build",
|
||||
"//packages/kbn-apm-utils:build",
|
||||
"//packages/kbn-config-schema:build"
|
||||
"//packages/kbn-config-schema:build",
|
||||
"//packages/kbn-tinymath:build",
|
||||
],
|
||||
)
|
||||
|
|
71
packages/kbn-tinymath/BUILD.bazel
Normal file
71
packages/kbn-tinymath/BUILD.bazel
Normal file
|
@ -0,0 +1,71 @@
|
|||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
load("@npm//pegjs:index.bzl", "pegjs")
|
||||
|
||||
PKG_BASE_NAME = "kbn-tinymath"
|
||||
PKG_REQUIRE_NAME = "@kbn/tinymath"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"src/**/*",
|
||||
]
|
||||
)
|
||||
|
||||
TYPE_FILES = [
|
||||
"index.d.ts",
|
||||
]
|
||||
|
||||
SRCS = SOURCE_FILES + TYPE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md",
|
||||
]
|
||||
|
||||
DEPS = [
|
||||
"@npm//lodash",
|
||||
]
|
||||
|
||||
pegjs(
|
||||
name = "grammar",
|
||||
data = [
|
||||
":grammar/grammar.pegjs"
|
||||
],
|
||||
output_dir = True,
|
||||
args = [
|
||||
"-o",
|
||||
"$(@D)/index.js",
|
||||
"./%s/grammar/grammar.pegjs" % package_name()
|
||||
],
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = [
|
||||
":srcs",
|
||||
":grammar"
|
||||
],
|
||||
deps = DEPS,
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
name = "npm_module",
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = [
|
||||
":%s" % PKG_BASE_NAME,
|
||||
]
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build",
|
||||
srcs = [
|
||||
":npm_module",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
|
@ -107,7 +107,7 @@ String
|
|||
/ [\'] value:(ValidChar)+ [\'] { return value.join(''); }
|
||||
/ value:(ValidChar)+ { return value.join(''); }
|
||||
|
||||
|
||||
|
||||
Argument
|
||||
= name:[a-zA-Z_]+ _ '=' _ value:(Number / String) _ {
|
||||
return {
|
|
@ -4,10 +4,5 @@
|
|||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true,
|
||||
"main": "src/index.js",
|
||||
"types": "tinymath.d.ts",
|
||||
"scripts": {
|
||||
"kbn:bootstrap": "yarn build",
|
||||
"build": "../../node_modules/.bin/pegjs -o src/grammar.js src/grammar.pegjs"
|
||||
},
|
||||
"dependencies": {}
|
||||
"types": "index.d.ts"
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,8 @@
|
|||
*/
|
||||
|
||||
const { get } = require('lodash');
|
||||
const { parse: parseFn } = require('./grammar');
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
const { parse: parseFn } = require('../grammar');
|
||||
const { functions: includedFunctions } = require('./functions');
|
||||
|
||||
module.exports = { parse, evaluate, interpret };
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
Need tests for spacing, etc
|
||||
*/
|
||||
|
||||
import { evaluate, parse } from '..';
|
||||
import { evaluate, parse } from '@kbn/tinymath';
|
||||
|
||||
function variableEqual(value) {
|
||||
return expect.objectContaining({ type: 'variable', value });
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-tinymath"
|
||||
},
|
||||
"include": ["tinymath.d.ts"]
|
||||
"include": ["index.d.ts"]
|
||||
}
|
||||
|
|
|
@ -2740,7 +2740,7 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/tinymath@link:packages/kbn-tinymath":
|
||||
"@kbn/tinymath@link:bazel-bin/packages/kbn-tinymath/npm_module":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue