scripts: cleanup

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-01-30 21:34:37 +01:00
parent 016a9ce34e
commit 91d6f572a5
4 changed files with 23 additions and 21 deletions

View File

@ -14,7 +14,7 @@ pythonPlatform = "Linux"
[tool.black] [tool.black]
line-length = 100 line-length = 100
target-version = ['py39'] target-version = ['py310']
exclude = 'node_modules' exclude = 'node_modules'
[tool.isort] [tool.isort]

View File

@ -3,7 +3,11 @@ from authentik.lib.generators import generate_id
from yaml import safe_dump from yaml import safe_dump
with open("local.env.yml", "w") as _config: with open("local.env.yml", "w") as _config:
safe_dump({ safe_dump(
"log_level": "debug", {
"secret_key": generate_id(), "log_level": "debug",
}, _config, default_flow_style=False) "secret_key": generate_id(),
},
_config,
default_flow_style=False,
)

View File

@ -13,7 +13,10 @@ if os.environ.get(env_pr_branch, "") != "":
should_build = str(os.environ.get("DOCKER_USERNAME", "") != "").lower() should_build = str(os.environ.get("DOCKER_USERNAME", "") != "").lower()
print("##[set-output name=branchName]%s" % branch_name) print("##[set-output name=branchName]%s" % branch_name)
print("##[set-output name=branchNameContainer]%s" % branch_name.replace("refs/heads/", "").replace("/", "-")) print(
"##[set-output name=branchNameContainer]%s"
% branch_name.replace("refs/heads/", "").replace("/", "-")
)
print("##[set-output name=timestamp]%s" % int(time())) print("##[set-output name=timestamp]%s" % int(time()))
print("##[set-output name=sha]%s" % os.environ[sha]) print("##[set-output name=sha]%s" % os.environ[sha])
print("##[set-output name=shouldBuild]%s" % should_build) print("##[set-output name=shouldBuild]%s" % should_build)

View File

@ -2,20 +2,15 @@
from json import loads, dumps from json import loads, dumps
TSCONFIG_ESM = { TSCONFIG_ESM = {
"compilerOptions": { "compilerOptions": {
"declaration": True, "declaration": True,
"target": "es6", "target": "es6",
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "./dist/esm", "outDir": "./dist/esm",
"typeRoots": [ "typeRoots": ["node_modules/@types"],
"node_modules/@types" },
] "exclude": ["dist", "node_modules"],
},
"exclude": [
"dist",
"node_modules"
]
} }
@ -24,7 +19,7 @@ with open("web-api/package.json", encoding="utf-8") as _package:
package["license"] = "GPL-3.0-only" package["license"] = "GPL-3.0-only"
package["module"] = "./dist/esm/index.js" package["module"] = "./dist/esm/index.js"
package["sideEffects"] = False package["sideEffects"] = False
package["scripts"]["build"] = "tsc && tsc --project tsconfig.esm.json" package["scripts"]["build"] = "tsc && tsc --project tsconfig.esm.json"
open("web-api/package.json", "w+", encoding="utf-8").write(dumps(package)) open("web-api/package.json", "w+", encoding="utf-8").write(dumps(package))
open("web-api/tsconfig.esm.json", "w+", encoding="utf-8").write(dumps(TSCONFIG_ESM)) open("web-api/tsconfig.esm.json", "w+", encoding="utf-8").write(dumps(TSCONFIG_ESM))