Skip to content

Commit

Permalink
Fix running format:ci, lint:ci in action (#606)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Lehr <[email protected]>
  • Loading branch information
ntotten and dan-lee authored Feb 4, 2025
1 parent 161d139 commit a5df23a
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 352 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
ignorePatterns: ["dist", ".eslintrc.cjs", "packages/config/src/index.d.ts"],
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: {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

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

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

- name: Get Variables
id: vars
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

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

- Clone the project locally
- Clone the project locally

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

- Change the working directory

```
cd zudoku
```
Expand All @@ -34,10 +35,11 @@ When working on Zudoku, you will need to create a `.env` file in the root of the
```
ZUDOKU_INTERNAL_DEV=true
```
> [!IMPORTANT]
> 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
```
Expand Down
5 changes: 1 addition & 4 deletions examples/with-auth0/zudoku.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const config: ZudokuConfig = {
},
],
},
protectedRoutes: [
"/documentation/installation",
"/api/**",
],
protectedRoutes: ["/documentation/installation", "/api/**"],
redirects: [{ from: "/", to: "/documentation/introduction" }],
docs: {
files: "/pages/**/*.mdx",
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"type": "module",
"scripts": {
"build": "nx run-many -t=build -p zudoku config",
"mismatches": "syncpack list-mismatches",
"lint": "eslint --cache --fix .",
"lint:ci": "eslint .",
"format": "prettier --write .",
Expand Down Expand Up @@ -46,7 +45,6 @@
"nx": "20.3.3",
"prettier": "3.4.2",
"prettier-plugin-organize-imports": "4.1.0",
"syncpack": "13.0.1",
"typescript": "5.7.3"
},
"pnpm": {
Expand All @@ -60,5 +58,13 @@
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
},
"nx": {
"includedScripts": [
"lint",
"lint:ci",
"format",
"format:ci"
]
}
}
62 changes: 31 additions & 31 deletions packages/zudoku/src/app/demo-cdn.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/svg+xml"
href="https://cdn.zudoku.dev/logos/favicon.svg"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
/>
<title>Zudoku Demo</title>
<script
type="module"
crossorigin
src="https://cdn.zudoku.dev/latest/demo.js"
></script>
<link
rel="stylesheet"
crossorigin
href="https://cdn.zudoku.dev/latest/style.css"
/>
<script>
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init push capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init('phc_l8rjm0vHBMwNdGeBRDrK8UIYjyVxZyBAtnYo2hS18OY',{api_host:'https://us.i.posthog.com', person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
})
</script>
</head>
<body>
<div id="root"></div>
</body>
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/svg+xml"
href="https://cdn.zudoku.dev/logos/favicon.svg"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
/>
<title>Zudoku Demo</title>
<script
type="module"
crossorigin
src="https://cdn.zudoku.dev/latest/demo.js"
></script>
<link
rel="stylesheet"
crossorigin
href="https://cdn.zudoku.dev/latest/style.css"
/>
<script>
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init push capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init('phc_l8rjm0vHBMwNdGeBRDrK8UIYjyVxZyBAtnYo2hS18OY',{api_host:'https://us.i.posthog.com', person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
})
</script>
</head>
<body>
<div id="root"></div>
</body>
</html>
3 changes: 1 addition & 2 deletions packages/zudoku/src/cli/common/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export async function printTableToConsoleAndExitGracefully(table: any) {

interface WriteStreamWithHandle {
_handle: {
// eslint-disable-next-line @typescript-eslint/ban-types
setBlocking: Function;
setBlocking: (blocking: boolean) => void;
};
isTTY: boolean;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/zudoku/src/cli/dev/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export async function dev(argv: Arguments) {
void exit();
});
process.on("unhandledRejection", (e) => {
if (e instanceof DOMException && e.name === "AbortError") {
// eslint-disable-next-line no-console
console.log(`[Abort] ${e.message}`);
return;
}

// eslint-disable-next-line no-console
console.error("Unhandled rejection", e);
void exit();
Expand Down
3 changes: 1 addition & 2 deletions packages/zudoku/src/lib/ui/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from "react";
import { cn } from "../util/cn.js";

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;

const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/zudoku/src/vite/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from "@vitejs/plugin-react";
import { type PluginOption } from "vite";
import { vitePluginSsrCss } from "./css/plugin.js";
import { LoadedConfig, type ZudokuPluginOptions } from "../config/config.js";
import { vitePluginSsrCss } from "./css/plugin.js";
import viteApiKeysPlugin from "./plugin-api-keys.js";
import viteApiPlugin from "./plugin-api.js";
import viteAuthPlugin from "./plugin-auth.js";
Expand Down
Loading

0 comments on commit a5df23a

Please sign in to comment.