Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zuplo/zudoku
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.17.0
Choose a base ref
...
head repository: zuplo/zudoku
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 380 changed files with 28,540 additions and 13,752 deletions.
17 changes: 16 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -2,7 +2,15 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
ignorePatterns: ["dist", ".eslintrc.cjs"],
ignorePatterns: [
"dist",
".eslintrc.cjs",
"packages/zudoku/cli.js",
"packages/zudoku/standalone",
"packages/zudoku/scripts/*.js",
"packages/config/src/index.d.ts",
"examples/many-apis/download.js",
],
parserOptions: {
project: "./tsconfig.eslint.json",
ecmaFeatures: {
@@ -42,6 +50,13 @@ module.exports = {
// Typescript
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/naming-convention": [
"error",
{
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto
packages/zudoku/src/config/validators/icon-types.ts linguist-generated
packages/zudoku/src/lib/plugins/openapi/graphql/** linguist-generated
packages/zudoku/schema.graphql linguist-generated
6 changes: 6 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
changelog:
exclude:
labels:
- skip-changelog
categories:
- title: Breaking Changes 🛠
labels:
@@ -13,6 +16,9 @@ changelog:
- title: Documentation 📚
labels:
- docs
- title: Dependency Updates 📦
labels:
- dependencies
- title: Other Changes 🔄
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:

- uses: nrwl/nx-set-shas@v4

- run: nx run-many -t root:lint:ci root:format:ci build:ci
- run: nx run-many -t lint:ci format:ci build:ci test

- name: Get Variables
id: vars
17 changes: 17 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This action sync docs to the zuplo docs
name: Zuplo Docs
on:
workflow_dispatch:
push:
branches:
- "main"
tags-ignore:
- "*"

jobs:
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Trigger Zuplo Docs Update
run: curl ${{ secrets.VERCEL_DOCS_WEBHOOK_URL }}
22 changes: 6 additions & 16 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -91,31 +91,21 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- run: echo "ZUDOKU_VERSION=$(node -e 'console.log(require(`./packages/zudoku/package.json`).version)')" >> $GITHUB_ENV
- run: echo "ZUDOKU_VERSION=$(node --print 'require(`./packages/zudoku/package.json`).version')" >> $GITHUB_ENV

- name: Push Git Changes
if: github.event_name == 'workflow_dispatch'
run: git push origin main --follow-tags

- uses: actions/github-script@v7
name: Create Release
name: ${{ github.event_name == 'workflow_dispatch' && 'Create Release' || 'Create Pre-release' }}
id: create-release
if: github.event_name == 'workflow_dispatch'
with:
result-encoding: string
retries: 3
script: |
github.request("POST /repos/{owner}/{repo}/releases", {
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${{ env.ZUDOKU_VERSION }}`,
draft: false,
prerelease: false,
generate_release_notes: true,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
});
const { default: release } = await import('${{ github.workspace }}/.github/workflows/release.js')
await release({ github, context, core })
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
@@ -214,8 +204,8 @@ jobs:
echo "[View Stats](https://cdn.zudoku.dev/build/rollup/${{ github.run_id }}-${{ github.run_attempt }}/stats.html)" >> $GITHUB_STEP_SUMMARY
# Trigger updates of internal projects using Zudoku
- run: gh workflow run release.yaml --repo zuplo-poc/docs-zudoku --ref main
- run: gh workflow run update-zudoku.yaml --repo zuplo/docs --ref main
# Only for non-prerelease
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GH_SECRET_TRIGGER_POC_WORKFLOWS }}
GITHUB_TOKEN: ${{ secrets.GH_SECRET_TRIGGER_DOCS_WORKFLOWS }}
63 changes: 63 additions & 0 deletions .github/workflows/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
export default async function runRelease({ github, context }) {
const { ZUDOKU_VERSION } = process.env;
const { owner, repo } = context.repo;
const tag_name = `v${ZUDOKU_VERSION}`;
const eventName = context.eventName;

const releases = await github.paginate(github.rest.repos.listReleases, {
owner,
repo,
per_page: 100,
});

const shared = {
owner,
repo,
tag_name,
generate_release_notes: true,
};

const existingPrerelease = releases.find((r) => r.prerelease);

if (eventName === "workflow_dispatch") {
await github.rest.repos.createRelease({
...shared,
name: tag_name,
prerelease: false,
});

if (!existingPrerelease) return;

await github.rest.repos.deleteRelease({
owner,
repo,
release_id: existingPrerelease.id,
});
} else {
if (existingPrerelease) {
const lastRelease = releases.find((r) => !r.prerelease);

// Release notes are not re-generated if the release is updated so we do it manually
const releaseNotes = await github.rest.repos.generateReleaseNotes({
owner,
repo,
tag_name,
previous_tag_name: lastRelease.tag_name,
});

await github.rest.repos.updateRelease({
...shared,
release_id: existingPrerelease.id,
body: releaseNotes.data.body,
prerelease: true,
});
return;
}

await github.rest.repos.createRelease({
...shared,
name: "Upcoming release",
prerelease: true,
});
}
}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.env
coverage

# Eslint
.eslintcache
@@ -18,6 +19,7 @@ lerna-debug.log*
dist
tmp
/out-tsc
pagefind/

# dependencies
node_modules
@@ -66,4 +68,7 @@ gha-creds-*.json


# Vercel
.vercel
.vercel

vite.config.*.timestamp*
vitest.config.*.timestamp*
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -4,9 +4,11 @@ coverage/
node_modules/
packages/zudoku/lib/
packages/zudoku/standalone/
packages/zudoku/src/app/demo-cdn.html
/.nx/cache
/.nx/workspace-data
pnpm-lock.yaml
.next/
stats.html
.vercel/
.vercel/
examples/many-apis/apis/
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 20.18.0
nodejs 22.14.0
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "0.2.0",
"inputs": [
{
"type": "promptString",
"description": "The example to use",
"id": "example",
"default": "with-config"
}
],
"configurations": [
{
"type": "node",
"request": "launch",
"name": "zudoku:build",
"env": {
"NODE_ENV": "development"
},
"smartStep": true,
"runtimeExecutable": "nx",
"args": ["run", "${input:example}:build", "--debugPort=9229"],
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"sourceMaps": true,
"resolveSourceMapLocations": [
"${workspaceFolder}/apps/**/dist/**",
"${workspaceFolder}/packages/**/dist/**",
"${workspaceFolder}/sdks/**/dist/**",
"${workspaceFolder}/test-fixtures/**/dist/**",
"!**/node_modules/**"
]
}
]
}
28 changes: 21 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Contributing

## Setup
## 1. Clone Project

- [Fork the repository](https://github.com/Hyperfoil/Horreum/fork)

- Clone the project locally

```bash
git clone https://github.com/your_github_username/zudoku.git
```

- Change the working directory

```
cd zudoku
```

## 2. Project Setup

Run `pnpm install` to install dependancies.

@@ -12,33 +28,31 @@ To install nx globally run:
pnpm add --global nx@latest
```

## Environment Variables
## 3. Environment Variables

When working on Zudoku, you will need to create a `.env` file in the root of the project and set the following environment variable in order to run the project locally.

```
ZUDOKU_INTERNAL_DEV=true
```

## NX Cache

If you are a Zuplo employee you should authenticate to NX Cloud in order to use the build cache.
> [!IMPORTANT] If you are a Zuplo employee you should authenticate to NX Cloud in order to use the build cache.
To authenticate run:

```
nx login
```

## Build
## 4. Build

To build the project run:

```
nx run zudoku:build
```

## Dev
## 5. Dev

To run a sample locally, run the following.

8 changes: 3 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -5,14 +5,12 @@
"scripts": {
"dev": "zudoku dev",
"build": "zudoku build",
"preview": "zudoku preview",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"devDependencies": {
"@mdx-js/react": "3.0.1",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "catalog:",
"react-dom": "catalog:",
"zudoku": "workspace:*"
}
}
33 changes: 29 additions & 4 deletions docs/pages/app-quickstart.md
Original file line number Diff line number Diff line change
@@ -6,12 +6,37 @@ sidebar_icon: app-window-mac

The recommended way to get started with Zudoku is to use the `create-zudoku-app` CLI tool. This tool will scaffold a new Zudoku site for you to customize and build upon.

You will need [Node.js](https://nodejs.org/) installed to use the CLI.
# Prerequisites

1. In your terminal run the following command
You will need [Node.js](https://nodejs.org/) installed to use the CLI. Zudoku requires Node.js version 22 or higher.

## Install Zudoku

### Windows

1. Open your terminal (Command Prompt or PowerShell).
2. Run the following command to create a new Zudoku app:

```bash
npx create-zudoku-app
```

#### MacOS

1. Open your terminal (you can use the built-in Terminal app).
2. Run the following command to create a new Zudoku app:

```bash
npx create-zudoku-app
```

#### Linux

1. Open your terminal (you can use the built-in Terminal app).
2. Run the following command to create a new Zudoku app:

```bash
npm create zudoku-app@latest
npx create-zudoku-app
```

The generator will take you through the setup steps and scaffold a minimal but fully functional documentation site for you to get started with.
@@ -30,4 +55,4 @@ If your OpenAPI file is in JSON format you can create an `openapi.json`. Set the
npm run dev
```

You now have a fully functional Zudoku site running on your local machine. Next, commit your changes to a source repository and [deploy the site](/docs/deployment) to your hosting provider or CDN.
You now have a fully functional Zudoku site running on your local machine. Next, commit your changes to a source repository and [deploy the site](./deployment.md) to your hosting provider or CDN.
Loading