This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +30
-34
lines changed Expand file tree Collapse file tree 3 files changed +30
-34
lines changed Original file line number Diff line number Diff line change 38
38
steps :
39
39
- checkout :
40
40
<< : *post_checkout
41
+
41
42
# Enforce that BUILD files are formatted. Note that this uses the version of buildifier
42
43
# from the docker image above - take care that you use the same version when you run
43
44
# buildifier locally on your change.
@@ -50,26 +51,15 @@ jobs:
50
51
- checkout :
51
52
<< : *post_checkout
52
53
53
- - restore_cache :
54
- key : *cache_key
55
-
56
54
- run : sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
57
55
58
56
# Helpful for debugging, so you can check you have the same bazel version when you need
59
57
# to reproduce a failure.
60
58
- run : bazel info release
61
59
62
- # Install the dependencies from NPM
63
- # TODO(gmagolan): Use `bazel run :install` once bootstrap issue resolved.
64
- # See https://github.com/bazelbuild/rules_nodejs/issues/275.
65
- - run : yarn
66
-
67
60
# Build and Test
68
61
- run : bazel test //...
69
62
70
- # Run the benchmark
71
- - run : node_modules/.bin/ibazel-benchmark-runner //src:devserver src/hello-world/hello-world.component.ts --url=http://localhost:5432
72
-
73
63
- store_artifacts :
74
64
path : dist/bin/src/bundle.min.js
75
65
destination : bundle.min.js
78
68
path : dist/bin/src/bundle.cs.min
79
69
destination : bundle.cs.min
80
70
71
+ benchmark :
72
+ << : *job_defaults
73
+ steps :
74
+ - checkout :
75
+ << : *post_checkout
76
+
77
+ - restore_cache :
78
+ key : *cache_key
79
+
80
+ # Run the benchmark
81
+ - run : yarn
82
+ - run : node_modules/.bin/ibazel-benchmark-runner //src:devserver src/hello-world/hello-world.component.ts --url=http://localhost:5432
83
+
81
84
# If we get this far, save the node_modules directory for use next time.
82
85
- save_cache :
83
86
key : *cache_key
@@ -90,3 +93,4 @@ workflows:
90
93
jobs :
91
94
- lint
92
95
- build
96
+ - benchmark
Original file line number Diff line number Diff line change 41
41
npm install -g @bazel/ibazel
42
42
```
43
43
44
- ## Setup
45
-
46
- Before building the app, we install packages, just as with any npm-based development workflow.
47
-
48
- ``` bash
49
- $ yarn install
50
- ```
51
-
52
- or
53
-
54
- ``` bash
55
- $ npm install
56
- ```
57
-
58
- For the time being, you need to run your locally installed ` yarn ` or ` npm ` to install dependencies
59
- as shown above. This is because we pull down the ` @bazel/typescript ` bazel dependency from npm and
60
- that dependency needs to be in place before we can build the project. We're working to
61
- resolve this bootstrapping issue. Soon you will be able to skip this step and just do your first
62
- Bazel build without needing any install step first.
63
-
64
44
## Development
65
45
66
46
Next we'll run the development server:
@@ -129,3 +109,14 @@ the entry points and modules is how routes are loaded, with production
129
109
lazy loading routes and development using a custom ` NgModuleFactoryLoader `
130
110
loader to disable lazy loading. ` enableProdMode() ` is
131
111
also called in the production entry point.
112
+
113
+ ## Npm dependencies
114
+
115
+ Having a local ` node_modules ` folder setup by ` yarn ` or ` npm ` is not
116
+ necessary when building this example with Bazel. This example makes use
117
+ of Bazel managed npm dependencies (https://github.com/bazelbuild/rules_nodejs#using-bazel-managed-dependencies )
118
+ which means Bazel will setup the npm dependencies in your ` package.json ` for you
119
+ outside of your local workspace for use in the build.
120
+
121
+ However, you may still want to run ` yarn ` or ` npm ` to manually
122
+ setup a local ` node_modules ` folder for editor and tooling support.
Original file line number Diff line number Diff line change @@ -29,9 +29,11 @@ http_archive(
29
29
)
30
30
31
31
# The @rxjs repo contains targets for building rxjs with bazel
32
- local_repository (
32
+ http_archive (
33
33
name = "rxjs" ,
34
- path = "node_modules/rxjs/src" ,
34
+ url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz" ,
35
+ strip_prefix = "package/src" ,
36
+ sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403" ,
35
37
)
36
38
37
39
####################################
@@ -44,7 +46,6 @@ rules_angular_dependencies()
44
46
load ("@build_bazel_rules_nodejs//:defs.bzl" , "node_repositories" , "yarn_install" )
45
47
46
48
node_repositories (
47
- preserve_symlinks = True ,
48
49
node_version = "10.9.0" ,
49
50
yarn_version = "1.9.2" ,
50
51
)
You can’t perform that action at this time.
0 commit comments