Rewrite of bobril-build to .Net. Mainly for speed reasons. It now replaced original JS version.
yarn global add bobril-build
bb
Github by default has limit of 60 anonymous requests per hour from one IP. So if it fails you have 2 options, wait or provide token to authenticate as yourself. First read [https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/] how to create your token. Token can have just read only rights, you don't need to select any scopes. Then you can either store it into your user profile directory in .github/token.txt file or set environment variable GITHUB_TOKEN.
By default prerelease versions are not used.
In .bbrc
file set bbVersion
to specific version you need. By setting tsVersion
you can override used TypeScript for compilation. By setting jasmineVersion
you can override Jasmine version only allowed values are "2.99" (default) and "3.3".
{
"bbVersion": "2.10.0",
"tsVersion": "5.2.2",
"jasmineVersion: "3.3"
}
By setting BBVERSION
environment variable you can define default version (including prerelease). If you will start bb2
instead of bb
, then BBVERSION
override what is in .bbrc
or package.json
.
bb stores its cache in user_home/.bbcore/tools
directory. In Docker it uses /bbcache
. You can override it be defining BBCACHEDIR
environmental variable.
docker run -it --rm -v %cd%:/project -v directory_for_persistent_cache:/bbcache -p 8080:8080 bobril/build
- Bobril-build
- Chrome
- Nodejs
- Npm
- Yarn
docker build . -t bobril/build --build-arg VERSION=x.y.z
docker tag bobril/build bobril/build:x.y.z
docker push bobril/build:x.y.z
docker history bobril/build
docker run -it --rm --entrypoint bash bobril/build
Number | Severity | Message |
---|---|---|
-1 | Warn | Local import has wrong casing |
-2 | Warn | Module import has wrong casing |
-3 | Error | Missing dependency |
-5 | Error | First parameter of b.asset must be resolved as constant string |
-6 | Error | b.sprite cannot have more than 6 parameters |
-7 | Warn | Problem with translation message |
-8 | Error | Translation message must be compile time resolvable constant string, use f instead if intended |
-9 | Error | Hint message must be compile time resolvable constant string |
-11 | Warn | Fixing local import with two slashes |
-12 | Warn | Importing module without being in package.json as dependency |
-13 | Warn | Unused dependency in package.json |
-14 | Warn | Importing obsolete module: reason |
-15 | Warn | Cannot resolve import |
-16 | Error | Syntactic Error |
-17 | Error | Invalid or unusable svg |
-18 | Error | File does not exists |
global constants are defined using "defines" object. If DEBUG
is not defined is it automatically defined as DEBUG
build-in constant which is true in interactive, test modes and fast build mode. First are expanded all defines
, than result of this expansion is input to envs
expansion. In envs
you define replacement for process.env
object. If NODE_ENV
is not defined is it automatically defined like in example below.
Content must be always JavaScript expression with specially handled build-ins DEBUG
, env
, file
. env
is virtually object with system environment variables. file
is virtually object with utf-8 content of all files where property name is file name relative to project root directory.
"defines": {
"DEBUG": "DEBUG",
"SomeConstant": "\"this is JS \"+\"expression\"",
"FileContent": "file[\"some_file_relative_to_package.json\"]"
},
"envs": {
"NODE_ENV": "DEBUG?\"development\":\"production\"",
"path": "env.Path"
}
Default is to update all dependencies to latest version defined by package.json:
{
"dependencies": "upgrade"
}
If you want just install missing dependencies:
{
"dependencies": "install"
}
Or if you want to completely disable this feature:
{
"dependencies": "disabled"
}
Build generates tsconfig.json by default. You can disable this feature by:
{
"tsconfigUpdate": false
}
By default localization is detected from existence of dependency bobril-g11n. You can override it:
{
"localize": true
}
{
"pathToTranslations": "translations/path/like/this"
}
It is relative to project. Default is "translations".
{
"buildOutputDir": "./dist"
}
{
"interactiveDumpsToDist": true
}
It checks only for existence of this interactiveDumpsToDist
key, value does not matter for now.
By default it finds all tests in project directory (it always skips node_modules
). By defining this, you can limit or add additional directories where to search.
{
"testDirectories": [ "spec" ]
}
{
"warningsAsErrors": true
}
{
"ignoreDiagnostic": [ -1, -8 ]
}
{
"plugins": {
"bb-assets-generator-plugin": {
"generateSpritesFile": true
}
}
}
{
"obsolete": "Reason why is obsolete and what to use instead"
}
Use this comment in source code with import to ignore this specific import (must be before last import in source file)
// BBIgnoreObsolete: modulea, moduleb
{
"assets": {
"original/source/path/name.ext": "distName.ext",
"node_modules/anymodule/path", "path"
}
}
{
"preserveProjectRoot": true
}
{
"imports": {
"perf_hooks": null
}
}
This allows to override imports. If value is null then import is removed (behaves like it would be empty file). If value is string then import path is replaced by this string.
Useful if your API server does not uses CORS, so proxy requests through bobril-build localhost:8080. It includes support for WebSockets connections. Url have to start with http://
or https://
.
{
"proxyUrl": "http://localhost:3001"
}
By default it will use only Chrome or Chromium to test your code. But because headless Chrome on Windows does hang with some projects you can use use Firefox on Windows by defining this:
{
"headlessBrowserStrategy": "PreferFirefoxOnWindows"
}
Watcher inside Docker cannot use OS notification of filesystem changes. So by default BB inside docker uses polling implementation with 250ms check frequency. You modify this time in milliseconds by BBWATCHER
variable, also without Docker it forces polling watcher:
set BBWATCHER=1000
set BBBROWSER=C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
Docker on Windows filesystem has limitation in creating links. To workaround this issue create environment variable BBCoreNoLinks
with not empty value so bbcore will add --no-bin-links
parameter to yarn command line.
It uses same variable like all other dotnet containers DOTNET_RUNNING_IN_CONTAINER
.
In ~/.bbcore/.bbcfg
you can define global configuration. It is JSON file with following settings.
If you want to disable Windows notifications after build/test finished, you can create this file with following content:
{ "notificationsEnabled": false }