You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

generator-jscad

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 2.0.0

CHANGELOG.md

198

generators/app/index.js

@@ -1,104 +0,118 @@

'use strict';
var generators = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var path = require('path');
var _ = require('lodash');
"use strict";
const Generator = require("yeoman-generator");
const chalk = require("chalk");
const yosay = require("yosay");
const path = require("path");
const camelCase = require("lodash/camelCase");
const commandExists = require("command-exists").sync;
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
},
prompting: function () {
var done = this.async();
module.exports = class extends Generator {
initializing() {
this.gitc = {
user: {
name: this.user.git.name(),
email: this.user.git.email()
}
};
}
console.log('config', this.config.getAll());
prompting() {
// Have Yeoman greet the user.
this.log(yosay(
'Welcome to the phenomenal ' + chalk.red('generator-jscad') + ' generator!'
));
this.log(
yosay(
`Welcome to the riveting ${chalk.red("generator-jscad")} generator!`
)
);
var prompts = [{
name: 'name',
message: 'Your project name',
default: this.config.get('name') || path.basename(process.cwd())
}, {
name: 'description',
message: 'Description',
default: this.config.get('description')
}, {
name: 'author',
message: 'Author',
default: this.config.get('author')
}];
const prompts = [
{
name: "name",
message: "Your project name",
default: this.config.get("name") || path.basename(process.cwd())
},
{
name: "description",
message: "Description",
default: this.config.get("description")
},
{
name: "author",
message: "Author",
default: this.config.get("author") || this.gitc.user.name
}
];
this.prompt(prompts, function (props) {
return this.prompt(prompts).then(props => {
// To access props later use this.props.someAnswer;
this.props = props;
// To access props later use this.props.someOption;
this.config.set('name', this.props.name);
this.config.set('description', this.props.description);
this.config.set('author', this.props.author);
this.config.set("name", this.props.name);
this.config.set("description", this.props.description);
this.config.set("author", this.props.author);
});
}
done();
}.bind(this));
},
writing() {
this.fs.copyTpl(
this.templatePath("gulpfile.js"),
this.destinationPath("gulpfile.js"),
{
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: camelCase(this.props.name)
}
);
writing: {
gulpfile: function () {
this.fs.copyTpl(
this.templatePath('gulpfile.js'),
this.destinationPath('gulpfile.js'), {
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: _.camelCase(this.props.name)
}
);
},
eslintrc: function () {
this.fs.copy(
this.templatePath('.eslintrc.json'),
this.destinationPath('.eslintrc.json')
);
},
packageJSON: function () {
this.fs.copyTpl(
this.templatePath('package.json'),
this.destinationPath('package.json'), {
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: _.camelCase(this.props.name)
}
);
},
readme: function () {
this.fs.copyTpl(
this.templatePath('README.md'),
this.destinationPath('README.md'), {
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: _.camelCase(this.props.name)
}
);
},
main: function () {
this.fs.copyTpl(
this.templatePath('main.jscad'),
this.destinationPath(this.props.name + '.jscad'), {
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: _.camelCase(this.props.name)
}
);
}
},
this.fs.copy(
this.templatePath(".eslintrc.js"),
this.destinationPath(".eslintrc.js")
);
install: function () {
this.fs.copy(
this.templatePath(".gitignore"),
this.destinationPath(".gitignore")
);
this.fs.copyTpl(
this.templatePath("package.json"),
this.destinationPath("package.json"),
{
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: camelCase(this.props.name)
}
);
this.fs.copyTpl(
this.templatePath("README.md"),
this.destinationPath("README.md"),
{
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: camelCase(this.props.name)
}
);
this.fs.copyTpl(
this.templatePath("main.jscad"),
this.destinationPath(this.props.name + ".jscad"),
{
name: this.props.name,
description: this.props.description,
author: this.props.author,
nameslug: camelCase(this.props.name)
}
);
}
install() {
this.npmInstall();
if (commandExists("git")) {
this.composeWith(require.resolve("generator-git-init"), {});
}
}
});
};
/* globals require */
var gulp = require('gulp');
var del = require('del');
var gulpLoadPlugins = require('gulp-load-plugins');
var plugins = gulpLoadPlugins();
var gulp = require("gulp");
var del = require("del");
var jscadFiles = require("gulp-jscad-files");
var merge2 = require("merge2");
var debug = require("gulp-debug");
var inject = require("gulp-inject");
var plumber = require("gulp-plumber");
var terser = require("gulp-terser");
gulp.task('clean', function (done) {
del(['dist/*']).then(paths => {
console.log('Deleted files and folders:\n', paths.join('\n')); // eslint-disable-line no-console, no-undef
gulp.task("clean", function(done) {
del(["dist/*"]).then(paths => {
console.log("Deleted files and folders:\n", paths.join("\n")); // eslint-disable-line no-console, no-undef
done();

@@ -14,27 +18,52 @@ });

gulp.task('inject', function () {
return gulp.src('<%= name %>.jscad')
.pipe(plugins.plumber())
.pipe(plugins.inject(
plugins.merge(
gulp.src('package.json').pipe(plugins.jscadFiles()),
gulp.src(['!<%= name %>.jscad', '*.jscad'])), {
relative: true,
starttag: '// include:js',
endtag: '// endinject',
transform: function (filepath, file) {
return '// ' + filepath + '\n' + file.contents.toString('utf8');
gulp.task("inject", function() {
return gulp
.src("<%= name %>.jscad")
.pipe(plumber())
.pipe(
inject(
merge2(
gulp.src(["*.jscad"], { ignore: ["<%= name %>.jscad"] }),
gulp
.src("package.json")
.pipe(jscadFiles())
.pipe(
terser({
ecma: 6,
keep_fnames: true,
mangle: false,
compress: false,
output: {
beautify: false,
max_line_len: 80
}
})
)
).pipe(debug({ title: "injecting:" })),
{
relative: true,
starttag: "// include:js",
endtag: "// endinject",
transform: function(filepath, file) {
return "// " + filepath + "\n" + file.contents.toString("utf8");
}
}
}))
.pipe(gulp.dest('dist'));
)
)
.pipe(gulp.dest("dist"));
});
gulp.task('default', ['clean', 'inject'], function () {
plugins.watch(['!**/*.*~', '!dist/*', '**/*.jscad', 'node_modules/'], {
verbose: true,
followSymlinks: true,
readDelay: 500
}, function () {
gulp.start('inject');
});
});
gulp.task(
"default",
gulp.series(["clean", "inject"], function() {
gulp.watch(
["!**/*.*~", "!dist/*", "**/*.jscad", "node_modules/"],
{
verbose: true,
followSymlinks: true,
readDelay: 500
},
gulp.series(["inject"])
);
})
);

@@ -7,2 +7,3 @@ {

"scripts": {
"start": "gulp",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -16,11 +17,13 @@ },

"devDependencies": {
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-inject": "^4.2.0",
"gulp-jscad-files": "^2.0.0",
"gulp-load-plugins": "^1.2.0",
"gulp-merge": "^0.1.1",
"del": "^3.0.0",
"gulp": "^4.0.0",
"gulp-cli": "^2.0.1",
"gulp-debug": "^4.0.0",
"gulp-inject": "^5.0.0",
"gulp-jscad-files": "^3.0.0",
"gulp-plumber": "^1.1.0",
"gulp-watch": "^4.3.5"
"gulp-terser": "^1.1.6",
"gulp-watch": "^5.0.1",
"merge2": "^1.2.3"
}
}

@@ -7,7 +7,8 @@ # <%= name %>

The jscad project `<%= name %>` uses gulp to create a `dist/<%= nameslug %>.jscad` file and watches your source for changes. You can drag the `dist/<%= nameslug %>.jscad` directory into the drop area on [openjscad.org](http://openjscad.org). Make sure you check `Auto Reload` and any time you save, gulp will recreate the `dist/<%= nameslug %>.jscad` file and your model should refresh.
The jscad project `<%= name %>` uses gulp to create a `dist/<%= nameslug %>.jscad` file and watches your source for changes. You can drag the `dist/<%= nameslug %>.jscad` directory into the drop area on [openjscad.org](http://openjscad.org). Make sure you check `Auto Reload` and any time you save, gulp creates the `dist/<%= nameslug %>.jscad` file, and your model should refresh.
## jscad-utils
The example project uses [jscad-utils](https://www.npmjs.com/package/jscad-utils). This is a set of utilities that make object creation and alignment easier. To remove it, `npm uninstall --save jscad-utils`.
The example project uses [jscad-utils](https://www.npmjs.com/package/jscad-utils). These utilities are a set of utilities that make object creation and alignment easier. To remove it, `npm uninstall --save jscad-utils`, and remove the
`util.init(CSG);` line in `<%= nameslug %>.jscad`.

@@ -25,2 +26,3 @@ ## Other libraries

}
### Gist

@@ -37,3 +39,3 @@

<openjscad.org> by using the following URL: <code>
<a href="http://openjscad.org/#">http://openjscad.org/#</a>
<a href="http://openjscad.org/#">http://openjscad.org/#</a>
</code> + the url to your file.</openjscad.org>

@@ -43,3 +45,3 @@

You can save your file to a github [gist](https://gist.github.com/) and append the url to the raw gist.
You can save your file to a github [gist](https://gist.github.com/) and append the URL to the raw gist.

@@ -46,0 +48,0 @@ For example: <http://openjscad.org/#https://gist.githubusercontent.com/johnwebbcole/43f2ef58532a204c694e5ada16888ecd/raw/d0972463f70222e6d4c6c6196a1c759bb3e2362a/snap.jscad>

{
"name": "generator-jscad",
"version": "1.1.0",
"version": "2.0.0",
"description": "Create a jscad project",
"homepage": "http://github.com/johnwebbcole/generator-jscad",
"homepage": "https://gitlab.com/johnwebbcole/generator-jscad",
"author": {
"name": "John Cole",
"email": "johnwebbcole@gmail.com",
"url": "http://github.com/johnwebbcole"
"url": "https://johnwebbcole.gitlab.io/"
},

@@ -16,11 +16,67 @@ "files": [

"keywords": [
"yeoman-generator",
"jscad"
"jscad",
"yeoman-generator"
],
"devDependencies": {
"conventional-changelog-cli": "^2.0.11",
"coveralls": "^3.0.2",
"eslint": "^5.9.0",
"eslint-config-prettier": "^3.3.0",
"eslint-config-xo": "^0.25.0",
"eslint-plugin-prettier": "^3.0.0",
"husky": "^1.2.0",
"jest": "^23.5.0",
"lint-staged": "^8.1.0",
"np": "^3.1.0",
"prettier": "^1.15.2",
"yeoman-assert": "^3.1.0",
"yeoman-test": "^1.7.0"
},
"engines": {
"npm": ">= 4.0.0"
},
"dependencies": {
"chalk": "^1.1.1",
"lodash": "^4.5.1",
"yeoman-generator": "^0.22.5",
"yosay": "^1.1.0"
}
"chalk": "^2.1.0",
"command-exists": "^1.2.8",
"generator-git-init": "^1.1.3",
"yeoman-generator": "^2.0.1",
"yosay": "^2.0.1"
},
"jest": {
"testEnvironment": "node"
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
],
"*.json": [
"prettier --write",
"git add"
]
},
"eslintConfig": {
"extends": [
"xo",
"prettier"
],
"env": {
"jest": true,
"node": true
},
"rules": {
"prettier/prettier": "error"
},
"plugins": [
"prettier"
]
},
"scripts": {
"pretest": "eslint .",
"test": "jest --coverage",
"version": "conventional-changelog -r 0 -o CHANGELOG.md && git add CHANGELOG.md",
"release": "np --no-yarn"
},
"repository": "https://gitlab.com/johnwebbcole/generator-jscad",
"license": "MIT"
}

@@ -7,3 +7,3 @@ # generator-jscad [![NPM version][npm-image]][npm-url]

First, install [Yeoman](http://yeoman.io) and generator-jscad using [npm](https://www.npmjs.com/) (assuming you have pre-installed [node.js](https://nodejs.org/)).
First, install [Yeoman](http://yeoman.io) and generator-jscad using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

@@ -23,3 +23,3 @@ ```bash

The jscad project uses gulp to create a `dist` directory and watches your source for changes. You can drag the `dist` directory into the drop area on [openjscad.org](http://openjscad.org). Make sure you check `Auto Reload` and any time you save, gulp will recreate the `dist` directory files and your model should refresh.
The jscad project uses gulp to create a `dist` directory and watch for changes. You can drag the `dist` directory into the drop area on [openjscad.org](http://openjscad.org). Make sure you check `Auto Reload` and any time you save, glup will recreate the `dist` directory files and your model should refresh.

@@ -32,5 +32,5 @@ ## jscad-utils

ISC © [John Cole](http://github.com/johnwebbcole)
MIT © [John Cole](https://johnwebbcole.gitlab.io/)
[npm-image]: https://badge.fury.io/js/generator-jscad.svg
[npm-url]: https://npmjs.org/package/generator-jscad
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc