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

Support for cjs extension in global and local data files #848

Merged
merged 7 commits into from
Mar 20, 2020

Conversation

gloryofrobots
Copy link
Contributor

Implements support of .cjs (common js) extension in global and local data files as requested in #837 Places .cjs before .js in priority ordering for local files. For global data order, I need to wait while #821 gets merged.
Changes are very trivial in both the TemplateData.js and tests but a lot of tests were changed due to local data file lists checks.

@zachleat
Copy link
Member

Now that #821 is merged do we need to make additional changes here?

@gloryofrobots
Copy link
Contributor Author

I need to add some changes to this PR based on #821 approval and resolve conflicts. I probably will commit a new version on weekend

@gloryofrobots
Copy link
Contributor Author

gloryofrobots commented Feb 2, 2020

There is a bug in a new version of the ava test runner. It injects some custom stuff into require.extensions and breaks require() so it can not load cjs files. I will try to make a fix for ava but for now, I can't push my code

@zachleat
Copy link
Member

zachleat commented Feb 4, 2020

Oh well that’s terrible @gloryofrobots!

Some discussion about this here avajs/ava#2293

@zachleat zachleat added the bug: dependency A problem in one of Eleventy’s dependencies label Feb 4, 2020
@gloryofrobots
Copy link
Contributor Author

I made a PR for ava (or to be precise for a small project in the ava domain) which is hopefully will fix the problem. But I do not know when it will be merged. The good news is that because it is not a fix for Ava itself but for Ava dependency the adoption may be faster.

@gloryofrobots
Copy link
Contributor Author

Ava team merged my fix! I will update this branch soon

# Conflicts:
#	package.json
#	src/TemplateData.js
#	test/UserDataExtensionsTest.js
#	test/stubs-630/_data/mergingGlobalData.js
#	test/stubs-630/_data/mergingGlobalData.json
#	test/stubs-630/_data/mergingGlobalData.nosj
#	test/stubs-630/_data/mergingGlobalData.yaml
@gloryofrobots
Copy link
Contributor Author

Ok, work is done. I bumped ava/babel version in package.json to 1.0.1 to include fix for the bug mentioned above.

@gloryofrobots
Copy link
Contributor Author

Fixed new conflicts

@zachleat zachleat added enhancement and removed bug: dependency A problem in one of Eleventy’s dependencies labels Mar 20, 2020
@zachleat zachleat merged commit 47b0e15 into 11ty:master Mar 20, 2020
@zachleat
Copy link
Member

YESSSSS Thank you for your awesome work here, including going above and beyond and fixing a dependency too! Wow!

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

Successfully merging this pull request may close these issues.

2 participants