Skip to content

Add .js extensions to ES module imports in @object-ui/core#347

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-action-step-error-one-more-time
Feb 2, 2026
Merged

Add .js extensions to ES module imports in @object-ui/core#347
hotlong merged 2 commits intomainfrom
copilot/fix-action-step-error-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 2, 2026

Node.js ES modules require explicit file extensions. The compiled output was using directory imports (export * from './types') which fail at runtime with "Directory import is not supported resolving ES modules".

Changes

  • Added .js extension to all relative imports/exports in @object-ui/core source files:

    • src/index.ts - main barrel exports
    • src/*/index.ts - module barrel exports
    • src/evaluator/ExpressionEvaluator.ts, src/registry/*.ts - internal imports
  • Removed stale .js and .d.ts files from src/ (build artifacts belong in dist/)

Before:

export * from './types/index';
export * from './registry/Registry';

After:

export * from './types/index.js';
export * from './registry/Registry.js';

TypeScript preserves the .js extensions during compilation, satisfying Node.js ESM requirements while maintaining moduleResolution: "bundler" for development.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21583346523/job/62185434639#step:9:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 2, 2026

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

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 2, 2026 9:41am
objectui-components Ready Ready Preview, Comment Feb 2, 2026 9:41am
objectui-crm-app Error Error Feb 2, 2026 9:41am

Request Review

…orts

- Add .js extension to all relative imports in @object-ui/core package
- Remove stale compiled .js and .d.ts files from src/ directory
- Fixes CI test failures: "Directory import is not supported resolving ES modules"

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in action step execution Add .js extensions to ES module imports in @object-ui/core Feb 2, 2026
Copilot AI requested a review from hotlong February 2, 2026 09:15
@hotlong hotlong marked this pull request as ready for review February 2, 2026 09:17
Copilot AI review requested due to automatic review settings February 2, 2026 09:17
@hotlong hotlong merged commit 296e1d2 into main Feb 2, 2026
4 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds .js extensions to ES module imports in @object-ui/core to fix Node.js runtime errors. The package uses "type": "module" which requires explicit file extensions for ES modules. TypeScript preserves these .js extensions during compilation.

Changes:

  • Added .js extensions to all relative imports/exports in barrel files (index.ts) and internal TypeScript imports
  • Removed stale build artifacts (.js and .d.ts files) from the src/ directory that should only exist in dist/

Reviewed changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/validation/validators/index.ts Added .js extension to object-validation-engine import
packages/core/src/validation/schema-validator.js Deleted build artifact from src/
packages/core/src/validation/schema-validator.d.ts Deleted build artifact from src/
packages/core/src/validation/index.ts Added .js extensions to all module exports
packages/core/src/utils/filter-converter.js Deleted build artifact from src/
packages/core/src/utils/filter-converter.d.ts Deleted build artifact from src/
packages/core/src/types/index.js Deleted build artifact from src/
packages/core/src/types/index.d.ts Deleted build artifact from src/
packages/core/src/registry/PluginSystem.ts Added .js extensions to internal imports
packages/core/src/registry/PluginScopeImpl.ts Added .js extension to Registry import
packages/core/src/query/index.ts Added .js extension to query-ast export
packages/core/src/index.ts Added .js extensions to all barrel exports
packages/core/src/index.js Deleted build artifact from src/
packages/core/src/index.d.ts Deleted build artifact from src/
packages/core/src/evaluator/index.ts Added .js extensions to all module exports
packages/core/src/evaluator/ExpressionEvaluator.ts Added .js extensions to internal imports
packages/core/src/builder/schema-builder.js Deleted build artifact from src/
packages/core/src/builder/schema-builder.d.ts Deleted build artifact from src/
packages/core/src/adapters/index.js Deleted build artifact from src/
packages/core/src/adapters/index.d.ts Deleted build artifact from src/
packages/core/src/actions/index.ts Added .js extension to ActionRunner export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants