diff --git a/.dockerignore b/.dockerignore index b91760ac52..75c223bfdc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,7 +9,5 @@ build_docs/** **/*Dockerfile blueprints/local .git -!gen-ts-api/node_modules -!gen-ts-api/dist/** -!gen-go-api/ .venv +target/ diff --git a/.gitignore b/.gitignore index 01c20f85f1..d7e2edd43d 100644 --- a/.gitignore +++ b/.gitignore @@ -220,7 +220,6 @@ media/ *mmdb .idea/ -/gen-*/ data/ # Local Netlify folder diff --git a/Makefile b/Makefile index e58cdba32b..6d7bbfe131 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ else SED_INPLACE = sed -i endif -GEN_API_PY = gen-py-api - BREW_LDFLAGS := BREW_CPPFLAGS := BREW_PKG_CONFIG_PATH := @@ -188,7 +186,7 @@ gen-changelog: ## (Release) generate the changelog based from the commits since gen-diff: ## (Release) generate the changelog diff between the current schema and the last version $(eval last_version := $(shell git tag --list 'version/*' --sort 'version:refname' | grep -vE 'rc\d+$$' | tail -1)) git show ${last_version}:schema.yml > schema-old.yml - docker compose -f scripts/api/compose.yml run --rm --user "${UID}:${GID}" diff \ + docker compose -f scripts/compose.yml run --rm --user "${UID}:${GID}" diff \ --markdown \ /local/diff.md \ /local/schema-old.yml \ @@ -198,11 +196,6 @@ gen-diff: ## (Release) generate the changelog diff between the current schema a $(SED_INPLACE) 's/}/}/g' diff.md npx prettier --write diff.md -gen-clean-py: ## Remove generated API client for Python - rm -rf ${PWD}/${GEN_API_PY} - -gen-clean: gen-clean-ts gen-clean-py ## Remove generated API clients - gen-client-go: ## Build and install the authentik API for Golang make -C "${PWD}/packages/client-go" build @@ -214,12 +207,6 @@ gen-client-ts: ## Build and install the authentik API for Typescript into the a make -C "${PWD}/packages/client-ts" build npm --prefix web install -gen-client-py: gen-clean-py ## Build and install the authentik API for Python - mkdir -p ${PWD}/${GEN_API_PY} - git clone --depth 1 https://github.com/goauthentik/client-python.git ${PWD}/${GEN_API_PY} - cp ${PWD}/schema.yml ${PWD}/${GEN_API_PY} - make -C ${PWD}/${GEN_API_PY} build version=${NPM_VERSION} - _gen-clients: gen-client-go gen-client-rust gen-client-ts gen-clients: ## Build and install API clients used by authentik $(MAKE) _gen-clients -j diff --git a/cspell.config.jsonc b/cspell.config.jsonc index 3f44852cd3..1c2ff8547f 100644 --- a/cspell.config.jsonc +++ b/cspell.config.jsonc @@ -230,7 +230,6 @@ "schema.yml", // OpenAPI schema "./blueprints/schema.json", // Generated blueprint schema "custom-elements.json", // TypeScript custom element definitions - "./gen-*-api", // Generated API Client "./packages/client-go", // Generated API Client "./packages/client-rust/src", // Generated API Client "./packages/client-ts/src", // Generated API Client diff --git a/lifecycle/container/proxy.Dockerfile b/lifecycle/container/proxy.Dockerfile index d3060ad245..2058aec3d0 100644 --- a/lifecycle/container/proxy.Dockerfile +++ b/lifecycle/container/proxy.Dockerfile @@ -6,6 +6,10 @@ FROM --platform=${BUILDPLATFORM} docker.io/library/node:24 AS web-builder ENV NODE_ENV=production WORKDIR /static +# These files need to be copied and cannot be mounted as `npm ci` will build the client's typescript +COPY ./packages /packages +COPY ./web/packages /static/packages + COPY package.json / RUN --mount=type=bind,target=/static/package.json,src=./web/package.json \ --mount=type=bind,target=/static/package-lock.json,src=./web/package-lock.json \ diff --git a/package-lock.json b/package-lock.json index 49b02664da..64c7a1cc3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6788,7 +6788,7 @@ "@goauthentik/prettier-config": "../prettier-config", "@goauthentik/tsconfig": "../tsconfig", "@types/eslint": "^9.6.1", - "@types/node": "^25.3.0", + "@types/node": "^25.5.0", "typescript": "^6.0.2", "typescript-eslint": "^8.57.2" }, @@ -6819,12 +6819,12 @@ "@eslint/js": "^9.39.3", "@goauthentik/prettier-config": "../prettier-config", "@goauthentik/tsconfig": "../tsconfig", - "@types/node": "^25.3.0", + "@types/node": "^25.5.0", "eslint": "^9.39.3", "pino": "^10.3.1", "pino-pretty": "^13.1.2", "prettier": "^3.8.1", - "prettier-plugin-packagejson": "^3.0.0", + "prettier-plugin-packagejson": "^3.0.2", "typescript": "^6.0.2", "typescript-eslint": "^8.57.2" }, @@ -6859,7 +6859,7 @@ "@types/node": "^25.0.0", "eslint": "^9.39.3", "prettier": "^3.8.1", - "prettier-plugin-packagejson": "^3.0.0", + "prettier-plugin-packagejson": "^3.0.2", "typescript": "^6.0.2", "typescript-eslint": "^8.57.2" }, @@ -6869,12 +6869,12 @@ }, "peerDependencies": { "prettier": "^3.8.1", - "prettier-plugin-packagejson": "^3.0.0" + "prettier-plugin-packagejson": "^3.0.2" } }, "packages/tsconfig": { "name": "@goauthentik/tsconfig", - "version": "1.0.7", + "version": "1.0.8", "license": "MIT", "engines": { "node": ">=24", diff --git a/pyproject.toml b/pyproject.toml index e15ca41566..205bd5fc49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,7 +181,6 @@ max-returns = 10 [tool.mypy] plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main", "pydantic.mypy"] -exclude = ['^gen-py-api/'] [[tool.mypy.overrides]] module = ["django_tenants.*", "dramatiq.*", "pglock.*"] diff --git a/scripts/compose.yml b/scripts/compose.yml index 225733510b..865c3633a1 100644 --- a/scripts/compose.yml +++ b/scripts/compose.yml @@ -30,6 +30,13 @@ services: ports: - 127.0.0.1:8969:8969 restart: always + gen: + image: docker.io/openapitools/openapi-diff:2.1.7 + entrypoint: "/bin/true" + restart: never + network_mode: none + volumes: + - ../:/local:ro volumes: db-data: diff --git a/web/package-lock.json b/web/package-lock.json index e2c7ef3dbb..ac3bfbec6c 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -18446,6 +18446,20 @@ "typescript": "^4.0 || ^5.0" } }, + "packages/client-ts/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "packages/core": { "name": "@goauthentik/core", "version": "1.0.0",