jmurphyau / ember-truth-helpers

Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array
MIT License
706 stars 95 forks source link

Can't `npm i` master branch to use with `ember-template-imports` #181

Closed jgadbois closed 1 year ago

jgadbois commented 1 year ago

We're upgrading our project to use ember-template-imports. The master branch README indicates support for single file components.

However when I try to npm i the package from the master branch I get the following error.

npm ERR! npm ERR! [build] npmnpm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! [build]  WARN using --force Recommended protections disabled.
npm ERR! npm ERR! [build]
npm ERR! npm ERR! [build] > ember-truth-helpers@3.1.1 build
npm ERR! npm ERR! [build] > rollup --config
npm ERR! npm ERR! [build]
npm ERR! npm ERR! [copyDoc]
npm ERR! npm ERR! [copyDoc] > ember-truth-helpers@3.1.1 copyDoc
npm ERR! npm ERR! [copyDoc] > cp ../../*.md .
npm ERR! npm ERR! [copyDoc]
npm ERR! npm ERR! [copyDoc] npm run copyDoc exited with code 0
npm ERR! npm ERR! [build]
npm ERR! npm ERR! [build]  → dist...
npm ERR! npm ERR! [build] [!] Error: Cannot find module '@babel/plugin-proposal-object-rest-spread'
npm ERR! npm ERR! [build] Require stack:
npm ERR! npm ERR! [build] - /Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup-plugin-ts/dist/esm/index.js
npm ERR! npm ERR! [build]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! npm ERR! [build]     at resolve (node:internal/modules/cjs/helpers:108:19)
npm ERR! npm ERR! [build]     at getDefaultBabelOptions (file:///Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup-plugin-ts/src/transpiler/babel.ts:112:7)
npm ERR! npm ERR! [build]     at Object.options (file:///Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup-plugin-ts/src/plugin/typescript-plugin.ts:291:22)
npm ERR! npm ERR! [build]     at getProcessedInputOptions (/Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup/dist/shared/rollup.js:26967:34)
npm ERR! npm ERR! [build]     at getInputOptions (/Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup/dist/shared/rollup.js:26955:35)
npm ERR! npm ERR! [build]     at rollupInternal (/Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup/dist/shared/rollup.js:26897:72)
npm ERR! npm ERR! [build]     at build (/Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup/dist/bin/rollup:1541:20)
npm ERR! npm ERR! [build]     at runRollup (/Users/john/.npm/_cacache/tmp/git-cloneXDWBiB/node_modules/rollup/dist/bin/rollup:1664:21)
npm ERR! npm ERR! [build]
npm ERR! npm ERR! [build]
npm ERR! npm ERR! [build] npm ERR! Lifecycle script `build` failed with error:
npm ERR! npm ERR! [build] npm ERR! Error: command failed
npm ERR! npm ERR! npm ERR!   in workspace: ember-truth-helpers@3.1.1
SergeAstapov commented 1 year ago

@jgadbois this is expected that you get an error, because this add-on was converted to v2 format in #147 and it's not a monorepo so you can't point to the master or any other branch (because actual addon code is located in packages /ember-truth-helpers folder)

instead, you can use master-dist branch: on every commit to master, addon gets build and pushed to master-dist branch with the exact same contents that would be published to nom otherwise.

hen, you may do in your package.json something like

"ember-truth-helpers": "https://github.com/jmurphyau/ember-truth-helpers.git#master-dist",

this is not a recommended way of doing things and should be used with caution, hence I doubt it worth to add such instruction to readme.

as for "how it's made" - that functionality was added in https://github.com/jmurphyau/ember-truth-helpers/pull/180

hope it helps!

jgadbois commented 1 year ago

Got it, thanks!