Skip to content

Commit

Permalink
feat: update to Ory Kratos 0.6 (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Apr 9, 2021
1 parent ac4e70f commit 53ad90b
Show file tree
Hide file tree
Showing 40 changed files with 5,374 additions and 342 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN npm ci
COPY . /usr/src/app

RUN if [ "$LINK" == "true" ]; then (cd ./contrib/sdk/generated; rm -rf node_modules; npm ci; npm run build); \
cp -r ./contrib/sdk/generated/* node_modules/@oryd/kratos-client/; \
cp -r ./contrib/sdk/generated/* node_modules/@ory/kratos-client/; \
fi

RUN npm run build
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ docker:
.PHONY: build-sdk
build-sdk:
(cd $$KRATOS_DIR; make sdk)
cp $$KRATOS_DIR/.schema/api.swagger.json ./contrib/sdk/api.swagger.json
npx @openapitools/openapi-generator-cli@cli-4.3.1 generate -i "./contrib/sdk/api.swagger.json" \
cp $$KRATOS_DIR/spec/openapi.json ./contrib/sdk/openapi.json
npx @openapitools/openapi-generator-cli generate -i "./contrib/sdk/openapi.json" \
-g typescript-axios \
-o "./contrib/sdk/generated" \
--git-user-id ory \
--git-repo-id sdk \
--git-host github.com \
-c ./contrib/sdk/typescript.yml
(cd ./contrib/sdk/generated; npm i; npm run build)
rm -rf node_modules/@oryd/kratos-client/*
cp -r ./contrib/sdk/generated/* node_modules/@oryd/kratos-client
rm -rf node_modules/@ory/kratos-client/*
cp -r ./contrib/sdk/generated/* node_modules/@ory/kratos-client

.PHONY: publish-sdk
publish-sdk: build-sdk
(cd ./contrib/sdk/generated/; \
npm --no-git-tag-version version v0.0.0-next.$(rand) && \
npm publish)
rm -rf node_modules/@oryd/kratos-client/*
npm i @oryd/kratos-client@0.0.0-next.$(rand)
rm -rf node_modules/@ory/kratos-client/*
sleep 5
npm i @ory/kratos-client@0.0.0-next.$(rand)

.PHONY: build-sdk-docker
build-sdk-docker: build-sdk
docker build -t oryd/kratos-selfservice-ui-node:latest . --build-arg LINK=true

.PHONY: clean-sdk
clean-sdk:
rm -rf node_modules/@oryd/kratos-client/
rm -rf node_modules/@ory/kratos-client/
npm i
1 change: 1 addition & 0 deletions contrib/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
generated/
api.swagger.json
openapi.json
2 changes: 1 addition & 1 deletion contrib/sdk/typescript.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
npmName: "@oryd/kratos-client"
npmName: "@ory/kratos-client"
npmVersion: v0.0.1
supportsES6: true
ensureUniqueParams: true
Expand Down
7 changes: 7 additions & 0 deletions openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.1.0"
}
}
Loading

0 comments on commit 53ad90b

Please sign in to comment.