Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add "publish" GHA #11

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

JakobJingleheimer
Copy link
Member

@JakobJingleheimer JakobJingleheimer commented Dec 12, 2024

Todo:

  • Set up repo secret for codemod
  • Each recipe being published needs to be bundled and then sent to the codemod registry. Thereafter, the bundle generated by CI can be discarded.

Copy link

@Copilot 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.

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/publish.yml:40

  • The node-version value 'node' is ambiguous. It should be a specific version number or range, like '14' or '14.x'.
node-version: node

.github/workflows/publish.yml Outdated Show resolved Hide resolved
.github/workflows/publish.yml Outdated Show resolved Hide resolved
@AugustinMauroy

This comment was marked as resolved.

@JakobJingleheimer JakobJingleheimer force-pushed the setup/publishing branch 2 times, most recently from fe81da4 to e28a8b4 Compare December 22, 2024 13:51
Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGTM !

@JakobJingleheimer
Copy link
Member Author

There are a few issues blocking this:

  • bundling via esbuild encounters a platform-specific node addon used by ast-grep, which can't be bundled
    • codemod publish doesn't have a programmatic API, so it'll need leverage spawn
  • codemod publish can handle the bundling but doesn't support distributed config, and the bundle it builds errors (transformer cannot be null)
    • there's not much documentation around what it's doing (they're working on it)

@JakobJingleheimer
Copy link
Member Author

  • the bundle it builds errors (transformer cannot be null)

This turned out to be a red-herring: it was actually throwing when it got to module.register('@nodejs-loaders', import.meta.url) because when codemod publish builds the bundle (also via esbuild), esbuild does not realise there is a dependency it needs to include. evanw/esbuild#4016

Comment on lines +4 to +8
const opts: BuildOptions = {
format: 'esm',
};

export default opts;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const opts: BuildOptions = {
format: 'esm',
};
export default opts;
export default {
format: 'esm',
} as BuildOptions;

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.

2 participants