Skip to content

Conversation

@AndrewRayCode
Copy link
Contributor

This removes the reliance on global variables and uses a modern commonjs syntax. I have not yet introduced ES6 syntax into this project so it's a smaller change (as in babel is not required).

Note this only fixes the npm build and I have not attempted to change the files in the build/ folder. The grunt code will need to be updated to handle the new syntax, instead of an array of file names in strings.

This is a minor modernization of the project. You shouldn't require
users to have global versions of packages installed. Using npm scripts
means the grunt command will be available when the npm script is run.

Note the indentation of package.json has changed to two spaces. This is
because of the use of the automatic command `npm install --save-dev
grunt`. Note any automatic npm command will change the spacing to 2
spaces, so I think it's best to keep it this way.

Additionally this adds missing grunt plugins to the packages, which
presumably you had installed along with your global grunt.
This is a first step to modernizing the codebase and to make it work
with npm. Ticket squarefeet#95 currently tracks the npm build process.
Related to issue squarefeet#95, the source code of this project relies on the use
of the global SPE variable and the global THREE variable. This makes it
hard to track what files use what dependencies. Plus the javascript
community has moved to commonjs or es6 module syntax for good reason. It
makes it easier to work on projects. Relying on the order of a file
included in an array of strings is not ideal for dependency management.

This also removes the SPE namespace from files which felt redundant, and
also mirrors the elimination of the SPE namespace attachments used
inside those files.

This namespaces all of the objects in a central place src/index.js and
exports that as main from package.json
@squarefeet
Copy link
Owner

Closing in favour of #136

@squarefeet squarefeet closed this Jun 28, 2020
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

Successfully merging this pull request may close these issues.

2 participants