Coder Social home page Coder Social logo

Programmatic use not working about boats HOT 5 CLOSED

Papooch avatar Papooch commented on September 21, 2024
Programmatic use not working

from boats.

Comments (5)

p-mcgowan avatar p-mcgowan commented on September 21, 2024 1

the issue is main in package.json doesn't point to build/src but src, which doesn't exist after an install.

steps to repro

mkdir test
cd test
npm init --yes
npm i boats
node -p 'require("boats")'

from boats.

j-d-carmichael avatar j-d-carmichael commented on September 21, 2024

Hi,

Could you show some code of how you're importing?

Thanks,
John

from boats.

p-mcgowan avatar p-mcgowan commented on September 21, 2024

although that won't fix it anyway - it looks like the index exports the default key from 4 files, so it won't work anyway.

You would have to do something like require('boats/build/src/Template').default in order to use those files

from boats.

j-d-carmichael avatar j-d-carmichael commented on September 21, 2024

Dang!

I'm pretty slammed at the moment so not sure i have the time until next month... PR would be very welcomed :)

from boats.

j-d-carmichael avatar j-d-carmichael commented on September 21, 2024

@Papooch I've decided as I don't have time to work on this feature to instead remove programmatic use.

If you would like to expose boats in a programmatic way a PR would be welcomed.

The section of boats to expose would be:
https://github.com/j-d-carmichael/boats/blob/main/src/cli.ts#L55
to
https://github.com/j-d-carmichael/boats/blob/main/src/cli.ts#L77

Ideally, the cli.ts file would call a new function or class named "boats" and the package.json would both export the types and the said file.

I would imagine something like added to the package json file:

  "main": "build/src/boats.js",
  "typings": "build/src/boats.d.ts",

For now though, there is no longer an export and I will close this PR.

from boats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.