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

feat: add capability to attach the supported modules #501

Conversation

harish-aka-shivi
Copy link
Contributor

Description

In the recent update of Docxtemplater version, it was not possible to conditionally attach the module. With this PR, only the compatible modules will be attached while constructing Docxtemplater instance.

closes #499

In previous the recent update it was not possible to conditionaly attach the module. With this PR it would be possible to attach the compatible modules depending on the file types.
Also update the moduleApiVersion across the project
@harish-aka-shivi harish-aka-shivi marked this pull request as ready for review March 4, 2020 05:00
Having a module varible can be a landmine in case we accidently do not declare module in args, then it will pick the common js module keyword.
es6/docxtemplater.js Outdated Show resolved Hide resolved
es6/docxtemplater.js Outdated Show resolved Hide resolved
es6/tests/modules.js Outdated Show resolved Hide resolved
es6/tests/modules.js Outdated Show resolved Hide resolved
es6/tests/modules.js Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
es6/docxtemplater.js Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
es6/docxtemplater.js Outdated Show resolved Hide resolved
@edi9999
Copy link
Member

edi9999 commented Mar 5, 2020

Prettier is failing on your MR, can you fix it ?

@harish-aka-shivi
Copy link
Contributor Author

Sure, looking into it.

@harish-aka-shivi
Copy link
Contributor Author

What are your thoughts on using git hooks to fix the linting before commit/push? If you are okay I can open an issue. I personally use husky for this.

@harish-aka-shivi
Copy link
Contributor Author

The prettier errors are fixed but check-casing is still failing. What does this script do, if you can explain broadly? I thinks this is also the reason for the failure of lint:fix

@edi9999
Copy link
Member

edi9999 commented Mar 5, 2020

The failure on travis is expected, since you don't have the access keys to travis.

The check casing verifies that all files use lowercase names and don't contain _, but a few files are allowed to be uppercased (README.md, CHANGELOG.md, ...)

@harish-aka-shivi harish-aka-shivi changed the title [WIP] feat: add capability to attach the supported modules feat: add capability to attach the supported modules Mar 6, 2020
@harish-aka-shivi
Copy link
Contributor Author

Hey,
Just a reminder that the Prettier issue is fixed. Is there anything else that needs to be done in this PR?
I still don't understand why check-casing is failing since I have not changed any filename. But that's okay I will try to figure it out.

@edi9999 edi9999 merged commit b1e2c8e into open-xml-templating:master Mar 9, 2020
@edi9999
Copy link
Member

edi9999 commented Mar 10, 2020

I've now merged your PR @harish-aka-shivi !

check-casing uses a lot of builtin commands that work on linux, probably some of them differ on macosx.

You could add

set -x just below set -euo pipefail

to see the last command that was executed, probably it fails because of a mac/unix difference.

@harish-aka-shivi
Copy link
Contributor Author

Yup, Surely I will try that

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.

Docxtemplater modules => allow to declare compatibilty with filetypes
2 participants