Skip to content

Commit

Permalink
Added logic for determining context.esmWarning
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <jaid.jsx@gmail.com>
  • Loading branch information
Jaid committed Sep 28, 2021
1 parent 9b84626 commit a0c823b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ import readUsageOptions from "./lib/readUsageOptions.js"
* @prop {string} tldwVersion
*/

// TODO Implement ESM warning

const cwd = process.cwd()

/**
Expand Down Expand Up @@ -209,6 +207,7 @@ const job = async args => {
script: "npm run test",
})
}
context.esmWarning = pkg.type === "module" && (pkg.webpackConfigJaid?.endsWith?.("Lib") || pkg.webpackConfigJaid?.endsWith?.("Class")) // If this is true, the package is an ESM library
context.hasExampleSection = Boolean(context.example || context.fragments.example)
context.hasDevelopmentSection = Boolean(context.fragments.development) || hasContent(context.developmentScripts)
context.hasOptionsSection = hasUsageOptions || Boolean(context.fragments.options)
Expand Down

0 comments on commit a0c823b

Please sign in to comment.