Skip to content

Commit

Permalink
Fixing release workflow and getApp logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwalter committed May 31, 2021
1 parent 4622f1e commit 8b3a325
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/big-meals-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ianwalter/nrg": patch
"@ianwalter/nrg-validation": patch
---

Fixing release workflow and getApp logic
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
fetch-depth: 0
- name: Install
run: yarn
- name: Build
run: yarn build
- name: Changesets
uses: changesets/action@b3300fad33b6ab794313da28d27424c0e2f78991
with:
Expand Down
10 changes: 7 additions & 3 deletions packages/nrg/lib/utilities/getApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ module.exports = async function getApp (input) {
if (appPath.includes('.mjs') || input.packageJson.type === 'module') {
const modulize = require('@generates/modulizer')
const requireFromString = require('require-from-string')
const cwd = path.dirname(appPath)
const { cjs } = await modulize({ input: appPath, cjs: true, cwd })
return requireFromString(cjs[1], appPath)
const [cjs] = await modulize({
input: appPath,
cjs: true,
cwd: path.dirname(appPath),
skipWrite: true
})
return requireFromString(cjs.source, appPath)
}
return require(appPath)
}

0 comments on commit 8b3a325

Please sign in to comment.