Skip to content

Fix stackblitz issue#626

Merged
yamcodes merged 5 commits intomainfrom
fix-stackblitz-issue
Dec 26, 2025
Merged

Fix stackblitz issue#626
yamcodes merged 5 commits intomainfrom
fix-stackblitz-issue

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Dec 26, 2025

Closes #617

Summary by CodeRabbit

  • New Features

    • Added a new StackBlitz example for ArkEnv featuring interactive setup, type-safe environment variable validation, hot reloading during development, and step-by-step guidance for configuration.
  • Chores

    • Updated demo links and project workspace configuration to incorporate the new StackBlitz example.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
arkenv Ready Ready Preview, Comment Dec 26, 2025 1:12am

@changeset-bot
Copy link

changeset-bot bot commented Dec 26, 2025

⚠️ No Changeset found

Latest commit: ade7c97

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added docs Improvements or additions to documentation example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) www Improvements or additions to arkenv.js.org labels Dec 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

Walkthrough

This change establishes a dedicated Stackblitz example by creating a new examples/stackblitz directory with proper configuration, removing the non-functional dev:example script from existing examples, and updating the video demo component to point to the new Stackblitz example URL.

Changes

Cohort / File(s) Summary
Stackblitz example removal from existing projects
apps/playgrounds/node/package.json, examples/basic/package.json
Removed dev:example script and stackblitz config object with startCommand reference
New Stackblitz-specific example
examples/stackblitz/.env, examples/stackblitz/.gitignore, examples/stackblitz/README.md, examples/stackblitz/index.ts, examples/stackblitz/package.json, examples/stackblitz/tsconfig.json
Created dedicated Stackblitz example with environment configuration (using ts-node instead of tsx), typed env validation, documentation, and build tooling
Video demo URL update
apps/www/components/page/video-demo.tsx
Updated StackBlitz click handler URL to point from basics example to new examples/stackblitz path
Workspace configuration
arkenv.code-workspace
Added examples/stackblitz folder entry to workspace folders array

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Fix playground #189: Modifies the same VideoDemo component (apps/www/components/page/video-demo.tsx) for StackBlitz example integration and usage.

Suggested labels

example, www

Poem

🐰 A fresh Stackblitz nest, so bright and clean,
Where ts-node thrives where tsx has been,
Old scripts fade, new examples arise,
Typed envs validated before our eyes,
The demo points true—no more compile cries! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix stackblitz issue' is vague and generic, using non-descriptive terms that don't convey specific information about what was actually fixed in the changeset. Consider a more specific title like 'Create new StackBlitz example with proper Node.js compatibility' to better describe the primary changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses the core objectives from issue #617 by creating a new StackBlitz example with ts-node instead of tsx, removing problematic Node.js 24 requirement, and updating the homepage link.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the StackBlitz issue: creating the new example directory, updating video demo link, removing old config, and updating workspace settings.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-stackblitz-issue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ME, simplifying it to point to the basic example.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
apps/www/components/page/video-demo.tsx (1)

50-50: Consider updating the title bar text to match the new example path.

The browser chrome displays "basic — index.ts" but the URL now points to the examples/stackblitz directory. While the content is still a basic example, updating this to "stackblitz — index.ts" would maintain consistency.

Proposed update
-					<div className="mx-auto text-xs font-mono text-gray-600 dark:text-gray-300 select-none">
-						basic — index.ts
-					</div>
+					<div className="mx-auto text-xs font-mono text-gray-600 dark:text-gray-300 select-none">
+						stackblitz — index.ts
+					</div>
examples/stackblitz/.env (1)

1-3: Consider adding NODE_ENV for demonstration completeness.

The .env file defines DEBUGGING, HOST, and PORT, but omits NODE_ENV. While NODE_ENV has a default value in the schema ('development'), explicitly including it would better demonstrate the complete environment variable setup for users learning from this example.

Suggested addition
 DEBUGGING=true
 HOST=localhost
 PORT=3000
+NODE_ENV=development
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3303d41 and 92299c4.

⛔ Files ignored due to path filters (2)
  • examples/stackblitz/package-lock.json is excluded by !**/package-lock.json
  • examples/with-bun-react/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • apps/playgrounds/node/package.json
  • apps/www/components/page/video-demo.tsx
  • arkenv.code-workspace
  • examples/basic/package.json
  • examples/stackblitz/.env
  • examples/stackblitz/.gitignore
  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
  • examples/stackblitz/tsconfig.json
💤 Files with no reviewable changes (2)
  • apps/playgrounds/node/package.json
  • examples/basic/package.json
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Prefer type over interface for type definitions in TypeScript
Use TypeScript 5.1+ features when appropriate
Leverage const type parameters for better inference in TypeScript
Use JSDoc comments for public APIs
Use tabs for indentation (configured in Biome)
Use double quotes for strings (configured in Biome)
Organize imports automatically (Biome handles this)
Avoid explicit types when TypeScript can infer them (noInferrableTypes error)
Use as const where appropriate for immutable values (useAsConstAssertion error)
Don't reassign function parameters (noParameterAssign error)
Place default parameters last in function signatures (useDefaultParameterLast error)
Always initialize enum values (useEnumInitializers error)
Declare one variable per statement (useSingleVarDeclarator error)
Avoid unnecessary template literals (noUnusedTemplateLiteral error)
Prefer Number.parseInt over global parseInt (useNumberNamespace error)
Use kebab-case for TypeScript filenames (e.g., create-env.ts)
Use camelCase for function names (e.g., createEnv)
Use PascalCase for type names (e.g., ArkEnvError)
Use UPPER_SNAKE_CASE for environment variables and constants
Include examples in JSDoc comments when helpful for public APIs
Document complex type logic with JSDoc comments
Use ArkEnvError for environment variable validation errors
Provide clear, actionable error messages that include the variable name and expected type

**/*.{ts,tsx}: Use createEnv(schema) function (or default import as arkenv) to create validated environment objects in TypeScript
Use built-in validators (host, port, url, email) from ArkEnv when available instead of custom ArkType schemas
Provide default values for optional environment variables using ArkType syntax (e.g., 'boolean = false')
Use ArkEnvError for environment variable errors instead of generic Error types
For environment schema definition, use ArkType string literal syntax for enumerated values (e.g., "'deve...

Files:

  • apps/www/components/page/video-demo.tsx
  • examples/stackblitz/index.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use self-closing JSX elements (useSelfClosingElements error)

Files:

  • apps/www/components/page/video-demo.tsx
apps/www/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/www/.cursor/rules/posthog-integration.mdc)

apps/www/**/*.{ts,tsx,js,jsx}: If using TypeScript, use an enum to store feature flag names. If using JavaScript, store feature flag names as strings to an object declared as a constant to simulate an enum. Use UPPERCASE_WITH_UNDERSCORE naming convention for enum/const object members.
If a custom property for a person or event is referenced in two or more files or two or more callsites in the same file, use an enum or const object with UPPERCASE_WITH_UNDERSCORE naming convention, similar to feature flags.

Files:

  • apps/www/components/page/video-demo.tsx
{bin,examples,playgrounds}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Console usage is allowed in bin/ and example/playground directories, otherwise treated as warning

Files:

  • examples/stackblitz/index.ts
**/index.ts

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use barrel exports (index.ts) for package entry points

Files:

  • examples/stackblitz/index.ts
examples/*/package.json

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Examples in examples/ directory are not published, may have their own lock files, and are used as test fixtures

Files:

  • examples/stackblitz/package.json
**/package.json

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use workspace:* protocol for workspace dependencies between packages

Files:

  • examples/stackblitz/package.json
🧠 Learnings (31)
📓 Common learnings
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 132
File: packages/arkenv/README.md:13-14
Timestamp: 2025-09-09T17:37:19.650Z
Learning: For yamcodes/arkenv project: Runtime support documentation should link to specific examples: Node.js (examples/basic), Bun (examples/with-bun), Vite (examples/with-vite-react-ts).
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript 5.1+ features when appropriate

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Organize imports automatically (Biome handles this)

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Leverage `const` type parameters for better inference in TypeScript

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for public APIs

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Avoid explicit types when TypeScript can infer them (`noInferrableTypes` error)

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Avoid unnecessary template literals (`noUnusedTemplateLiteral` error)

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use `as const` where appropriate for immutable values (`useAsConstAssertion` error)

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Prefer tree-shakeable exports for better bundling

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx,html,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild` for bundling

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.ts : Use `bun --hot` to run TypeScript entry files with hot module reloading enabled

Applied to files:

  • examples/stackblitz/tsconfig.json
📚 Learning: 2025-09-09T17:37:19.650Z
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 132
File: packages/arkenv/README.md:13-14
Timestamp: 2025-09-09T17:37:19.650Z
Learning: For yamcodes/arkenv project: Runtime support documentation should link to specific examples: Node.js (examples/basic), Bun (examples/with-bun), Vite (examples/with-vite-react-ts).

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Keep environment variable schemas readable and TypeScript-like using ArkType syntax

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : Use ArkEnvError for environment variable errors instead of generic Error types

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : Use `createEnv(schema)` function (or default import as `arkenv`) to create validated environment objects in TypeScript

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : Provide default values for optional environment variables using ArkType syntax (e.g., 'boolean = false')

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable validation errors

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Document environment requirements in README files for new features or integrations

Applied to files:

  • examples/stackblitz/README.md
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : For environment schema definition, use ArkType string literal syntax for enumerated values (e.g., "'development' | 'production' | 'test'")

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: ArkType validates environment variables at runtime and TypeScript types are inferred from the schema definition

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Convert ArkType validation errors to `ArkEnvError` for user-friendly error messages that include variable name and expected type

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Use ArkType's `type()` function to define schemas in environment variable definitions

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Leverage ArkType's built-in types (e.g., `string.host`, `number.port`) where possible in environment schemas

Applied to files:

  • examples/stackblitz/README.md
  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:04:58.629Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:58.629Z
Learning: Applies to apps/playgrounds/bun/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use `dotenv` library

Applied to files:

  • examples/stackblitz/.gitignore
📚 Learning: 2025-11-24T16:04:47.583Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: apps/playgrounds/bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-24T16:04:47.583Z
Learning: Applies to apps/playgrounds/bun-react/**/*.{ts,tsx,js,jsx} : Bun automatically loads .env files, so don't use the dotenv package

Applied to files:

  • examples/stackblitz/.gitignore
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : Use descriptive environment variable names that indicate purpose and format (e.g., DATABASE_URL, NODE_ENV, FEATURE_FLAG)

Applied to files:

  • examples/stackblitz/.gitignore
  • examples/stackblitz/.env
  • examples/stackblitz/index.ts
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{test,integration.test}.{ts,tsx} : Mock `process.env` in unit tests to test different environment variable scenarios

Applied to files:

  • examples/stackblitz/.env
📚 Learning: 2025-12-23T07:09:57.082Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T07:09:57.082Z
Learning: Applies to **/*.{ts,tsx} : Use built-in validators (host, port, url, email) from ArkEnv when available instead of custom ArkType schemas

Applied to files:

  • examples/stackblitz/index.ts
📚 Learning: 2025-12-22T19:44:07.593Z
Learnt from: yamcodes
Repo: yamcodes/arkenv PR: 596
File: examples/basic/index.ts:4-5
Timestamp: 2025-12-22T19:44:07.593Z
Learning: In examples/basic/index.ts: Use explicit ArkType syntax (e.g., "string.ip | 'localhost'", "0 <= number.integer <= 65535") instead of built-in validators (string.host, number.port) to showcase ArkType's type system capabilities for educational purposes.

Applied to files:

  • examples/stackblitz/index.ts
  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:04:11.901Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-11-24T16:04:11.901Z
Learning: Applies to examples/*/package.json : Examples in examples/ directory are not published, may have their own lock files, and are used as test fixtures

Applied to files:

  • examples/stackblitz/package.json
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Leverage ArkType's type inference for TypeScript types instead of manual type definitions

Applied to files:

  • examples/stackblitz/package.json
🪛 LanguageTool
examples/stackblitz/README.md

[style] ~84-~84: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 2045 characters long)
Context: ...ed in the console. Congratulations! 🎉 You've just added a new enviro...

(EN_EXCESSIVE_EXCLAMATION)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test-e2e (a11y)
  • GitHub Check: test-e2e (e2e)
  • GitHub Check: test-build (latest)
🔇 Additional comments (4)
examples/stackblitz/.gitignore (1)

1-1: LGTM! Appropriate for a StackBlitz demo example.

The negation rule !.env force-includes the .env file, which is correct for this StackBlitz example where the .env contains only safe demo values (DEBUGGING=true, HOST=localhost, PORT=3000) needed for the example to run out-of-the-box.

apps/www/components/page/video-demo.tsx (1)

25-25: LGTM! URL correctly updated to new StackBlitz example.

The StackBlitz URL now points to the new dedicated examples/stackblitz path, which aligns with the PR objectives.

arkenv.code-workspace (1)

122-126: LGTM! Workspace entry correctly added.

The new StackBlitz example is properly integrated into the workspace with consistent naming and positioning.

examples/stackblitz/index.ts (1)

1-19: LGTM! Excellent example implementation.

The code effectively demonstrates ArkEnv's capabilities:

  • Uses explicit ArkType syntax ("string.ip | 'localhost'", "0 <= number.integer <= 65535") to showcase the type system
  • Provides appropriate default values for optional variables
  • Follows project conventions for environment variable naming
  • Clear, educational structure perfect for a tutorial example

Based on coding guidelines requiring explicit ArkType syntax in examples to showcase type system capabilities.

"dependencies": {
"arkenv": "^0.8.0",
"arktype": "^2.1.29",
"zod": "4.1.13"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Remove unused zod dependency.

The zod dependency is declared but not imported or used in index.ts. The example only uses arkenv and arktype.

Proposed fix
 	"dependencies": {
 		"arkenv": "^0.8.0",
-		"arktype": "^2.1.29",
-		"zod": "4.1.13"
+		"arktype": "^2.1.29"
 	},
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"zod": "4.1.13"
"dependencies": {
"arkenv": "^0.8.0",
"arktype": "^2.1.29"
},
🤖 Prompt for AI Agents
In examples/stackblitz/package.json around line 13, the zod dependency is
declared but unused; remove the "zod": "4.1.13" entry from the dependencies to
avoid an unused dependency. Update package.json by deleting that zod line and
ensure package.json remains valid JSON (commas adjusted), then run a quick
install or lint to confirm no references remain.

Comment on lines 60 to 66
3. #### Copy the `.env.example` file to `.env`

To keep the development server running, run this command in a new terminal window:

```bash
cp .env.example .env
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incorrect file reference: .env.example does not exist.

The documentation references copying .env.example to .env, but the repository only includes .env (which is tracked via .gitignore negation). This will cause confusion for users following the tutorial.

Proposed fix

Update the documentation to reflect the actual file structure. Since .env is already tracked and contains example values:

-3. #### Copy the `.env.example` file to `.env`
+3. #### The `.env` file already contains example values

-   To keep the development server running, run this command in a new terminal window:
-
-   ```bash
-   cp .env.example .env
-   ```
+   The `.env` file in this example is pre-configured with example values for demonstration purposes.

Alternatively, rename .env to .env.example and update the .gitignore accordingly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
3. #### Copy the `.env.example` file to `.env`
To keep the development server running, run this command in a new terminal window:
```bash
cp .env.example .env
```
3. #### The `.env` file already contains example values
The `.env` file in this example is pre-configured with example values for demonstration purposes.
🤖 Prompt for AI Agents
examples/stackblitz/README.md lines 60-66: the README instructs users to copy a
non-existent `.env.example` to `.env`; update the docs to reflect the repository
state by removing the cp command and replace it with a single sentence stating
that `.env` is already present and pre-configured with example values for
demonstration, or alternatively, if you prefer the original workflow, rename the
existing `.env` to `.env.example` and adjust .gitignore accordingly; implement
the chosen change so the README accurately matches the repo.

@yamcodes yamcodes merged commit 15477a0 into main Dec 26, 2025
13 of 14 checks passed
@yamcodes yamcodes deleted the fix-stackblitz-issue branch December 26, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation example Issues or Pull Requests concerning at least one ArkEnv example. (Found in the `examples/` directory) www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stackblitz example isn't running well

1 participant