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

How to build?? #943

Open
nkosi23 opened this issue Feb 8, 2021 · 1 comment
Open

How to build?? #943

nkosi23 opened this issue Feb 8, 2021 · 1 comment

Comments

@nkosi23
Copy link

nkosi23 commented Feb 8, 2021

First of all, thank you for this project, it is really impressive. After spending a day studying the router and appreciating its elegance, I wanted to get started with prototyping but couldn't find release builds (the traditional .js and .min.js files often distributed as a convenience for such projects). Now my problem is that as a non-javascript developer, I do not have a javascript development environment set up and know close to nothing about setting up one with node, npm & cie. I am therefore struggling to get the ball rolling.

Package(s)

  • router
  • all router plugins (ideally but not necessary as I am not sure I will actually use them)

What I'm trying to do

I am trying to get started using the routing library. I need a single-file output that can be easily referenced from web pages (.js and .min.js files).

What I've tried

I have read up and installed node, npm and the typescript package, but apparently the tsc command isn't shipping with this package. So I navigated to the folder of the routing package (the source code from github, not the files coming with the npm package), and tried running npm install -D ts-node but I get an error saying:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @profiscience/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^4.33.0" from @profiscience/[email protected]
npm ERR!   packages/router
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from [email protected]
npm ERR! node_modules/karma-webpack
npm ERR!   dev karma-webpack@"^5.0.0" from @profiscience/[email protected]
npm ERR!   packages/router
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 

My thinking is that I need to run node tsc build.ts in order to build everything, which is the reason I went that way. My goal is to have the output in a single file that I can easily include in my web page using a script tag.

Alternatively (and to be honest), I am really not interested in setting up a JS environment 😄 so if someone could send me .js and .min.js build files for the router that I can rapidly use, I would be very grateful. I am mainly a .NET guy, using typescript in an msbuild context (ie. in my applications, I launch tsc using an msbuild task). We never need to use nodejs-based webdev tooling in this ecosystem. So I am quite lost at the minute, all I hope to do is get started using this inspiring library 👍

@nkosi23
Copy link
Author

nkosi23 commented Feb 8, 2021

I have been able to fix the build issue by changing the karma-webpack package version from "5.0.0" down to "4.0.2" in /router/packages.json. This has allowed me to install ts-node using the command npm install ts-node. I was then able to build the project by running npm run build in the project root.

That being said, this didn't merge the output of the various files into a single file, neither did it produce a typescript definition file. So for time being, I will simply include the source code of the router in my projects I guess.

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

1 participant