├── .bazelversion ├── .eslintignore ├── tools └── nodejs │ ├── BUILD.bazel │ ├── index.bzl │ ├── ts_project.bzl │ ├── jest.bzl │ ├── lib.bzl │ ├── prettier.bzl │ └── api.bzl ├── .prettierignore ├── .prettierrc.json ├── packages ├── add │ ├── src │ │ ├── index.ts │ │ ├── add.ts │ │ └── add.spec.ts │ ├── package.json │ └── BUILD.bazel ├── core │ ├── src │ │ ├── index.ts │ │ ├── operation.ts │ │ └── operation.spec.ts │ ├── package.json │ └── BUILD.bazel ├── prettier-config │ ├── package.json │ ├── index.json │ └── BUILD.bazel ├── server │ ├── src │ │ ├── index.ts │ │ ├── app.spec.ts │ │ └── app.ts │ ├── package.json │ └── BUILD.bazel └── eslint-config │ ├── BUILD.bazel │ ├── package.json │ └── index.json ├── pnpm-workspace.yaml ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── jest.config.ts ├── tsconfig.eslint.json ├── .bazelignore ├── .idea ├── vcs.xml ├── .gitignore ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml ├── misc.xml └── typescript-bazel-template.iml ├── .eslintrc.js ├── .commitlintrc.yaml ├── BUILD.bazel ├── LICENSE ├── tsconfig.json ├── package.json ├── README.md ├── .pre-commit-config.yaml ├── .bazelrc ├── WORKSPACE └── .gitignore /.bazelversion: -------------------------------------------------------------------------------- 1 | 5.3.1 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | bazel-* 2 | -------------------------------------------------------------------------------- /tools/nodejs/BUILD.bazel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | bazel-* 2 | pnpm-lock.yaml 3 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@usrbinboat/prettier-config" 2 | -------------------------------------------------------------------------------- /packages/add/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Add } from "./add"; 2 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "packages/*" 3 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Operation } from "./operation"; 2 | -------------------------------------------------------------------------------- /packages/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@usrbinboat/core", 3 | "private": true, 4 | "main": "src/index.js" 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "bazelbuild.vscode-bazel", 4 | "dbaeumer.vscode-eslint", 5 | "esbenp.prettier-vscode" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "@jest/types"; 2 | 3 | const config: Config.InitialOptions = { 4 | preset: "ts-jest", 5 | }; 6 | export default config; 7 | -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true 5 | }, 6 | "include": ["packages/**/*.ts", "jest.config.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /packages/add/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@usrbinboat/add", 3 | "private": true, 4 | "main": "src/index.js", 5 | "dependencies": { 6 | "@usrbinboat/core": "workspace:*" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.bazelignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | packages/core/node_modules 3 | packages/add/node_modules 4 | packages/server/node_modules 5 | packages/eslint-config/node_modules 6 | packages/prettier-config/node_modules 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/prettier-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@usrbinboat/prettier-config", 3 | "private": true, 4 | "main": "index.json", 5 | "peerDependencies": { 6 | "prettier": ">= 2" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: "@usrbinboat", 3 | parserOptions: { 4 | project: "./tsconfig.eslint.json", 5 | tsconfigRootDir: __dirname, 6 | schema: [], 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /packages/add/src/add.ts: -------------------------------------------------------------------------------- 1 | import { Operation } from "@usrbinboat/core"; 2 | 3 | export class Add extends Operation { 4 | sym = "+"; 5 | protected exec(a: number, b: number): number { 6 | return a + b; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/server/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Add } from "@usrbinboat/add"; 2 | 3 | import { App } from "./app"; 4 | 5 | const app = App.create({ 6 | operation: new Add(), 7 | port: 8080, 8 | }); 9 | 10 | app.start(); 11 | -------------------------------------------------------------------------------- /packages/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@usrbinboat/server", 3 | "private": true, 4 | "main": "src/index.js", 5 | "dependencies": { 6 | "@usrbinboat/add": "workspace:*", 7 | "@usrbinboat/core": "workspace:*" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.commitlintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: ["@commitlint/config-angular"] 2 | rules: 3 | scope-enum: 4 | - 2 5 | - "always" 6 | - # libs 7 | - "core" 8 | - "add" 9 | - "sub" 10 | - "eslint" 11 | - "prettier" 12 | # apps 13 | - "server" 14 | -------------------------------------------------------------------------------- /packages/prettier-config/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "semi": true, 4 | "quoteProps": "consistent", 5 | "overrides": [ 6 | { 7 | "files": ["*.json", "*.yaml", "*.yml", "*.md"], 8 | "options": { 9 | "tabWidth": 2 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /packages/add/src/add.spec.ts: -------------------------------------------------------------------------------- 1 | import { Add } from "./add"; 2 | 3 | describe("add", () => { 4 | it("adds two numbers", () => { 5 | expect.assertions(1); 6 | 7 | const add = new Add(); 8 | const str = add.stringify(1, 2); 9 | 10 | expect(str).toBe("1 + 2 = 3"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/core/src/operation.ts: -------------------------------------------------------------------------------- 1 | export abstract class Operation { 2 | protected sym = "noop"; 3 | 4 | protected abstract exec(a: number, b: number): number; 5 | 6 | stringify(a: number, b: number) { 7 | const res = this.exec(a, b); 8 | return `${a} ${this.sym} ${b} = ${res}`; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/typescript-bazel-template.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/eslint-config/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools/nodejs:index.bzl", "prettier") 2 | load("@aspect_rules_js//npm:defs.bzl", "npm_package") 3 | load("@npm//:defs.bzl", "npm_link_all_packages") 4 | 5 | npm_link_all_packages(name = "node_modules") 6 | 7 | npm_package( 8 | name = "eslint-config", 9 | srcs = [ 10 | "index.json", 11 | "package.json", 12 | ], 13 | visibility = ["//visibility:public"], 14 | ) 15 | 16 | prettier() 17 | -------------------------------------------------------------------------------- /packages/prettier-config/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools/nodejs:index.bzl", "prettier") 2 | load("@aspect_rules_js//npm:defs.bzl", "npm_package") 3 | load("@npm//:defs.bzl", "npm_link_all_packages") 4 | 5 | npm_link_all_packages(name = "node_modules") 6 | 7 | npm_package( 8 | name = "prettier-config", 9 | srcs = [ 10 | "index.json", 11 | "package.json", 12 | ], 13 | visibility = ["//visibility:public"], 14 | ) 15 | 16 | prettier() 17 | -------------------------------------------------------------------------------- /packages/core/src/operation.spec.ts: -------------------------------------------------------------------------------- 1 | import { Operation } from "./operation"; 2 | 3 | describe("operation", () => { 4 | it("prints the operation output", () => { 5 | expect.assertions(1); 6 | 7 | const op = new (class extends Operation { 8 | exec() { 9 | return 0; 10 | } 11 | })(); 12 | 13 | const msg = op.stringify(1, 2); 14 | 15 | expect(msg).toBe(`1 noop 2 = 0`); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /tools/nodejs/index.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | custom nodejs rules 3 | """ 4 | 5 | load("//tools/nodejs:ts_project.bzl", _ts_project = "ts_project") 6 | load("//tools/nodejs:jest.bzl", _jest = "jest", _jest_test = "jest_test") 7 | load("//tools/nodejs:prettier.bzl", _prettier = "prettier") 8 | load("//tools/nodejs:api.bzl", _api = "api") 9 | load("//tools/nodejs:lib.bzl", _lib = "lib") 10 | 11 | ts_project = _ts_project 12 | jest = _jest 13 | jest_test = _jest_test 14 | prettier = _prettier 15 | api = _api 16 | lib = _lib 17 | -------------------------------------------------------------------------------- /packages/eslint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@usrbinboat/eslint-config", 3 | "private": true, 4 | "main": "index.json", 5 | "peerDependencies": { 6 | "@typescript-eslint/eslint-plugin": ">= 4", 7 | "eslint": ">= 7", 8 | "eslint-config-prettier": ">= 8", 9 | "eslint-import-resolver-typescript": ">= 2", 10 | "eslint-plugin-import": ">= 2", 11 | "eslint-plugin-jest": ">= 24", 12 | "eslint-plugin-jest-formatting": ">= 3", 13 | "eslint-plugin-prettier": ">= 4", 14 | "prettier": ">= 2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "attach", 7 | "name": "Attach nodejs_binary", 8 | "internalConsoleOptions": "neverOpen", 9 | "resolveSourceMapLocations": null, 10 | "sourceMapPathOverrides": { 11 | "../*": "${workspaceRoot}/*", 12 | "../../*": "${workspaceRoot}/*", 13 | "../../../*": "${workspaceRoot}/*", 14 | "../../../../*": "${workspaceRoot}/*", 15 | "../../../../../*": "${workspaceRoot}/*" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/server/src/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { Operation } from "@usrbinboat/core"; 2 | import request from "supertest"; 3 | 4 | import { App } from "./app"; 5 | 6 | describe("app", () => { 7 | const operation = new (class extends Operation { 8 | exec() { 9 | return 0; 10 | } 11 | })(); 12 | const app = App.create({ operation }).app; 13 | 14 | describe("get /", () => { 15 | it("returns 200", async () => { 16 | expect.assertions(1); 17 | 18 | const res = await request(app).get("/"); 19 | 20 | expect(res.statusCode).toBe(200); 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /tools/nodejs/ts_project.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | ts_project macros 3 | """ 4 | 5 | load("@aspect_rules_ts//ts:defs.bzl", _ts_project = "ts_project") 6 | 7 | def ts_project(name = "tsconfig", srcs = None, deps = [], data = [], **kwargs): 8 | srcs = srcs if srcs else native.glob( 9 | include = ["**/*.ts"], 10 | exclude = ["**/*.spec.ts", "node_modules/**/*"], 11 | ) 12 | _ts_project( 13 | name = name, 14 | srcs = srcs, 15 | deps = deps + ["//:node_modules/@types/node"], 16 | data = data, 17 | source_map = True, 18 | declaration = True, 19 | declaration_map = True, 20 | tsconfig = "//:tsconfig", 21 | **kwargs 22 | ) 23 | -------------------------------------------------------------------------------- /tools/nodejs/jest.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | jest macros 3 | """ 4 | 5 | load("@npm//:jest-cli/package_json.bzl", "bin") 6 | load("@aspect_rules_jest//jest:defs.bzl", _jest_test = "jest_test") 7 | 8 | _DEPS = [ 9 | "//:node_modules/c8", 10 | ] 11 | 12 | def jest_test(data, config = "//:jest_config", **kwargs): 13 | _jest_test( 14 | config = config, 15 | data = _DEPS + data, 16 | **kwargs 17 | ) 18 | 19 | def jest(name, data, jest_config = "//:jest_config", **kwargs): 20 | bin.jest_binary( 21 | name = name, 22 | data = _DEPS + data + [jest_config], 23 | args = [ 24 | "--no-cache", 25 | "--no-watchman", 26 | "--ci", 27 | "--colors", 28 | "--config $(rootpath %s)" % jest_config, 29 | ], 30 | **kwargs 31 | ) 32 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll": true, 4 | "source.organizeImports": true, 5 | "source.addMissingImports": true 6 | }, 7 | "eslint.validate": ["javascript", "typescript"], 8 | "[typescript]": { 9 | "editor.defaultFormatter": "dbaeumer.vscode-eslint" 10 | }, 11 | "typescript.updateImportsOnFileMove.enabled": "always", 12 | "[javascript]": { 13 | "editor.defaultFormatter": "dbaeumer.vscode-eslint" 14 | }, 15 | "javascript.updateImportsOnFileMove.enabled": "always", 16 | "[json]": { 17 | "editor.defaultFormatter": "esbenp.prettier-vscode" 18 | }, 19 | "[yaml]": { 20 | "editor.defaultFormatter": "esbenp.prettier-vscode" 21 | }, 22 | "[jsonc]": { 23 | "editor.defaultFormatter": "esbenp.prettier-vscode" 24 | }, 25 | "git.autoRepositoryDetection": false 26 | } 27 | -------------------------------------------------------------------------------- /BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@npm//:defs.bzl", "npm_link_all_packages") 2 | load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") 3 | load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project") 4 | 5 | package(default_visibility = ["//visibility:public"]) 6 | 7 | npm_link_all_packages(name = "node_modules") 8 | 9 | exports_files([ 10 | "tsconfig.json", 11 | "tsconfig.eslint.json", 12 | ".eslintrc.js", 13 | ".eslintignore", 14 | ]) 15 | 16 | ts_config( 17 | name = "tsconfig", 18 | src = "tsconfig.json", 19 | ) 20 | 21 | copy_to_bin( 22 | name = "prettierrc", 23 | srcs = [".prettierrc.json"], 24 | ) 25 | 26 | copy_to_bin( 27 | name = "prettierignore", 28 | srcs = [".prettierignore"], 29 | ) 30 | 31 | ts_project( 32 | name = "jest_config", 33 | srcs = ["jest.config.ts"], 34 | tsconfig = {}, 35 | deps = [ 36 | "//:node_modules/@jest/types", 37 | ], 38 | ) 39 | -------------------------------------------------------------------------------- /tools/nodejs/lib.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | lib macros 3 | """ 4 | 5 | load("@aspect_rules_js//js:defs.bzl", "js_library") 6 | load("@aspect_rules_js//npm:defs.bzl", "npm_package") 7 | 8 | def lib(main = "src/index.js", srcs = [], **kwargs): 9 | name = native.package_name().split("/")[-1] 10 | package_name = "@usrbinboat/%s" % name 11 | 12 | native.genrule( 13 | name = "manifest", 14 | outs = ["package.json"], 15 | cmd = """ 16 | cat << EOF > $@ 17 | { 18 | "name": "%s", 19 | "main": "%s" 20 | } 21 | EOF 22 | """ % (package_name, main), 23 | ) 24 | 25 | js_library( 26 | name = "lib", 27 | srcs = srcs + [":manifest"], 28 | visibility = ["//visibility:public"], 29 | **kwargs 30 | ) 31 | 32 | npm_package( 33 | name = name, 34 | srcs = [":lib"], 35 | package = package_name, 36 | visibility = ["//visibility:public"], 37 | ) 38 | -------------------------------------------------------------------------------- /packages/server/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools/nodejs:index.bzl", "api", "prettier", "ts_project") 2 | load("@aspect_rules_jest//jest:defs.bzl", "jest_test") 3 | load("@npm//:defs.bzl", "npm_link_all_packages") 4 | 5 | npm_link_all_packages(name = "node_modules") 6 | 7 | DEPS = [ 8 | ":node_modules/@usrbinboat/add", 9 | ":node_modules/@usrbinboat/core", 10 | "//:node_modules/express", 11 | "//:node_modules/@types/express", 12 | ] 13 | 14 | api(deps = DEPS) 15 | 16 | ts_project( 17 | name = "tsconfig_test", 18 | srcs = glob( 19 | include = ["**/*.spec.ts"], 20 | ), 21 | deps = DEPS + [ 22 | ":tsconfig", 23 | "//:node_modules/@types/supertest", 24 | "//:node_modules/@types/jest", 25 | "//:node_modules/supertest", 26 | "//:node_modules/jest", 27 | "//:node_modules/ts-jest", 28 | ], 29 | ) 30 | 31 | jest_test( 32 | name = "unit", 33 | config = "//:jest_config", 34 | data = [":tsconfig_test"], 35 | ) 36 | 37 | prettier() 38 | -------------------------------------------------------------------------------- /packages/core/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools/nodejs:index.bzl", "prettier", "ts_project") 2 | load("@aspect_rules_js//npm:defs.bzl", "npm_package") 3 | load("@npm//:defs.bzl", "npm_link_all_packages") 4 | load("@aspect_rules_jest//jest:defs.bzl", "jest_test") 5 | 6 | npm_link_all_packages(name = "node_modules") 7 | 8 | ts_project( 9 | srcs = glob( 10 | include = ["src/**/*.ts"], 11 | exclude = ["src/**/*.spec.ts"], 12 | ), 13 | ) 14 | 15 | npm_package( 16 | name = "core", 17 | srcs = [ 18 | "package.json", 19 | ":tsconfig", 20 | ], 21 | visibility = ["//visibility:public"], 22 | ) 23 | 24 | ts_project( 25 | name = "tsconfig_test", 26 | srcs = glob(["**/*.spec.ts"]), 27 | deps = [ 28 | ":tsconfig", 29 | "//:node_modules/@types/jest", 30 | "//:node_modules/jest", 31 | "//:node_modules/ts-jest", 32 | ], 33 | ) 34 | 35 | jest_test( 36 | name = "unit", 37 | config = "//:jest_config", 38 | data = [":tsconfig_test"], 39 | ) 40 | 41 | prettier() 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Pedro Barco 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/add/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools/nodejs:index.bzl", "prettier", "ts_project") 2 | load("@aspect_rules_jest//jest:defs.bzl", "jest_test") 3 | load("@aspect_rules_js//npm:defs.bzl", "npm_package") 4 | load("@npm//:defs.bzl", "npm_link_all_packages") 5 | 6 | npm_link_all_packages(name = "node_modules") 7 | 8 | DEPS = [ 9 | ":node_modules/@usrbinboat/core", 10 | ] 11 | 12 | ts_project( 13 | srcs = glob( 14 | include = ["src/**/*.ts"], 15 | exclude = ["src/**/*.spec.ts"], 16 | ), 17 | deps = DEPS, 18 | ) 19 | 20 | npm_package( 21 | name = "add", 22 | srcs = [ 23 | "package.json", 24 | ":tsconfig", 25 | ], 26 | visibility = ["//visibility:public"], 27 | ) 28 | 29 | ts_project( 30 | name = "tsconfig_test", 31 | srcs = glob(["**/*.spec.ts"]), 32 | deps = DEPS + [ 33 | ":tsconfig", 34 | "//:node_modules/@types/jest", 35 | "//:node_modules/jest", 36 | "//:node_modules/ts-jest", 37 | ], 38 | ) 39 | 40 | jest_test( 41 | name = "unit", 42 | config = "//:jest_config", 43 | data = [":tsconfig_test"], 44 | ) 45 | 46 | prettier() 47 | -------------------------------------------------------------------------------- /tools/nodejs/prettier.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | prettier macros 3 | """ 4 | 5 | load("@npm//:prettier/package_json.bzl", "bin") 6 | 7 | def prettier( 8 | srcs = None, 9 | deps = [ 10 | "//:node_modules/@usrbinboat/prettier-config", 11 | "//:node_modules/c8", 12 | ], 13 | config = "//:prettierrc", 14 | ignore = "//:prettierignore"): 15 | srcs = srcs if srcs else native.glob( 16 | include = [ 17 | "**/*.js", 18 | "**/*.ts", 19 | "**/*.graphql", 20 | "**/*.json", 21 | "**/*.yaml", 22 | "**/*.adoc", 23 | "**/*.md", 24 | ], 25 | exclude = ["node_modules/**/*"], 26 | ) 27 | 28 | bin.prettier_test( 29 | name = "prettier", 30 | data = [ 31 | config, 32 | ignore, 33 | ] + srcs + deps, 34 | args = [ 35 | "--config $(rootpath %s)" % config, 36 | "--ignore-path $(rootpath %s)" % ignore, 37 | "--check", 38 | ] + [ 39 | "$(rootpath %s)" % src 40 | for src in srcs 41 | ], 42 | tags = ["lint"], 43 | ) 44 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "emitDecoratorMetadata": true, 5 | "target": "es2019", 6 | "module": "commonjs", 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "sourceMap": true, 11 | "skipLibCheck": true, 12 | "declaration": true, 13 | "declarationMap": true, 14 | "baseUrl": ".", 15 | "paths": { 16 | "@usrbinboat/*": ["packages/*", "packages/*/src"] 17 | }, 18 | "rootDirs": [ 19 | ".", 20 | "bazel-out/k8-fastbuild/bin", 21 | "bazel-out/darwin-fastbuild/bin", 22 | "bazel-out/darwin_arm64-fastbuild/bin", 23 | "bazel-out/x64_windows-fastbuild/bin", 24 | "bazel-out/k8-dbg/bin", 25 | "bazel-out/darwin-dbg/bin", 26 | "bazel-out/darwin_arm64-dbg/bin", 27 | "bazel-out/x64_windows-dbg/bin", 28 | "bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin", 29 | "bazel-out/darwin-fastbuild-ST-4a519fd6d3e4/bin", 30 | "bazel-out/darwin_arm64-fastbuild-ST-4a519fd6d3e4/bin", 31 | "bazel-out/x64_windows-fastbuild-ST-4a519fd6d3e4/bin" 32 | ] 33 | }, 34 | "exclude": ["bazel-*"] 35 | } 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bazel-typescript", 3 | "version": "1.0.0", 4 | "private": true, 5 | "author": "Pedro Barco ", 6 | "devDependencies": { 7 | "@bazel/ibazel": "^0.16.2", 8 | "@graphql-eslint/eslint-plugin": "^3.12.0", 9 | "@jest/types": "^29.2.1", 10 | "@types/express": "^4.17.14", 11 | "@types/jest": "^29.2.0", 12 | "@types/node": "^18.11.4", 13 | "@types/supertest": "^2.0.12", 14 | "@typescript-eslint/eslint-plugin": "^5.40.1", 15 | "@typescript-eslint/parser": "^5.40.1", 16 | "@usrbinboat/eslint-config": "workspace:*", 17 | "@usrbinboat/prettier-config": "workspace:*", 18 | "c8": "^7.12.0", 19 | "eslint": "^8.26.0", 20 | "eslint-config-prettier": "^8.5.0", 21 | "eslint-import-resolver-typescript": "^3.5.2", 22 | "eslint-plugin-import": "^2.26.0", 23 | "eslint-plugin-jest": "^27.1.3", 24 | "eslint-plugin-jest-formatting": "^3.1.0", 25 | "eslint-plugin-prettier": "^4.2.1", 26 | "eslint-plugin-simple-import-sort": "^8.0.0", 27 | "eslint-plugin-sonarjs": "^0.16.0", 28 | "eslint-plugin-tsdoc": "^0.2.17", 29 | "jest": "^29.2.1", 30 | "jest-cli": "^29.2.1", 31 | "prettier": "^2.7.1", 32 | "supertest": "^6.3.0", 33 | "ts-jest": "^29.0.3", 34 | "ts-node": "^10.9.1", 35 | "tslib": "^2.4.0", 36 | "typescript": "^4.8.4" 37 | }, 38 | "dependencies": { 39 | "express": "^4.18.2", 40 | "graphql": "^16.6.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/server/src/app.ts: -------------------------------------------------------------------------------- 1 | import { Operation } from "@usrbinboat/core"; 2 | import type { Application, Request, Response } from "express"; 3 | import express from "express"; 4 | 5 | export interface AppProps { 6 | operation: Operation; 7 | port: number; 8 | } 9 | 10 | type AppOptions = Partial & { 11 | operation: Operation; 12 | }; 13 | 14 | export class App { 15 | public readonly app: Application; 16 | private readonly port: number; 17 | 18 | private constructor(props: AppProps) { 19 | this.app = express(); 20 | this.port = props.port; 21 | this.routes(props.operation); 22 | } 23 | 24 | private routes(operation: Operation) { 25 | this.app.get("/", (_: Request, res: Response) => { 26 | const num1 = Math.floor(Math.random() * 10); 27 | const num2 = Math.floor(Math.random() * 10); 28 | if (operation instanceof Operation) { 29 | const str = operation.stringify(num1, num2); 30 | res.send(str); 31 | } 32 | }); 33 | } 34 | 35 | public start() { 36 | this.app.listen(this.port, () => { 37 | console.log(`server started at http://localhost:${this.port}`); 38 | }); 39 | } 40 | 41 | static create(options: AppOptions): App { 42 | const props: AppProps = { 43 | ...options, 44 | port: options.port || 8080, 45 | }; 46 | 47 | return new App(props); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 |

Typescript + Bazel Template

7 |

8 | Template monorepo for building typescript apps with Bazel 9 |

10 |
11 | 12 | # Usage 13 | 14 | Setup 15 | 16 | - `bazel run -- @pnpm//:pnpm -C $PWD i` (Install required software and sets up project) 17 | - `bazel run -- @pnpm//:pnpm -C $PWD outdated` (Check for outdated dependencies) 18 | 19 | Development 20 | 21 | - `bazel build //...` (Build all packages) 22 | - `bazel test //...` (Test all packages) 23 | - `bazel run //packages/server` (Start development backend service) 24 | - `bazel run //packages/server:image` (Build server image) 25 | - `docker run --rm -i -p 8080:8080 bazel/packages/server:image` (Run container image) 26 | - `bazel test //packages/` (Run tests) 27 | 28 | Deployment (TBD) 29 | 30 | # Codebase 31 | 32 | **Services** 33 | 34 | - [`server`](packages/server) **Typescript**, web application 35 | 36 | **Libraries** 37 | 38 | - [`@usrbinboat/core`](packages/core) **Typescript**, core operation class 39 | - [`@usrbinboat/add`](packages/add) **Typescript**, add operation class 40 | 41 | **Miscellaneous** 42 | 43 | - [`@usrbinboat/eslint-config`](packages/eslint-config), tooling and configurations for eslint 44 | - [`@usrbinboat/prettier-config`](packages/prettier-config), tooling and configurations for prettier 45 | -------------------------------------------------------------------------------- /packages/eslint-config/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "jest": true, 5 | "es2022": true 6 | }, 7 | "plugins": ["simple-import-sort"], 8 | "extends": [ 9 | "eslint:recommended", 10 | "plugin:import/recommended", 11 | "plugin:sonarjs/recommended", 12 | "plugin:prettier/recommended" 13 | ], 14 | "rules": { 15 | "simple-import-sort/imports": "error", 16 | "simple-import-sort/exports": "error", 17 | "import/first": "error", 18 | "import/newline-after-import": "error", 19 | "import/no-duplicates": "error" 20 | }, 21 | "overrides": [ 22 | { 23 | "files": ["*.ts"], 24 | "parser": "@typescript-eslint/parser", 25 | "plugins": ["eslint-plugin-tsdoc"], 26 | "extends": [ 27 | "plugin:@typescript-eslint/recommended", 28 | "plugin:import/typescript", 29 | "plugin:@typescript-eslint/recommended-requiring-type-checking" 30 | ], 31 | "rules": { 32 | "tsdoc/syntax": "warn" 33 | } 34 | }, 35 | { 36 | "files": ["*.spec.ts"], 37 | "extends": [ 38 | "plugin:jest/all", 39 | "plugin:jest/style", 40 | "plugin:jest-formatting/strict" 41 | ] 42 | }, 43 | { 44 | "files": ["*.graphql"], 45 | "extends": ["plugin:@graphql-eslint/schema-recommended"] 46 | } 47 | ], 48 | "settings": { 49 | "jsdoc": { 50 | "mode": "typescript" 51 | }, 52 | "import/parsers": { 53 | "@typescript-eslint/parser": [".ts", ".tsx"] 54 | }, 55 | "import/resolver": { 56 | "typescript": {} 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | default_stages: [commit] 2 | 3 | repos: 4 | - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook 5 | rev: v8.0.0 6 | hooks: 7 | - id: commitlint 8 | stages: [commit-msg] 9 | additional_dependencies: ["@commitlint/config-angular"] 10 | - repo: https://github.com/pre-commit/pre-commit-hooks 11 | rev: v4.2.0 12 | hooks: 13 | - id: check-yaml 14 | - id: check-json 15 | - repo: https://github.com/hadolint/hadolint 16 | rev: v2.8.0 17 | hooks: 18 | - id: hadolint-docker 19 | - repo: https://github.com/pre-commit/mirrors-eslint 20 | rev: v8.14.0 21 | hooks: 22 | - id: eslint 23 | files: \.([jt]s|graphql)$ 24 | types: [file] 25 | additional_dependencies: 26 | - "@typescript-eslint/eslint-plugin@^5.20.0" 27 | - "@typescript-eslint/parser@^5.20.0" 28 | - "eslint@^8.14.0" 29 | - "eslint-config-prettier@^8.5.0" 30 | - "eslint-plugin-import@^2.26.0" 31 | - "eslint-plugin-jest@^26.1.5" 32 | - "eslint-plugin-jest-formatting@^3.1.0" 33 | - "eslint-plugin-prettier@^4.0.0" 34 | - "eslint-plugin-simple-import-sort@^7.0.0" 35 | - "eslint-plugin-sonarjs@^0.13.0" 36 | - "eslint-plugin-tsdoc@^0.2.16" 37 | - "jest@^27.5.1" 38 | - "prettier@^2.6.2" 39 | - repo: https://github.com/pre-commit/mirrors-prettier 40 | rev: v2.6.2 41 | hooks: 42 | - id: prettier 43 | - repo: https://github.com/keith/pre-commit-buildifier 44 | rev: 5.1.0.1 45 | hooks: 46 | - id: buildifier 47 | - id: buildifier-lint 48 | -------------------------------------------------------------------------------- /tools/nodejs/api.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | api macros 3 | """ 4 | 5 | load("@io_bazel_rules_docker//container:container.bzl", "container_image") 6 | load("@io_bazel_rules_docker//container:layer.bzl", "container_layer") 7 | load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_image_layer") 8 | load("//tools/nodejs:ts_project.bzl", "ts_project") 9 | 10 | def api( 11 | name = None, 12 | srcs = None, 13 | data = None, 14 | deps = []): 15 | """Builds an API project (ts_project + nodejs_image) 16 | 17 | Args: 18 | name: by convention, every public macro needs a "name" argument (even if it doesn't use it) 19 | srcs: source files to build the typescript project 20 | data: files needed at runtime by binaries or tests that transitively 21 | depend on this target. 22 | deps: list of labels of other rules that produce TypeScript typings. 23 | """ 24 | package_name = native.package_name() 25 | name = package_name.split("/")[-1] 26 | data = data if data else native.glob(["**/*.graphql", ".env*"]) 27 | 28 | ts_project( 29 | srcs = srcs, 30 | data = data, 31 | deps = deps, 32 | ) 33 | 34 | js_binary( 35 | name = name, 36 | data = [":tsconfig"], 37 | entry_point = "src/index.js", 38 | chdir = native.package_name(), 39 | ) 40 | 41 | js_binary( 42 | name = "bin", 43 | data = [":tsconfig"], 44 | entry_point = "src/index.js", 45 | env = { 46 | "NODE_ENV": "production", 47 | }, 48 | visibility = [":__subpackages__"], 49 | ) 50 | 51 | js_image_layer( 52 | name = "layers", 53 | binary = ":bin", 54 | root = "/app", 55 | tags = ["no-remote-exec"], 56 | ) 57 | 58 | native.filegroup( 59 | name = "app_tar", 60 | srcs = [":layers"], 61 | output_group = "app", 62 | ) 63 | 64 | native.filegroup( 65 | name = "node_modules_tar", 66 | srcs = [":layers"], 67 | output_group = "node_modules", 68 | ) 69 | 70 | container_layer( 71 | name = "app_layer", 72 | tars = [":app_tar"], 73 | ) 74 | 75 | container_layer( 76 | name = "node_modules_layer", 77 | tars = ["node_modules_tar"], 78 | ) 79 | 80 | container_image( 81 | name = "image", 82 | base = "@debian_amd64//image", 83 | cmd = ["/app/%s/bin" % package_name], 84 | entrypoint = ["bash"], 85 | layers = [ 86 | ":app_layer", 87 | ":node_modules_layer", 88 | ], 89 | ) 90 | -------------------------------------------------------------------------------- /.bazelrc: -------------------------------------------------------------------------------- 1 | # always use remote jdk 2 | build --java_runtime_version=remotejdk_11 3 | 4 | # Specifies desired output mode for running tests. 5 | # Valid values are 6 | # 'summary' to output only test status summary 7 | # 'errors' to also print test logs for failed tests 8 | # 'all' to print logs for all tests 9 | # 'streamed' to output logs for all tests in real time 10 | # (this will force tests to be executed locally one at a time regardless of --test_strategy value). 11 | test --test_output=errors 12 | 13 | # Support for debugging NodeJS tests 14 | # Add the Bazel option `--config=debug` to enable this 15 | # --test_output=streamed 16 | # Stream stdout/stderr output from each test in real-time. 17 | # See https://docs.bazel.build/versions/master/user-manual.html#flag--test_output for more details. 18 | # --test_strategy=exclusive 19 | # Run one test at a time. 20 | # --test_timeout=9999 21 | # Prevent long running tests from timing out 22 | # See https://docs.bazel.build/versions/master/user-manual.html#flag--test_timeout for more details. 23 | # --nocache_test_results 24 | # Always run tests 25 | # --node_options=--inspect-brk 26 | # Pass the --inspect-brk option to all tests which enables the node inspector agent. 27 | # See https://nodejs.org/de/docs/guides/debugging-getting-started/#command-line-options for more details. 28 | # --define=VERBOSE_LOGS=1 29 | # Rules will output verbose logs if the VERBOSE_LOGS environment variable is set. `VERBOSE_LOGS` will be passed to 30 | # `nodejs_binary` and `nodejs_test` via the default value of the `default_env_vars` attribute of those rules. 31 | # --compilation_mode=dbg 32 | # Rules may change their build outputs if the compilation mode is set to dbg. For example, 33 | # mininfiers such as terser may make their output more human readable when this is set. Rules will pass `COMPILATION_MODE` 34 | # to `nodejs_binary` executables via the actions.run env attribute. 35 | # See https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode for more details. 36 | test:debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results --define=VERBOSE_LOGS=1 37 | # Use bazel run with `--config=debug` to turn on the NodeJS inspector agent. 38 | # The node process will break before user code starts and wait for the debugger 39 | # to connect. 40 | run:debug --define=VERBOSE_LOGS=1 -- --node_options=--inspect-brk 41 | # The following option will change the build output of certain rules such as 42 | # terser and may not be desirable in all cases 43 | build:debug --compilation_mode=dbg 44 | 45 | # When running `bazel coverage` --instrument_test_targets needs to be set in 46 | # order to collect coverage information from test targets 47 | coverage --instrument_test_targets 48 | 49 | # Load any settings specific to the current user. 50 | # user.bazelrc should appear in .gitignore so that settings are not shared with 51 | # team members 52 | # This needs to be last statement in this config, as the user configuration 53 | # should be able to overwrite flags from this file. 54 | # See https://docs.bazel.build/versions/master/best-practices.html#bazelrc 55 | # (Note that we use .bazelrc.user so the file appears next to .bazelrc in 56 | # directory listing, rather than user.bazelrc as suggested in the Bazel docs) 57 | try-import %workspace%/.bazelrc.user 58 | -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace( 2 | name = "typescript-bazel-template", 3 | ) 4 | 5 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 6 | 7 | RULES_JS_TAG = "1.20.1" 8 | 9 | RULES_JS_SHA = "1aa0ab76d1f9520bb8993e2d84f82da2a9c87da1e6e8d121dbb4c857a292c2cd" 10 | 11 | RULES_TS_TAG = "1.3.0" 12 | 13 | RULES_TS_SHA = "db77d904284d21121ae63dbaaadfd8c75ff6d21ad229f92038b415c1ad5019cc" 14 | 15 | RULES_JEST_TAG = "0.16.1" 16 | 17 | RULES_JEST_SHA = "fa103b278137738ef08fd23d3c8c9157897a7159af2aa22714bc71680da58583" 18 | 19 | RULES_DOCKER_TAG = "0.25.0" 20 | 21 | RULES_DOCKER_SHA = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf" 22 | 23 | http_archive( 24 | name = "aspect_rules_js", 25 | sha256 = RULES_JS_SHA, 26 | strip_prefix = "rules_js-%s" % RULES_JS_TAG, 27 | url = "https://github.com/aspect-build/rules_js/archive/refs/tags/v%s.tar.gz" % RULES_JS_TAG, 28 | ) 29 | 30 | http_archive( 31 | name = "aspect_rules_ts", 32 | sha256 = RULES_TS_SHA, 33 | strip_prefix = "rules_ts-%s" % RULES_TS_TAG, 34 | url = "https://github.com/aspect-build/rules_ts/archive/refs/tags/v%s.tar.gz" % RULES_TS_TAG, 35 | ) 36 | 37 | http_archive( 38 | name = "aspect_rules_jest", 39 | sha256 = RULES_JEST_SHA, 40 | strip_prefix = "rules_jest-%s" % RULES_JEST_TAG, 41 | url = "https://github.com/aspect-build/rules_jest/archive/refs/tags/v%s.tar.gz" % RULES_JEST_TAG, 42 | ) 43 | 44 | http_archive( 45 | name = "io_bazel_rules_docker", 46 | sha256 = RULES_DOCKER_SHA, 47 | url = "https://github.com/bazelbuild/rules_docker/releases/download/v%s/rules_docker-v%s.tar.gz" % (RULES_DOCKER_TAG, RULES_DOCKER_TAG), 48 | ) 49 | 50 | load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") 51 | 52 | rules_js_dependencies() 53 | 54 | load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies", TS_LATEST_VERSION = "LATEST_VERSION") 55 | 56 | rules_ts_dependencies(ts_version = TS_LATEST_VERSION) 57 | 58 | load("@aspect_rules_jest//jest:dependencies.bzl", "rules_jest_dependencies") 59 | 60 | rules_jest_dependencies() 61 | 62 | load("@aspect_rules_jest//jest:repositories.bzl", "jest_repositories", JEST_LATEST_VERSION = "LATEST_VERSION") 63 | 64 | jest_repositories( 65 | name = "jest", 66 | jest_version = JEST_LATEST_VERSION, 67 | ) 68 | 69 | load("@jest//:npm_repositories.bzl", jest_npm_repositories = "npm_repositories") 70 | 71 | jest_npm_repositories() 72 | 73 | load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") 74 | 75 | nodejs_register_toolchains( 76 | name = "nodejs", 77 | node_version = DEFAULT_NODE_VERSION, 78 | ) 79 | 80 | load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock") 81 | 82 | npm_translate_lock( 83 | name = "npm", 84 | pnpm_lock = "//:pnpm-lock.yaml", 85 | verify_node_modules_ignored = "//:.bazelignore", 86 | ) 87 | 88 | load("@npm//:repositories.bzl", "npm_repositories") 89 | 90 | npm_repositories() 91 | 92 | load("@io_bazel_rules_docker//repositories:repositories.bzl", rules_docker_repositories = "repositories") 93 | 94 | rules_docker_repositories() 95 | 96 | load("@io_bazel_rules_docker//repositories:deps.bzl", rules_docker_deps = "deps") 97 | 98 | rules_docker_deps() 99 | 100 | load("@io_bazel_rules_docker//container:container.bzl", "container_pull") 101 | 102 | container_pull( 103 | name = "debian_arm64", 104 | architecture = "arm64", 105 | digest = "sha256:bd276cb1059f6502e342d3052a4c2767f2b3a0196508f5c2c34ce6da4a15b104", 106 | registry = "docker.io", 107 | repository = "debian", 108 | ) 109 | 110 | container_pull( 111 | name = "debian_amd64", 112 | architecture = "amd64", 113 | digest = "sha256:9a67b70d0ba1d7c7690f917eedd8d24974dd8fd493205368b1e555a90c954208", 114 | registry = "docker.io", 115 | repository = "debian", 116 | ) 117 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 3 | 4 | # User-specific stuff 5 | .idea/**/workspace.xml 6 | .idea/**/tasks.xml 7 | .idea/**/usage.statistics.xml 8 | .idea/**/dictionaries 9 | .idea/**/shelf 10 | 11 | # AWS User-specific 12 | .idea/**/aws.xml 13 | 14 | # Generated files 15 | .idea/**/contentModel.xml 16 | 17 | # Sensitive or high-churn files 18 | .idea/**/dataSources/ 19 | .idea/**/dataSources.ids 20 | .idea/**/dataSources.local.xml 21 | .idea/**/sqlDataSources.xml 22 | .idea/**/dynamic.xml 23 | .idea/**/uiDesigner.xml 24 | .idea/**/dbnavigator.xml 25 | 26 | # Gradle 27 | .idea/**/gradle.xml 28 | .idea/**/libraries 29 | 30 | # CMake 31 | cmake-build-*/ 32 | 33 | # Mongo Explorer plugin 34 | .idea/**/mongoSettings.xml 35 | 36 | # File-based project format 37 | *.iws 38 | 39 | # IntelliJ 40 | out/ 41 | 42 | # mpeltonen/sbt-idea plugin 43 | .idea_modules/ 44 | 45 | # JIRA plugin 46 | atlassian-ide-plugin.xml 47 | 48 | # Cursive Clojure plugin 49 | .idea/replstate.xml 50 | 51 | # SonarLint plugin 52 | .idea/sonarlint/ 53 | 54 | # Crashlytics plugin (for Android Studio and IntelliJ) 55 | com_crashlytics_export_strings.xml 56 | crashlytics.properties 57 | crashlytics-build.properties 58 | fabric.properties 59 | 60 | # Editor-based Rest Client 61 | .idea/httpRequests 62 | 63 | # Android studio 3.1+ serialized cache file 64 | .idea/caches/build_file_checksums.ser 65 | 66 | .vscode/* 67 | !.vscode/settings.json 68 | !.vscode/tasks.json 69 | !.vscode/launch.json 70 | !.vscode/extensions.json 71 | !.vscode/*.code-snippets 72 | 73 | # Local History for Visual Studio Code 74 | .history/ 75 | 76 | # Built Visual Studio Code Extensions 77 | *.vsix 78 | 79 | # Logs 80 | logs 81 | *.log 82 | npm-debug.log* 83 | yarn-debug.log* 84 | yarn-error.log* 85 | lerna-debug.log* 86 | .pnpm-debug.log* 87 | 88 | # Diagnostic reports (https://nodejs.org/api/report.html) 89 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 90 | 91 | # Runtime data 92 | pids 93 | *.pid 94 | *.seed 95 | *.pid.lock 96 | 97 | # Directory for instrumented libs generated by jscoverage/JSCover 98 | lib-cov 99 | 100 | # Coverage directory used by tools like istanbul 101 | coverage 102 | *.lcov 103 | 104 | # nyc test coverage 105 | .nyc_output 106 | 107 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 108 | .grunt 109 | 110 | # Bower dependency directory (https://bower.io/) 111 | bower_components 112 | 113 | # node-waf configuration 114 | .lock-wscript 115 | 116 | # Compiled binary addons (https://nodejs.org/api/addons.html) 117 | build/Release 118 | 119 | # Dependency directories 120 | node_modules/ 121 | jspm_packages/ 122 | 123 | # Snowpack dependency directory (https://snowpack.dev/) 124 | web_modules/ 125 | 126 | # TypeScript cache 127 | *.tsbuildinfo 128 | 129 | # Optional npm cache directory 130 | .npm 131 | 132 | # Optional eslint cache 133 | .eslintcache 134 | 135 | # Optional stylelint cache 136 | .stylelintcache 137 | 138 | # Microbundle cache 139 | .rpt2_cache/ 140 | .rts2_cache_cjs/ 141 | .rts2_cache_es/ 142 | .rts2_cache_umd/ 143 | 144 | # Optional REPL history 145 | .node_repl_history 146 | 147 | # Output of 'npm pack' 148 | *.tgz 149 | 150 | # Yarn Integrity file 151 | .yarn-integrity 152 | 153 | # dotenv environment variable files 154 | .env 155 | .env.development.local 156 | .env.test.local 157 | .env.production.local 158 | .env.local 159 | 160 | # parcel-bundler cache (https://parceljs.org/) 161 | .cache 162 | .parcel-cache 163 | 164 | # Next.js build output 165 | .next 166 | out 167 | 168 | # Nuxt.js build / generate output 169 | .nuxt 170 | dist 171 | 172 | # Gatsby files 173 | .cache/ 174 | # Comment in the public line in if your project uses Gatsby and not Next.js 175 | # https://nextjs.org/blog/next-9-1#public-directory-support 176 | # public 177 | 178 | # vuepress build output 179 | .vuepress/dist 180 | 181 | # vuepress v2.x temp and cache directory 182 | .temp 183 | .cache 184 | 185 | # Docusaurus cache and generated files 186 | .docusaurus 187 | 188 | # Serverless directories 189 | .serverless/ 190 | 191 | # FuseBox cache 192 | .fusebox/ 193 | 194 | # DynamoDB Local files 195 | .dynamodb/ 196 | 197 | # TernJS port file 198 | .tern-port 199 | 200 | # Stores VSCode versions used for testing VSCode extensions 201 | .vscode-test 202 | 203 | # yarn v2 204 | .yarn/cache 205 | .yarn/unplugged 206 | .yarn/build-state.yml 207 | .yarn/install-state.gz 208 | .pnp.* 209 | 210 | # Ignore all bazel-* symlinks. There is no full list since this can change 211 | # based on the name of the directory bazel is cloned into. 212 | /bazel-* 213 | 214 | # User-specific .bazelrc 215 | user.bazelrc 216 | --------------------------------------------------------------------------------