-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: vue example cleanup and add trivial test target
- Loading branch information
Showing
26 changed files
with
708 additions
and
8,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", "nodejs_test") | ||
load("@npm//@vue/cli-service:index.bzl", "vue_cli_service") | ||
|
||
vue_cli_service( | ||
name = "serve", | ||
args = ["serve"], | ||
data = [ | ||
"babel.config.js", | ||
":package.json", | ||
"//src", | ||
], | ||
) | ||
|
||
vue_cli_service( | ||
name = "build", | ||
outs = ["dist"], | ||
args = [ | ||
"build", | ||
"--dest", | ||
"$(@D)/dist", | ||
"--skip-plugins", | ||
"eslint", | ||
], | ||
data = [ | ||
"babel.config.js", | ||
":package.json", | ||
"//src", | ||
"@npm//vue", | ||
"@npm//@vue/cli-plugin-babel", | ||
# Shouldn't be needed since it's in skip-plugins ? | ||
"@npm//@vue/cli-plugin-eslint", | ||
], | ||
) | ||
|
||
copy_to_bin( | ||
name = "test_in_bin", | ||
srcs = ["smoke.test.js"], | ||
) | ||
|
||
# The example should have a Jest or Mocha test following the Vue instructions | ||
# https://cli.vuejs.org/config/#unit-testing | ||
# And probably also some e2e test that the server works. | ||
# For now, just a trivial test to ensure we can build | ||
nodejs_test( | ||
name = "test", | ||
data = [":build"], | ||
entry_point = "test_in_bin", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
examples/vue/hello-world/WORKSPACE → examples/vue/WORKSPACE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
workspace( | ||
name = "helloworld", | ||
name = "vue_example", | ||
managed_directories = {"@npm": ["node_modules"]}, | ||
) | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "build_bazel_rules_nodejs", | ||
sha256 = "f9e7b9f42ae202cc2d2ce6d698ccb49a9f7f7ea572a78fd451696d03ef2ee116", | ||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.6.0/rules_nodejs-1.6.0.tar.gz"], | ||
) | ||
|
||
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") | ||
|
||
|
||
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install") | ||
|
||
node_repositories(package_json = ["//:package.json"]) | ||
|
||
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") | ||
|
||
yarn_install( | ||
npm_install( | ||
name = "npm", | ||
package_json = "//:package.json", | ||
yarn_lock = "//:yarn.lock", | ||
package_lock_json = "//:package-lock.json", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['@vue/cli-plugin-babel/preset'] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.