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

Include in angular project #2

Open
aaweb opened this issue Mar 17, 2023 · 16 comments
Open

Include in angular project #2

aaweb opened this issue Mar 17, 2023 · 16 comments

Comments

@aaweb
Copy link

aaweb commented Mar 17, 2023

Hey guys
Great project! I had a chat with Thomas Gabathuler about integrating this into one of our Angular apps.

However, I struggle to add it to my Angular 15 project.

I tried with various "target" settings in the compiler options of the "tsconfig.json", but no luck.

Do you have any recommended settings for the target and module?

On https://github.com/bitmark-standard/bitmark-grammar the Last Update is on 13 March 2022 with version 1.0.32. On npm and when I do normal "npm i bitmark-grammar" I get 1.0.4, which is also on https://www.npmjs.com/package/bitmark-grammarsteht.

Kind regards

@stefanszasz
Copy link
Contributor

Hi @aaweb,

Currently we (GetMoreBrain) don't integrate the bitmark-grammar in our front-end; we only use it from server-side only, so I don't have experience in setting this up. Maybe @nodayoshikazu can help more with setting this up? not sure...

On https://github.com/bitmark-standard/bitmark-grammar the Last Update is on 13 March 2022 with version 1.0.32. On npm and when I do normal "npm i bitmark-grammar" I get 1.0.4

Indeed, the readme is not up to date so it can be confusing. We can have 2 approaches with this:

  1. would be nice to get it updated whenever we push/publish a new package; eg: from our publishing CircleCI pipeline... or
  2. we don't set this version in the readme at all, otherwise we need to update it most of the time. I don't think we need to keep this info there IMO, we already have the last updated from git and GitHub npm packages.

Regarding the packages, we keep the packages in GitHub: https://github.com/bitmark-standard/bitmark-grammar/pkgs/npm/bitmark-grammar - we'll remove the npmjs package so please you can use npm install @bitmark-standard/bitmark-grammar. @nodayoshikazu @timothyylim I think it's safe to remove the npmjs package

@timothyylim
Copy link
Contributor

Very fair answer, @stefanszasz! However, let's keep the npmjs package up as it's the most common way for packages to be downloaded. @aaweb, we're working on bringing npmjs in line with the current version.

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 21, 2023 via email

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 21, 2023 via email

@timothyylim
Copy link
Contributor

Hi @nodayoshikazu, let's take this internally.

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 21, 2023 via email

@aaweb
Copy link
Author

aaweb commented Mar 22, 2023

Hey guys

Thanks for checking and the info.

@stefanszasz

I tried both using the normal npm install @bitmark-standard/bitmark-grammar command as well as npm install @bitmark-standard/bitmark-grammar@1.0.34that was stated on https://github.com/bitmark-standard/bitmark-grammar/pkgs/npm/bitmark-grammar. Or can I also download the package there (I cannot download the asset there on the right or anywhere on that page – maybe I'm doing something wrong)?

https://github.com/bitmark-standard/bitmark-grammar/pkgs/npm/bitmark-grammar

bash-3.2$ npm install @bitmark-standard/bitmark-grammar@1.0.34
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bitmark-standard%2fbitmark-grammar - Not found
npm ERR! 404 
npm ERR! 404  '@bitmark-standard/bitmark-grammar@1.0.34' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/andy/.npm/_logs/2023-03-22T17_38_20_462Z-debug-0.log
bash-3.2$ npm install @bitmark-standard/bitmark-grammar
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bitmark-standard%2fbitmark-grammar - Not found
npm ERR! 404 
npm ERR! 404  '@bitmark-standard/bitmark-grammar@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/andy/.npm/_logs/2023-03-22T17_42_13_631Z-debug-0.log

I assume this is because you are still working on getting it back into the npm registy. Please let me know once there is a way to get it via npm or even just another way to add it to my project to test it with. You can also write me on Hackathon Slack (Andy Abgottspon)

@stefanszasz
Copy link
Contributor

Hi @aaweb,

In the meantime @nodayoshikazu made the package available on npmjs.com (https://www.npmjs.com/package/bitmark-grammar) based on @timothyylim 's input:

Very fair answer, @stefanszasz! However, let's keep the npmjs package up as it's the most common way for packages to be downloaded. @aaweb, we're working on bringing npmjs in line with the current version.

In any case, the 404 problem you were describing has to do with the default way of npm searching for packages in npmjs.com. Since this package was served from GitHub, you can create your .npmrc file with this content:
@bitmark-standard:registry=https://npm.pkg.github.com; this should solve the 404 for non-npmjs package(s), but would not be needed anymore since it will be hosted on npmjs.

@aaweb
Copy link
Author

aaweb commented Mar 22, 2023

Thanks so much, guys. This now worked and I could install it as expected!

In my use case, I would need bitmark to be on the client side (Angular app). This would be entirely possible from what I can tell in the source, the only problem seems to be the dependency to 'fs', which I don't think is needed if you pass in a string and not read it from the file system. Would this be something for you guys to consider?

My use case will be to use an AI language model to print back Bitmark in real-time and parse/show this on the page. I already got this working with Markdown where I wrote my own Markdown to JSON parser, so this should be pissible.

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 23, 2023 via email

@aaweb
Copy link
Author

aaweb commented Mar 24, 2023

Hey Yoshi

That would be amazing. Is there a way I can already use this during the Bitmark hackathon this weekend?

Even if it's not already super packaged and everything, I could just hack it in as long as we can get it running (probably would not even have to be the most recent version, whatever works for you).

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 24, 2023 via email

@nodayoshikazu
Copy link
Collaborator

Andy, I sent you the package via slack.

@gaba-getmorebrain
Copy link
Collaborator

gaba-getmorebrain commented Mar 24, 2023 via email

@nodayoshikazu
Copy link
Collaborator

nodayoshikazu commented Mar 24, 2023 via email

@gaba-getmorebrain
Copy link
Collaborator

gaba-getmorebrain commented Mar 24, 2023 via email

nodayoshikazu added a commit that referenced this issue Apr 12, 2023
nodayoshikazu added a commit that referenced this issue Apr 19, 2023
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

No branches or pull requests

5 participants