Skip to content

Commit

Permalink
feat(@formatjs/editor): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed Apr 2, 2021
1 parent 776f14f commit 848e485
Show file tree
Hide file tree
Showing 15 changed files with 2,603 additions and 53 deletions.
636 changes: 586 additions & 50 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@docusaurus/preset-classic": "2.0.0-alpha.72",
"@docusaurus/theme-live-codeblock": "2.0.0-alpha.72",
"@jest/transform": "^26.6.2",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.1",
"@types/babel__core": "^7.1.7",
Expand Down Expand Up @@ -127,6 +128,7 @@
},
"author": "Seth Bertalotto <sbertal@verizonmedia.com>",
"dependencies": {
"@material-ui/core": "^4.11.3",
"chokidar": "^3.4.2"
}
}
113 changes: 113 additions & 0 deletions packages/editor/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "pkg_npm", "copy_to_bin")
load("//tools:index.bzl", "check_format", "ts_compile", "esbuild")
load("//tools:jest.bzl", "jest_test")
load("@npm//http-server:index.bzl", "http_server")
PACKAGE_NAME = "editor"

pkg_npm(
name = PACKAGE_NAME,
package_name = "@formatjs/%s" % PACKAGE_NAME,
srcs = [
"LICENSE.md",
"README.md",
],
deps = [
":dist",
":dist-esm",
],
)

alias(
name = "publish",
actual = "%s.publish" % PACKAGE_NAME,
)

alias(
name = "pack",
actual = "%s.pack" % PACKAGE_NAME,
)

SRCS = glob(["*.ts*"])

SRC_DEPS = [
"@npm//@material-ui/core",
"@npm//@material-ui/icons",
"@npm//react",
"@npm//@types/react",
"@npm//react-dom",
"@npm//@types/react-dom",
"//packages/react-intl:dist"
]

ts_compile(
name = "dist",
package_name = "@formatjs/%s" % PACKAGE_NAME,
srcs = SRCS,
deps = SRC_DEPS,
skip_esm=False,
)

# jest_test(
# name = "unit",
# srcs = [
# "package.json",
# "tests/extract/unit.test.ts",
# "tests/extract/vue_extractor.test.ts",
# "tests/extract/__snapshots__/unit.test.ts.snap",
# ] + SRCS,
# deps = [
# "//packages/icu-messageformat-parser:types",
# "//packages/ts-transformer:types",
# "@npm//rimraf",
# "@npm//@types/rimraf",
# ] + SRC_DEPS,
# )

generated_file_test(
name = "tsconfig_json",
src = "tsconfig.json",
generated = "//tools:tsconfig.golden.json",
)

check_format(
name = "prettier",
srcs = glob(
[
"**/*",
],
exclude = [
"CHANGELOG.md",
# Intentional err
"tests/extract/typescript/err.tsx",
"tests/*/__snapshots__/*",
],
),
)

esbuild(
name = "app",
define = [
"process.env.NODE_ENV=\"development\"",
],
entry_point = "lib/main.js",
format = "iife",
deps = [":dist-esm"] + SRC_DEPS + [

],
)

copy_to_bin(
name = "index",
srcs = ["index.html"],
)

http_server(
name = "server",
data = [
":index",
":app",
],
templated_args = [
"packages/editor",
],
)
Loading

0 comments on commit 848e485

Please sign in to comment.