Skip to content

Commit

Permalink
Merge branch 'main' into versioned
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 6, 2022
2 parents d51b13f + a262738 commit 7ec5230
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 44 deletions.
1 change: 1 addition & 0 deletions js/api-documenter/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# no rules yet!
44 changes: 44 additions & 0 deletions js/api-documenter/rules.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")

def _api_documenter_impl(ctx):
dir = ctx.actions.declare_directory(
ctx.attr.output_directory,
)

ctx.actions.run(
outputs = [dir],
inputs = [ctx.file.input_directory],
executable = ctx.executable.api_documenter_binary,
arguments = ["markdown", "-i", ctx.file.input_directory.path, "-o", dir.path],
mnemonic = "APIDocumenter",
progress_message = "Running api-documeneter (https://api-extractor.com)",
)

return [
DefaultInfo(
files = depset([dir]),
),
]

_api_documenter_rule = rule(
implementation = _api_documenter_impl,
attrs = {
"input_directory": attr.label(mandatory = True, allow_single_file = True),
"output_directory": attr.string(default = "api_docs"),
"api_documenter_binary": attr.label(mandatory = True, executable = True, cfg = "target"),
},
)

def api_documenter(name, docModel = None, **kwargs):
copy_to_directory(
name = name + "_docModel_dir",
srcs = [docModel],
)

_api_documenter_rule(
name = name,
api_documenter_binary = "@npm//@microsoft/api-documenter/bin:api-documenter",
input_directory = ":" + name + "_docModel_dir",
**kwargs
)
10 changes: 9 additions & 1 deletion js/npm/rules.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//bzl/versioning:rules.bzl", "bump_on_change_test", "semver_version")
load("//js/api-documenter:rules.bzl", "api_documenter")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("//js/npm/yarn/lock:rules.bzl", "lockfile_minimize")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
Expand Down Expand Up @@ -56,11 +57,18 @@ def npm_pkg(
srcs = srcs + deps,
report = "api_gen.md",
publicTrimmedRollup = "public.d.ts",
docModel = ".api.json",
)

api_documenter(
name = name + "_docs",
output_directory = "docs",
docModel = ".api.json",
)

copy_to_directory(
name = name + "_dir",
srcs = srcs + deps + [pkg_json_name, lockfile_name, "public.d.ts"],
srcs = srcs + deps + [pkg_json_name, lockfile_name, "public.d.ts", name + "_docs"],
replace_prefixes = {
"public.d.ts": "index.d.ts",
},
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@microsoft/api-documenter": "^7.19.2",
"@microsoft/api-extractor": "^7.29.0",
"@pulumi/aws": "^4.0.0",
"@pulumi/awsx": "^0.32.0",
Expand All @@ -27,8 +28,8 @@
"@types/d3-axis": "^3.0.1",
"@types/d3-scale": "^4.0.2",
"@types/jest": "^28.1.6",
"@types/mime": "^3.0.0",
"@types/node": "^18.6.3",
"@types/mime": "^3.0.1",
"@types/node": "^18.6.4",
"@types/react": "18.0.15",
"@types/react-dom": "^18.0.6",
"@types/sharp": "^0.30.4",
Expand All @@ -48,7 +49,7 @@
"esbuild": "^0.14.53",
"esbuild-css-modules-plugin": "^2.5.1",
"eslint": "^8.21.0",
"eslint-config-next": "12.2.3",
"eslint-config-next": "12.2.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
Expand Down
4 changes: 2 additions & 2 deletions ts/cmd/svgshot/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ts_project(
srcs = [
"index.ts",
"lib.ts",
"run.ts"
"run.ts",
],
deps = [
"@npm//@types/node",
Expand Down Expand Up @@ -51,7 +51,7 @@ jest_test(
npm_pkg(
name = "npm_pkg",
package_name = "svgshot",
srcs = ["README.md"] + glob(["docs/**/*"]),
srcs = glob(["examples/**/*"]) + ["README.md"],
api_lock = ".api.lock",
entry_point = "index.ts",
major_version = "version/MAJOR",
Expand Down
6 changes: 4 additions & 2 deletions ts/cmd/svgshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ svgshot
Svgshot takes 'screenshots' of webpages as minimised SVGs. This makes them
great for rendering in videos or webpages.

[API Reference](./docs/index.md)

Example
-----------------------------------------------------------------------------
Expand All @@ -17,12 +18,12 @@ svgshot https://en.wikipedia.org
# writing Wikipedia__the_free_encyclopedia.svg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[Wikipedia SVG]: ./docs/Wikipedia__the_free_encyclopedia.svg
[Wikipedia SVG]: ./examples/Wikipedia__the_free_encyclopedia.svg
![Wikipedia SVG]

With `--block` for removing text¹:

[Twitch SVG]: ./docs/Twitch.svg
[Twitch SVG]: ./examples/Twitch.svg
![Twitch SVG]

[Examples directory]: ./examples
Expand Down Expand Up @@ -53,6 +54,7 @@ For temporary usage you might want to use `npx`:
npx svgshot https://en.wikipedia.org
```


TODO
-----------------------------------------------------------------------------
Replace SVG dimensions with viewBox so they dont get weirdly warped when
Expand Down
1 change: 0 additions & 1 deletion ts/cmd/svgshot/docs/Twitch.svg

This file was deleted.

1 change: 0 additions & 1 deletion ts/cmd/svgshot/docs/Wikipedia__the_free_encyclopedia.svg

This file was deleted.

2 changes: 1 addition & 1 deletion ts/cmd/svgshot/examples/Twitch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions ts/cmd/svgshot/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
/**
*
* Svgshot takes 'screenshots' of webpages as minimised SVGs. This makes them
* great for rendering in videos or webpages.
*
* @remarks
* For more information, see https://npmjs.com/package/svgshot.
*/

export * from './lib';
export { default } from './lib';
3 changes: 1 addition & 2 deletions ts/do-sync/testing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ ts_project(
name = "project",
srcs = glob(["**/*.ts"]),
deps = [
"//ts/do-sync",
"@npm//@types/jest",
"@npm//@types/sharp",
"@npm//sharp",
"//ts/do-sync"
],
)


jest_test(
name = "tests",
srcs = ["doSync_test.js"],
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"baseUrl": "./",
"rootDirs": ["bazel-out/k8-fastbuild/bin"],
"paths": {
"monorepo/*": ["./monorepo/*", "bazel-out/k8-fastbuild/bin/monorepo/*"]
"monorepo/*": [
"./*", "./monorepo/*", "bazel-out/k8-fastbuild/bin/monorepo/*"]
}
},
"exclude": ["node_modules", "dist", "external"]
Expand Down
79 changes: 50 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,19 @@
resolved "https://registry.yarnpkg.com/@logdna/tail-file/-/tail-file-2.1.0.tgz#7c3d98c3378d15061589e12875ffb7673b0ce82c"
integrity sha512-8zYzetB1zfa7WA4c0RS1EU9pNKcj1BqilU2fCsEvmKfWgEdpaphff6hk2Rcn3A0qHwynEdw9lTrlYN4sUw2FpA==

"@microsoft/api-documenter@^7.19.2":
version "7.19.2"
resolved "https://registry.yarnpkg.com/@microsoft/api-documenter/-/api-documenter-7.19.2.tgz#49c11af6254ebda6715b019e3fb3cb0ad5d8e62d"
integrity sha512-9Fb3Hpwv6uo7DB6IgcWByzHy8TLaZTprjueBDqMI6WmurqVtKWrTPdcZteUJaob5im8pzRTrVCxKDR/PpIAxsw==
dependencies:
"@microsoft/api-extractor-model" "7.23.0"
"@microsoft/tsdoc" "0.14.1"
"@rushstack/node-core-library" "3.50.1"
"@rushstack/ts-command-line" "4.12.2"
colors "~1.2.1"
js-yaml "~3.13.1"
resolve "~1.17.0"

"@microsoft/[email protected]":
version "7.23.0"
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.23.0.tgz#266de12607fffe72259bfdf94e35331a18fdb223"
Expand Down Expand Up @@ -1007,10 +1020,10 @@
resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.14.1.tgz#155ef21065427901994e765da8a0ba0eaae8b8bd"
integrity sha512-6Wci+Tp3CgPt/B9B0a3J4s3yMgLNSku6w5TV6mN+61C71UqsRBv2FUibBf3tPGlNxebgPHMEUzKpb1ggE8KCKw==

"@next/[email protected].3":
version "12.2.3"
resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.2.3.tgz#63726691aac6a7f01b64190a0323d590a0e8154d"
integrity sha512-B2e8Yg1MpuLsGxhCx4rU8/Tcnr5wFmCx1O2eyLXBPnaCcsFXfGCo067ujagtDLtWASL3GNgzg78U1SB0dbc38A==
"@next/[email protected].4":
version "12.2.4"
resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.2.4.tgz#b7496cf11050577cfa815612c541195c1b4871eb"
integrity sha512-ChDkUIkJeYWKRx+FdF+EhUgvKtK1wF+Xew4Os7ef3iAjMch5GGBiezw2zGXTa/C0E6potz4j11EpX89mngffug==
dependencies:
glob "7.1.7"

Expand Down Expand Up @@ -1556,20 +1569,20 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/mime@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.0.tgz#e9a9903894405c6a6551f1774df4e64d9804d69c"
integrity sha512-fccbsHKqFDXClBZTDLA43zl0+TbxyIwyzIzwwhvoJvhNjOErCdeX2xJbURimv2EbSVUGav001PaCJg4mZxMl4w==
"@types/mime@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10"
integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==

"@types/minimist@^1.2.0":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==

"@types/node@*", "@types/node@>=12.12.47", "@types/node@^18.6.3":
version "18.6.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.3.tgz#4e4a95b6fe44014563ceb514b2598b3e623d1c98"
integrity sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg==
"@types/node@*", "@types/node@>=12.12.47", "@types/node@^18.6.4":
version "18.6.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39"
integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==

"@types/[email protected]":
version "12.20.24"
Expand Down Expand Up @@ -1984,9 +1997,9 @@ available-typed-arrays@^1.0.5:
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==

aws-sdk@^2.0.0:
version "2.1188.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1188.0.tgz#94b710948ef2924093a8d6fe42443a792385afa2"
integrity sha512-4KXwjRjbCzU1luTOeH+ded92H51I4UuHaZzx2EI+JA0II1+q48heTxFlFd7yp7jGz9UwjPb6k12Jv1W3r0JWxA==
version "2.1189.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1189.0.tgz#8dd6b48dd7896642af8e2f86e026932a28e380d5"
integrity sha512-EqluXSo8XAR086nF9UAtPYwUm82ZIRqg8OmHBRQyftcrD1Z0pqMmiuvacXoEAJ/4UU8KKafbpYarxx8rH/pZjQ==
dependencies:
buffer "4.9.2"
events "1.1.1"
Expand Down Expand Up @@ -2213,9 +2226,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001370:
version "1.0.30001373"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001373.tgz#2dc3bc3bfcb5d5a929bec11300883040d7b4b4be"
integrity sha512-pJYArGHrPp3TUqQzFYRmP/lwJlj8RCbVe3Gd3eJQkAV8SAC6b19XS9BjMvRdvaS8RMkaTN8ZhoHP6S1y8zzwEQ==
version "1.0.30001374"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz#3dab138e3f5485ba2e74bd13eca7fe1037ce6f57"
integrity sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==

chalk@^2.0.0, chalk@^2.4.2:
version "2.4.2"
Expand Down Expand Up @@ -2815,9 +2828,9 @@ domutils@^2.8.0:
domhandler "^4.2.0"

electron-to-chromium@^1.4.202:
version "1.4.210"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.210.tgz#12611fe874b833a3bf3671438b5893aba7858980"
integrity sha512-kSiX4tuyZijV7Cz0MWVmGT8K2siqaOA4Z66K5dCttPPRh0HicOcOAEj1KlC8O8J1aOS/1M8rGofOzksLKaHWcQ==
version "1.4.211"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz#afaa8b58313807501312d598d99b953568d60f91"
integrity sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==

emittery@^0.8.1:
version "0.8.1"
Expand Down Expand Up @@ -3079,12 +3092,12 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"

[email protected].3:
version "12.2.3"
resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.2.3.tgz#468fe9756ccbf7e4452139062db5b4e6557dc885"
integrity sha512-xAQqAqwa2bu9ZMRypz58ym4tNCo22Wc6LuoLpbpf3yW5c4ZkVib9934AgGDDvh2zKrP56Z6X0Pp6gNnuuZzcRw==
[email protected].4:
version "12.2.4"
resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.2.4.tgz#5f12f2eff1fabc3f1fb7527ceb8a4ad00235b011"
integrity sha512-r3keSLY1Z+rN+ASN8nmWwZ+AsMl6IrPGRWgbQhKHcop4/fk1hJGxE9Xf/mYMkV07+1Q/catchw25lu525HFy5Q==
dependencies:
"@next/eslint-plugin-next" "12.2.3"
"@next/eslint-plugin-next" "12.2.4"
"@rushstack/eslint-patch" "^1.1.3"
"@typescript-eslint/parser" "^5.21.0"
eslint-import-resolver-node "^0.3.6"
Expand Down Expand Up @@ -4158,9 +4171,9 @@ is-ci@^2.0.0:
ci-info "^2.0.0"

is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.1:
version "2.9.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69"
integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==
version "2.10.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed"
integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==
dependencies:
has "^1.0.3"

Expand Down Expand Up @@ -4850,6 +4863,14 @@ js-yaml@^4.1.0:
dependencies:
argparse "^2.0.1"

js-yaml@~3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

jsdom@^16.6.0:
version "16.7.0"
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710"
Expand Down

0 comments on commit 7ec5230

Please sign in to comment.