Skip to content

fix: install Sourcey where config imports can resolve it - #1

Draft
HelloWorldSagwa wants to merge 1 commit into
sourcey:mainfrom
HelloWorldSagwa:fix/local-sourcey-install
Draft

fix: install Sourcey where config imports can resolve it#1
HelloWorldSagwa wants to merge 1 commit into
sourcey:mainfrom
HelloWorldSagwa:fix/local-sourcey-install

Conversation

@HelloWorldSagwa

Copy link
Copy Markdown

Summary

  • install the requested Sourcey version locally in the checked-out workspace
    instead of globally
  • invoke that exact local binary so sourcey.config.ts can resolve its
    documented import { defineConfig, ... } from "sourcey"
  • pass config, spec, output, and extra arguments through a Bash array so paths
    containing spaces remain intact
  • add a smoke workflow that runs this action against a real TypeScript config
    and verifies the generated HTML and search index

Problem

The action currently installs Sourcey globally and then runs sourcey build.
With Sourcey 3.6.5, the documented config-file usage fails before the build:

Error: No "exports" main defined in .../sourcey/package.json

The CLI is available globally, but the TypeScript config is loaded from the
consumer repository and imports sourcey. Installing the package in that
repository makes the import resolvable from the config's module scope.

Verification

  • reproduced the failure with the current global-install behavior and the
    documented sourcey.config.ts import
  • built the fixture successfully after a local Sourcey 3.6.5 install
  • generated index.html and search-index.json
  • verified an output directory containing a space is preserved correctly
  • parsed both action.yml and the smoke workflow as YAML

The install uses --no-save --package-lock=false, so it does not add Sourcey
to the consumer's manifest or create/update a package lock. The generated docs
and output-dir contract are unchanged.

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.

1 participant