Last 12 weeks · 0 commits
6 of 6 standards met
Hey Kent, thanks for this awesome plugin, been using it for years and it's really handy! Also saw you got in a car accident recently and I hope you're not too beat up and recovering well. I've been following this feature which just got merged to babel: https://github.com/babel/babel/pull/14065 I think that might be useful for this plugin to implement. It could allow us to invalidate the codegen output if the code has a dependency on some files on disk. It seems pretty simple to utilize the new feature, if I'm right you just call where is a filepath. https://github.com/babel/babel/pull/14065/files#diff-02893c5f57e6e79d081162d32cbfe84ccfac5ed70b8933be563e1dd7256f179cR15 Here's an example of a codegen module whose result depends on files on the filesystem, and could benefit from external dependency awareness: Right now we resort to updating the timestamp comment to force an invalidation + codegen rebuild. (Maybe there's a better way that I don't know about?) I'm not sure the internals of this library but do you think it makes sense to implement? I might be able to take a stab at implementing it. Let me know if you have any pointers. Thanks!
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by , this is the branch or tag ref that was pushed. For workflows triggered by , this is the pull request merge branch. For workflows triggered by , this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is , for pull requests it is , and for tags it is . For example, . https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
Repository: kentcdodds/babel-plugin-codegen. Description: 💥 Generate code at build-time Stars: 349, Forks: 26. Primary language: TypeScript. Languages: TypeScript (94.5%), JavaScript (5.5%). License: MIT. Homepage: https://www.npmjs.com/package/babel-plugin-codegen Latest release: v4.1.5 (4y ago). Open PRs: 1, open issues: 8. Last activity: 2y ago. Community health: 85%. Top contributors: kentcdodds, allcontributors[bot], karanjthakkar, MichaelDeBoey, loynoir, andrewmcodes, calebeby, djfarly, jdorfman, silvenon and others.
TypeScript
What: Adds support for to load and codegen the main export of an npm module. Fixes #47. Why: I've created a reusable codegen which works great. However, once I published & consume the codegen as an npm module (), it no longer works. More details in #47. How: Node's built-in algorithm supports both relative paths, and module name specifiers. The second argument to allows specifying where to begin the search, which mirrors the existing behaviour, but adds the ability to load modules from up the tree (should even work in monorepos!). Checklist: [x] ~Documentation~ n/a [ ] Tests. ?? How would I test this? [x] Ready to be merged
I've created a reusable codegen which works great (thanks for the library!). However, once I published & consume the codegen as an npm module (), it no longer works: See an example on codesandbox It looks like the code for loading / statements is hard-coded to assume a relative path is always passed: https://github.com/kentcdodds/babel-plugin-codegen/blob/664b96c57d1f2ede88acef6da1606df0bcd834bc/src/helpers.ts#L101-L111 Suggested fix** I'm not 100% sure how the lookup is meant to work here, but perhaps this could be replaced with the module to take into account both relative imports and module-style ones?
First of all, thanks for an amazing plugin! version: 4.0.1 version: 12.14.1 version: 6.13.4 What you did: Importing a javascript file and including its contents in generated code, using in watch mode or and . What happened: The contents of the imported file is output correctly, but changes to the imported file that happens after was started are ignored until is shut down and started again. Changing the file that does the code generation does not cause the import to update. Steps to reproduce are described in the README of the below repo. Reproduction repository: https://github.com/asbjornh/babel-plugin-codegen-watch Problem description: For some reason it seems like imports are read once and then never again when running in watch mode. Suggested solution: