jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.69k stars 517 forks source link

V3 : core package does not support ES6 JSCAD designs #1166

Open z3dev opened 2 years ago

z3dev commented 2 years ago

Expected Behavior

New designs with use the ES6-based packages (V3+) are supported. This includes both single file designs as well as projects with several components.

Actual Behavior

Fails

Steps to Reproduce the Problem

  1. Convert simple design to use ES6 import / exports
  2. Use CLI to convert design to STL, etc.
  3. BIG FAILURE

Specifications

z3dev commented 2 years ago

One option for cli to work would be to have a cmdline option to say if it is es6 script that needs to run, or "old" .

hrgdavor commented 1 year ago

I am piggybacking on this issue for now to raise awareness of the fact that we will have problems recognizing v2 and v3 scripts if we keep the same package name: @jscad/modeling.

if it is a single file script and not a node project that has package.json there is no way to know if this is a V2 or a V3 script.

hrgdavor commented 1 year ago

I was discussing the problem of recognizing V2 and V3 scripts with @platypii and we agreed that a good way to do this and move forward would be to assume scritps that use require are V2, and esm improt or typescript are V3.