alyssaxuu/flowy

Publish to npm

jerivas opened this issue ยท 15 comments

Would love to be able to npm install flowy to use with bundlers and unpkg.com

https://zellwk.com/blog/publish-to-npm/

Would be also good to have src and dist folders and some CI setup.

Could you need some asistance with this?

#37 is ready to merge to get this in place

@jerivas https://www.npmjs.com/package/flowy-engine has been published. v2 is in the works as a new NPM release in the future.

@joelvh
Hello, I did this:
npm i flowy-engine
but no luck
image
ERROR in libs/author/src/lib/prototype/editor.component.ts:8:24 - error TS2307: Cannot find module 'flowy-engine'.

@AsimNet please check the error, your Node version and that you import the module, not the main entry. See also https://unpkg.com/browse/flowy-engine@0.1.2/package.json.

could you please give me an example?
@DanielRuf

@AsimNet try import * as flowy from 'flowy-engine/flowy-engine.mjs.

same thing
ERROR in libs/author/src/lib/prototype/editor.component.ts:8:24 - error TS2307: Cannot find module 'flowy-engine/flowy-engine.mjs'.

@DanielRuf

Did you install it? Please check the content of your node_modules/flowy-engine. The source repo has nothing to do with the code on npmjs / unpkg (where you can see what you should have in your node_modules).

same thing

You didn't specify the exact error before, you provided only a screenshot of a text with a red line under it which is not that helpful.
Please check your node_modules folder to see which files can be imported / required.

It works for me:

โžœ  flowy-test npm i flowy-engine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN flowy-test@1.0.0 No description
npm WARN flowy-test@1.0.0 No repository field.

+ flowy-engine@0.1.2
added 1 package from 3 contributors and audited 1 package in 2.019s
found 0 vulnerabilities

โžœ  flowy-test code .
โžœ  flowy-test cat index.mjs 
import * as flowy from 'flowy-engine/flowy-engine.mjs';

console.log(flowy);%   
โžœ  flowy-test node --version
v10.16.3
โžœ  flowy-test nodenv versions
  system
  6.17.1
  8.16.0
  8.17.0
  9.11.2
  10.16.0
* 10.16.3 (set by /Users/danielruf/.nodenv/version)
  12.13.0
  13.5.0
โžœ  flowy-test nodenv local 13.5.0
โžœ  flowy-test node index.mjs 
(node:7408) ExperimentalWarning: The ESM module loader is experimental.
[Module] { default: [Function: e] }

Is the https://github.com/joelvh/flowy-engine "official" fork of npm feature?

@joelvh do you have any examples of the usage?

@vicmosin it's outdated and I decided not to pursue the work I started back then because there wasn't a desire by the maintainer to bring my updates into the project. I'm effectively waiting to see how much more the project gets updated, and if there's a desire in the future to use more tooling and accept contributions such as ES6 and so on.

However, it is a usable version from that point in time. The README has directions to build and run the demo. And there's the demo build in the repository as well.

For what it's worth, there's a React implementation as well that works in its own branch. And I was ambitious to refactor the whole thing.