Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main #353

Merged
merged 84 commits into from
Jun 10, 2022
Merged

main #353

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
07c111a
Revert "Revert "svgshot (#125)""
Zemnmez May 25, 2022
21ddd57
Begin work on publishing to NPM.
Zemnmez May 25, 2022
8e95992
Merge branch 'svgshot-publish' of github.com:Zemnmez/monorepo into sv…
Zemnmez May 25, 2022
4b0b42d
Merge branch 'main' into svgshot-publish
Zemnmez May 26, 2022
0aa8b2b
some code to generate a package.json
Zemnmez May 26, 2022
fe9bda0
Progress on package.json generation:
Zemnmez May 26, 2022
437957e
Lint / fix
Zemnmez May 26, 2022
5299982
Successfully generate package.json :DD
Zemnmez May 27, 2022
897ac0d
- Export yarn.lock (for use in future npm subpackages)
Zemnmez May 27, 2022
df1ecd8
Merge branch 'main' into svgshot-publish
Zemnmez May 27, 2022
bb4693c
Restrict depth of deps for npm package exports
Zemnmez May 27, 2022
e5ab043
Merge branch 'svgshot-publish' of github.com:Zemnmez/monorepo into sv…
Zemnmez May 27, 2022
c44c319
dev dependency detection
Zemnmez May 27, 2022
81c2220
repo url fix; rename 'shape' to 'shape_test'
Zemnmez May 27, 2022
de854fb
export main as 'main' (not just default)
Zemnmez May 27, 2022
27ae0c0
run fixers
Zemnmez May 27, 2022
81b9268
Merge branch 'main' into svgshot-publish
Zemnmez May 27, 2022
8d7e2ed
WIP
Zemnmez May 29, 2022
91663cd
Merge branch 'svgshot-publish' of github.com:Zemnmez/monorepo into sv…
Zemnmez May 29, 2022
5d5992e
Complete npm_pkg rule --
Zemnmez May 30, 2022
96f6763
lint / fix
Zemnmez May 30, 2022
ce4a7b2
add ts-api-guardian
Zemnmez May 30, 2022
6cea10b
add package version checks
Zemnmez Jun 6, 2022
446621a
formatting
Zemnmez Jun 6, 2022
3466698
(somehow) functioning major version testing
Zemnmez Jun 6, 2022
eccd21a
prettier
Zemnmez Jun 6, 2022
f014091
fix complaints
Zemnmez Jun 6, 2022
593a762
Merge branch 'main' into svgshot-publish
Zemnmez Jun 6, 2022
81cd9ab
Merge pull request #274 from Zemnmez/svgshot-publish
Zemnmez Jun 6, 2022
1543463
revoke version tests on main for svgshot
Zemnmez Jun 7, 2022
b87f03a
Merge branch 'main' into svgshot-publish
Zemnmez Jun 7, 2022
9b82cdf
Merge pull request #326 from Zemnmez/svgshot-publish
Zemnmez Jun 8, 2022
5f2b855
Update ci.yml
Zemnmez Jun 9, 2022
a707a88
Update ci.yml
Zemnmez Jun 9, 2022
eb8454a
Merge pull request #346 from Zemnmez/Zemnmez-patch-13
Zemnmez Jun 9, 2022
4c4d95b
Update ci.yml
Zemnmez Jun 9, 2022
8c14bed
Update ci.yml
Zemnmez Jun 9, 2022
891bacb
Update ci.yml
Zemnmez Jun 9, 2022
0024a02
Update ci.yml
Zemnmez Jun 9, 2022
f68f328
Update ci.yml
Zemnmez Jun 9, 2022
6654530
Bump actions/cache from 3.0.3 to 3.0.4
dependabot[bot] Jun 9, 2022
234a528
Merge pull request #336 from Zemnmez/dependabot/github_actions/action…
github-actions[bot] Jun 9, 2022
09f40ea
Bump qs from 6.10.3 to 6.10.5
dependabot[bot] Jun 9, 2022
09cdf7b
Merge pull request #323 from Zemnmez/dependabot/npm_and_yarn/qs-6.10.5
github-actions[bot] Jun 9, 2022
3b1233e
Bump aws-sdk from 2.1148.0 to 2.1151.0
dependabot[bot] Jun 9, 2022
c6ba722
Merge pull request #344 from Zemnmez/dependabot/npm_and_yarn/aws-sdk-…
github-actions[bot] Jun 9, 2022
4a46814
Bump electron-to-chromium from 1.4.146 to 1.4.150
dependabot[bot] Jun 9, 2022
22081cb
Merge pull request #347 from Zemnmez/dependabot/npm_and_yarn/electron…
github-actions[bot] Jun 9, 2022
f3e07c9
Bump caniuse-lite from 1.0.30001346 to 1.0.30001352
dependabot[bot] Jun 9, 2022
5d05757
Merge pull request #348 from Zemnmez/dependabot/npm_and_yarn/caniuse-…
github-actions[bot] Jun 9, 2022
4874a87
Bump browserslist from 4.20.3 to 4.20.4
dependabot[bot] Jun 9, 2022
5685f3b
Merge pull request #331 from Zemnmez/dependabot/npm_and_yarn/browsers…
github-actions[bot] Jun 9, 2022
28aafb3
Bump esbuild-css-modules-plugin from 2.2.16 to 2.3.1
dependabot[bot] Jun 9, 2022
6a93ae2
Merge pull request #337 from Zemnmez/dependabot/npm_and_yarn/esbuild-…
github-actions[bot] Jun 9, 2022
4ad6087
Bump get-intrinsic from 1.1.1 to 1.1.2
dependabot[bot] Jun 9, 2022
c85f657
Merge pull request #343 from Zemnmez/dependabot/npm_and_yarn/get-intr…
github-actions[bot] Jun 9, 2022
d591b06
Bump stylelint-config-recommended from 7.0.0 to 8.0.0
dependabot[bot] Jun 9, 2022
9bccb38
Merge pull request #340 from Zemnmez/dependabot/npm_and_yarn/stylelin…
github-actions[bot] Jun 9, 2022
ce1fc60
Bump @types/node from 17.0.40 to 17.0.41
dependabot[bot] Jun 9, 2022
1624a7a
Merge pull request #328 from Zemnmez/dependabot/npm_and_yarn/types/no…
github-actions[bot] Jun 9, 2022
58d262a
Bump @microsoft/api-extractor from 7.24.2 to 7.25.0
dependabot[bot] Jun 9, 2022
095632e
Merge pull request #332 from Zemnmez/dependabot/npm_and_yarn/microsof…
github-actions[bot] Jun 9, 2022
9af16ae
Bump stylelint from 14.8.5 to 14.9.0
dependabot[bot] Jun 9, 2022
41afc95
Merge pull request #345 from Zemnmez/dependabot/npm_and_yarn/stylelin…
github-actions[bot] Jun 9, 2022
6ab252d
Bump @pulumi/pulumi from 3.33.2 to 3.34.0
dependabot[bot] Jun 9, 2022
96862da
Merge pull request #339 from Zemnmez/dependabot/npm_and_yarn/pulumi/p…
github-actions[bot] Jun 9, 2022
36f1ec7
Bump puppeteer from 14.2.1 to 14.3.0
dependabot[bot] Jun 9, 2022
f1e8c85
Merge pull request #329 from Zemnmez/dependabot/npm_and_yarn/puppetee…
github-actions[bot] Jun 9, 2022
b91ef67
Bump @typescript-eslint/eslint-plugin from 5.27.0 to 5.27.1
dependabot[bot] Jun 9, 2022
d60fb97
Merge pull request #324 from Zemnmez/dependabot/npm_and_yarn/typescri…
github-actions[bot] Jun 9, 2022
6fed4f7
Bump esbuild from 0.14.42 to 0.14.43
dependabot[bot] Jun 9, 2022
73713c3
Merge pull request #342 from Zemnmez/dependabot/npm_and_yarn/esbuild-…
github-actions[bot] Jun 9, 2022
dd54a99
Bump @typescript-eslint/parser from 5.27.0 to 5.27.1
dependabot[bot] Jun 9, 2022
959b435
Merge pull request #322 from Zemnmez/dependabot/npm_and_yarn/typescri…
github-actions[bot] Jun 9, 2022
d416610
Bump electron-to-chromium from 1.4.150 to 1.4.151
dependabot[bot] Jun 10, 2022
51599c6
Merge pull request #349 from Zemnmez/dependabot/npm_and_yarn/electron…
github-actions[bot] Jun 10, 2022
e311af1
Bump aws-sdk from 2.1151.0 to 2.1152.0
dependabot[bot] Jun 10, 2022
8325561
Provide env to copy to versioned action
Zemnmez Jun 10, 2022
ed4cac9
Merge pull request #351 from Zemnmez/dependabot/npm_and_yarn/aws-sdk-…
github-actions[bot] Jun 10, 2022
707b900
Merge branch 'main' into Zemnmez-patch-14
Zemnmez Jun 10, 2022
8dcb57e
Merge pull request #352 from Zemnmez/Zemnmez-patch-14
Zemnmez Jun 10, 2022
8330476
Update copy_to_versioned.sh
Zemnmez Jun 10, 2022
41c9f14
Update copy_to_versioned.sh
Zemnmez Jun 10, 2022
b520191
Update copy_to_versioned.sh
Zemnmez Jun 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/copy_to_versioned.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ echo "Open PR to versioned branch (or not, if it was already there)"
echo ""
echo "Skipping failure here too, becuase we don't actually care"
echo "if the PR is already there."
gh pr create -f --head --main --base versioned || true
gh pr create -f --head main --base versioned || true

echo "This ensures we have our commits pushed. We could be up to date"
echo "already. But it doesn't really matter."
git push || true

echo "Setting PR to merge automatically..."
gh pr merge versioned --auto
gh pr merge --auto --merge
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ jobs:
pull-requests: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Merge (if dependabot)'
run: gh pr merge versioned --auto
run: gh pr merge "$PR_URL" --auto --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}


Test:
Expand All @@ -41,7 +51,7 @@ jobs:
with:
node-version: '16'
- name: Restore bazel cache
uses: actions/cache@v3.0.3
uses: actions/cache@v3.0.4
env:
cache-name: bazel-cache
with:
Expand All @@ -68,7 +78,7 @@ jobs:
with:
node-version: '16'
- name: Restore bazel cache
uses: actions/cache@v3.0.3
uses: actions/cache@v3.0.4
env:
cache-name: bazel-cache
with:
Expand All @@ -91,7 +101,7 @@ jobs:
with:
node-version: '16'
- name: Restore bazel cache
uses: actions/cache@v3.0.3
uses: actions/cache@v3.0.4
env:
cache-name: bazel-cache
with:
Expand Down Expand Up @@ -121,4 +131,9 @@ jobs:
fetch-depth: 0
- run: ./.github/scripts/copy_to_versioned.sh
shell: bash

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}



2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ js_library(
exports_files(
[
".prettierrc.json",
"package.json",
".gitignore",
".editorconfig",
".eslintrc.json",
"css_loader.d.ts",
"yarn.lock",
],
visibility = ["//visibility:public"],
)
Expand Down
7 changes: 7 additions & 0 deletions bzl/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Install the nodejs "bootstrap" package
# This provides the basic tools for running and packaging nodejs programs in Bazel
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

def fetch_dependencies():
http_archive(
Expand Down Expand Up @@ -145,3 +146,9 @@ exports_files(glob(["**/*"], exclude_directories=0))
""",
# exports_files(glob(["**/*"]), visibility=["//visibility:public"])
)

git_repository(
name = "bazel_tools",
branch = "master",
remote = "git@github.com:attilaolah/bazel-tools.git",
)
2 changes: 1 addition & 1 deletion bzl/hash/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# no output defined here
# no output defined here
10 changes: 5 additions & 5 deletions bzl/hash/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ def _impl(ctx):
# Actions are run only when the corresponding file is requested.

inputs = ctx.files.srcs
arguments = [ file.path for file in ctx.files.srcs ]
arguments = [file.path for file in ctx.files.srcs]

ctx.actions.run_shell(
outputs = [ctx.outputs.md5],
inputs = inputs,
command = "md5sum $@ > {}".format( ctx.outputs.md5.path),
command = "md5sum $@ > {}".format(ctx.outputs.md5.path),
arguments = arguments,
)

ctx.actions.run_shell(
outputs = [ctx.outputs.sha1],
inputs = inputs,
command = "sha1sum $@ > {}".format( ctx.outputs.sha1.path),
command = "sha1sum $@ > {}".format(ctx.outputs.sha1.path),
arguments = arguments,
)

ctx.actions.run_shell(
outputs = [ctx.outputs.sha256],
inputs = inputs,
command = "sha256sum $@ > {}".format( ctx.outputs.sha256.path),
command = "sha256sum $@ > {}".format(ctx.outputs.sha256.path),
arguments = arguments,
)

Expand All @@ -47,4 +47,4 @@ def hashes(**kwargs):
sha1 = "%s.sha1" % name,
sha256 = "%s.sha256" % name,
**kwargs
)
)
9 changes: 6 additions & 3 deletions bzl/hash/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test")

hashes(
name = "hashes",
srcs = [ "input1.txt", "input2.txt" ]
srcs = [
"input1.txt",
"input2.txt",
],
)

generated_file_test(
name = "version_concat_test",
src = "expected.txt",
generated = ":hashes",
src = "expected.txt"
)
)
3 changes: 1 addition & 2 deletions bzl/versioning/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exports_files(
[
"bump.py"
"bump.py",
],
visibility = ["//visibility:public"],
)

58 changes: 28 additions & 30 deletions bzl/versioning/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,75 +11,73 @@ def semver_version(name, **kwargs):

def _semver_version_impl(ctx):
ctx.actions.run_shell(
outputs = [ ctx.outputs.output ],
outputs = [ctx.outputs.output],
inputs = [
ctx.file.major,
ctx.file.minor,
ctx.file.patch
ctx.file.patch,
],
arguments = [ file.path for file in [
arguments = [file.path for file in [
ctx.outputs.output,
ctx.file.major,
ctx.file.minor,
ctx.file.patch
] ],
ctx.file.patch,
]],
command = "cat <(echo v) $2 <(echo .) $3 <(echo .) $4 | tr -d '\n' > $1",
progress_message = "Concatenating version number..."
progress_message = "Concatenating version number...",
)


_semver_version = rule(
implementation = _semver_version_impl,
attrs = {
"major": attr.label(allow_single_file = True, mandatory = True),
"minor": attr.label(allow_single_file = True, mandatory = True),
"patch": attr.label(allow_single_file = True, mandatory = True),
"output": attr.output(mandatory = True)
}
"output": attr.output(mandatory = True),
},
)

def _absolute_label(label):
if label.startswith('@') or label.startswith('/'):
if label.startswith("@") or label.startswith("/"):
return label
if label.startswith(':'):
return native.repository_name() + '//' + native.package_name() + label
return native.repository_name() + '//' + native.package_name() + ':' + label
if label.startswith(":"):
return native.repository_name() + "//" + native.package_name() + label
return native.repository_name() + "//" + native.package_name() + ":" + label

def bump_on_change_test(name, srcs = [], version_lock = None, version = None, run_on_main = False):
tags = []

if not run_on_main:
tags = [ 'do_not_run_on_main' ]
tags = ["do_not_run_on_main"]

hashes_name = name + "_version_lock_validator"
hashes(
name = hashes_name,
srcs = srcs + [ version ],
srcs = srcs + [version],
)

generated_file_test(
name = name,
generated = hashes_name,
src = version_lock,
tags = tags + [ 'version_check' ]
tags = tags + ["version_check"],
)

py_binary(
name = name + ".bump",
srcs = [ "//bzl/versioning:bump.py" ],
srcs = ["//bzl/versioning:bump.py"],
main = "//bzl/versioning:bump.py",
data = [ version, hashes_name, version_lock ],
data = [version, hashes_name, version_lock],
args = [
"--to_bump_in", "$(rootpath " + version + ")",
"--to_bump_out", "$(rootpath " + version + ")",
"--lockfile_build_label", _absolute_label(hashes_name),
"--lockfile_build_rootpath", "$(rootpath " + hashes_name + ")",
"--lockfile_out_rootpath", "$(rootpath " + version_lock + ")"
]
"--to_bump_in",
"$(rootpath " + version + ")",
"--to_bump_out",
"$(rootpath " + version + ")",
"--lockfile_build_label",
_absolute_label(hashes_name),
"--lockfile_build_rootpath",
"$(rootpath " + hashes_name + ")",
"--lockfile_out_rootpath",
"$(rootpath " + version_lock + ")",
],
)






8 changes: 4 additions & 4 deletions bzl/versioning/test/bump_on_change_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ load("//bzl/versioning:rules.bzl", "bump_on_change_test")

bump_on_change_test(
name = "version",
srcs = [ "contents.txt" ],
version_lock = "version.lock",
srcs = ["contents.txt"],
run_on_main = True,
version = "MAJOR",
run_on_main = True
)
version_lock = "version.lock",
)
6 changes: 3 additions & 3 deletions bzl/versioning/test/semver_version/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ semver_version(
name = "version",
major = "MAJOR",
minor = "MINOR",
patch = "PATCH"
patch = "PATCH",
)

generated_file_test(
name = "version_concat_test",
src = "expected.txt",
generated = ":version",
src = "expected.txt"
)
)
31 changes: 29 additions & 2 deletions deploy/BUILD
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
load("//:rules.bzl", "nodejs_binary", "ts_project")

package(default_visibility = ["//deploy:__subpackages__"])

# This is a list of build tags which will be uploaded to a github release.
BUILD_ARTIFACTS = {
"recursive_vassals.zip": "//project/ck3/recursive-vassals:mod_zip",
"recursive_vassals.patch": "//project/ck3/recursive-vassals:patch",
}

ts_project(
name = "release_src",
srcs = ["release.ts"],
deps = [
"@npm//@actions/github",
"@npm//@types/node",
"@npm//mime",
],
)

nodejs_binary(
name = "release",
data = BUILD_ARTIFACTS.values(),
entry_point = "release.js",
templated_args = [name + "=" + "$(rootpaths " + tag + ")" for (name, tag) in BUILD_ARTIFACTS.items()],
)

sh_binary(
name = "deploy",
srcs = ["deploy.sh"],
data = [
"//deploy/artifacts:release",
"//deploy:release",
"//project/cultist/multiplayer/deploy:pulumi_prod",
],
env = {
"PULUMI_CULTIST_MULTIPLAYER": "$(location //project/cultist/multiplayer/deploy:pulumi_prod)",
"ARTIFACT_RELEASE": "$(location //deploy/artifacts:release)",
"RELEASE": "$(location //deploy:release)",
},
deps = ["@bazel_tools//tools/bash/runfiles"],
)
26 changes: 0 additions & 26 deletions deploy/artifacts/BUILD

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions js/api-extractor/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# spooky in here
Loading