generator-jscad 2.2.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/generators/app/index.js +16 -6
- package/generators/app/templates/_gitignore +4 -1
- package/generators/app/templates/_gitlab-ci.yml +3 -0
- package/generators/app/templates/_vitepress/config.mjs +26 -0
- package/generators/app/templates/_vitepress/theme/components/VuepressOpenJscad.vue +17 -0
- package/generators/app/templates/_vitepress/theme/custom.css +6 -0
- package/generators/app/templates/_vitepress/theme/index.js +13 -0
- package/generators/app/templates/gulpfile.js +26 -23
- package/generators/app/templates/main-checkbox.jscad +17 -1
- package/generators/app/templates/package.json +20 -16
- package/package.json +1 -1
- package/CHANGELOG.md +0 -68
- package/generators/.DS_Store +0 -0
- package/generators/app/templates/_vuepress/components/VuepressOpenJscad.vue +0 -14
- package/generators/app/templates/_vuepress/config.js +0 -10
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ You can select the type of project you want to build. A single object project is
|
|
|
21
21
|
|
|
22
22
|

|
|
23
23
|
|
|
24
|
-
You can also create a
|
|
24
|
+
You can also create a VitePress site with a live viewer.
|
|
25
25
|
|
|
26
26
|

|
|
27
27
|
|
package/generators/app/index.js
CHANGED
|
@@ -127,8 +127,8 @@ module.exports = class extends Generator {
|
|
|
127
127
|
this.props.projectType == 'single'
|
|
128
128
|
? 'main.jscad'
|
|
129
129
|
: this.props.projectType == 'multi-list'
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
? 'main-list.jscad'
|
|
131
|
+
: 'main-checkbox.jscad';
|
|
132
132
|
this.fs.copyTpl(
|
|
133
133
|
this.templatePath(template),
|
|
134
134
|
this.destinationPath(this.props.name + '.jscad'),
|
|
@@ -143,13 +143,23 @@ module.exports = class extends Generator {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
this.fs.copy(
|
|
146
|
-
this.templatePath('
|
|
147
|
-
this.destinationPath('.
|
|
146
|
+
this.templatePath('_vitepress/theme/components/VuepressOpenJscad.vue'),
|
|
147
|
+
this.destinationPath('.vitepress/theme/components/VuepressOpenJscad.vue')
|
|
148
148
|
);
|
|
149
149
|
|
|
150
150
|
this.fs.copy(
|
|
151
|
-
this.templatePath('
|
|
152
|
-
this.destinationPath('.
|
|
151
|
+
this.templatePath('_vitepress/theme/custom.css'),
|
|
152
|
+
this.destinationPath('.vitepress/theme/custom.css')
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
this.fs.copy(
|
|
156
|
+
this.templatePath('_vitepress/theme/index.js'),
|
|
157
|
+
this.destinationPath('.vitepress/theme/index.js')
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
this.fs.copy(
|
|
161
|
+
this.templatePath('_vitepress/config.mjs'),
|
|
162
|
+
this.destinationPath('.vitepress/config.mjs')
|
|
153
163
|
);
|
|
154
164
|
|
|
155
165
|
this.fs.copy(
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from 'vitepress'
|
|
2
|
+
|
|
3
|
+
// https://vitepress.dev/reference/site-config
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
title: "<%= name %>",
|
|
6
|
+
description: "<%= description %>",
|
|
7
|
+
srcDir: '.',
|
|
8
|
+
rewrites: {
|
|
9
|
+
'README.md': 'index.md'
|
|
10
|
+
},
|
|
11
|
+
themeConfig: {
|
|
12
|
+
// https://vitepress.dev/reference/default-theme-config
|
|
13
|
+
nav: [
|
|
14
|
+
{ text: 'Home', link: '/' }
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
socialLinks: [
|
|
18
|
+
{ icon: 'gitlab', link: 'https://gitlab.com/johnwebbcole/<%= name %>' }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
vite: {
|
|
22
|
+
ssr: {
|
|
23
|
+
noExternal: ['@jwc/vue-openjscad', 'debug']
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ClientOnly>
|
|
4
|
+
<OpenJscad v-bind="$attrs"></OpenJscad>
|
|
5
|
+
</ClientOnly>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { defineClientComponent } from 'vitepress';
|
|
11
|
+
|
|
12
|
+
const OpenJscad = defineClientComponent(() => {
|
|
13
|
+
return import('@jwc/vue-openjscad/')
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import DefaultTheme from 'vitepress/theme'
|
|
2
|
+
import './custom.css'
|
|
3
|
+
|
|
4
|
+
// Import your custom components
|
|
5
|
+
import VuepressOpenJscad from './components/VuepressOpenJscad.vue'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
extends: DefaultTheme,
|
|
9
|
+
enhanceApp({ app }) {
|
|
10
|
+
// Register global components
|
|
11
|
+
app.component('VuepressOpenJscad', VuepressOpenJscad)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/* globals import */
|
|
2
|
+
import { deleteSync } from 'del';
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import gulp from 'gulp';
|
|
5
|
+
import debug from 'gulp-debug';
|
|
6
|
+
import inject from 'gulp-inject';
|
|
7
|
+
import jscadFiles from 'gulp-jscad-files';
|
|
8
|
+
import { getInjected } from 'gulp-jscad-files/getPackage.js';
|
|
9
|
+
import plumber from 'gulp-plumber';
|
|
10
|
+
import terser from 'gulp-terser';
|
|
11
|
+
import merge2 from 'merge2';
|
|
12
|
+
|
|
13
|
+
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
10
14
|
|
|
11
|
-
var pkg = require('./package.json');
|
|
12
15
|
|
|
13
16
|
gulp.task('clean', function (done) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
17
|
+
const paths = deleteSync(['dist/*'])
|
|
18
|
+
console.log('Deleted files and folders:\n', paths.join('\n')); // eslint-disable-line no-console, no-undef
|
|
19
|
+
done();
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
gulp.task('inject', function () {
|
|
21
23
|
return gulp
|
|
22
24
|
.src('<%= name %>.jscad')
|
|
23
25
|
.pipe(plumber())
|
|
26
|
+
.pipe(debug({ title: 'start:' }))
|
|
24
27
|
.pipe(
|
|
25
28
|
inject(
|
|
26
29
|
merge2(
|
|
27
|
-
gulp.src(['*.jscad'], { ignore: ['<%= name %>.jscad'] }),
|
|
30
|
+
gulp.src(['*.jscad'], { ignore: ['<%= name %>.jscad'] }).pipe(debug({ title: 'src:' })),
|
|
28
31
|
gulp
|
|
29
32
|
.src('package.json')
|
|
30
33
|
.pipe(jscadFiles())
|
|
@@ -39,7 +42,7 @@ gulp.task('inject', function () {
|
|
|
39
42
|
max_line_len: 80
|
|
40
43
|
}
|
|
41
44
|
})
|
|
42
|
-
)
|
|
45
|
+
).pipe(debug({ title: 'package.json:' }))
|
|
43
46
|
).pipe(debug({ title: 'injecting:' })),
|
|
44
47
|
{
|
|
45
48
|
relative: true,
|
|
@@ -54,30 +57,30 @@ gulp.task('inject', function () {
|
|
|
54
57
|
.pipe(gulp.dest('dist'));
|
|
55
58
|
});
|
|
56
59
|
|
|
60
|
+
|
|
57
61
|
gulp.task(
|
|
58
|
-
'
|
|
59
|
-
gulp.series(
|
|
62
|
+
'vitepress',
|
|
63
|
+
gulp.series('inject', function () {
|
|
60
64
|
return gulp
|
|
61
65
|
.src('dist/<%= name %>.jscad')
|
|
62
|
-
.pipe(debug({ title: '
|
|
63
|
-
.pipe(gulp.dest('.
|
|
66
|
+
.pipe(debug({ title: 'vitepress:' }))
|
|
67
|
+
.pipe(gulp.dest('.vitepress/public/'));
|
|
64
68
|
})
|
|
65
69
|
);
|
|
66
70
|
|
|
67
71
|
gulp.task(
|
|
68
72
|
'default',
|
|
69
|
-
gulp.series(
|
|
73
|
+
gulp.series('clean', 'inject', function () {
|
|
70
74
|
gulp.watch(
|
|
71
75
|
['**/*.jscad', ...getInjected(pkg)],
|
|
72
76
|
{
|
|
73
|
-
verbose: true,
|
|
74
77
|
followSymlinks: true,
|
|
75
78
|
delay: 500,
|
|
76
79
|
queue: false,
|
|
77
80
|
ignoreInitial: false,
|
|
78
81
|
ignored: ['**/*.*~', 'dist/*', '.vuepress/*', 'public', 'node_modules']
|
|
79
82
|
},
|
|
80
|
-
gulp.series(
|
|
83
|
+
gulp.series('inject')
|
|
81
84
|
);
|
|
82
85
|
})
|
|
83
86
|
);
|
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
/* exported main, getParameterDefinitions */
|
|
7
7
|
|
|
8
|
+
/** @type {import('@jwc/jscad-utils')} JscadUtils */
|
|
9
|
+
var util;
|
|
10
|
+
|
|
8
11
|
function getParameterDefinitions() {
|
|
9
12
|
/**
|
|
10
13
|
* Add the keys to the `Parts` object
|
|
11
14
|
* here and they will be listed in the
|
|
12
15
|
* parameters.
|
|
16
|
+
* @type {Record<string, boolean>}
|
|
13
17
|
*/
|
|
14
18
|
var ENABLED = {
|
|
15
19
|
example1: true,
|
|
@@ -62,6 +66,18 @@ function getParameterDefinitions() {
|
|
|
62
66
|
}
|
|
63
67
|
];
|
|
64
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param {object} params
|
|
73
|
+
* @param {boolean} params.example1
|
|
74
|
+
* @param {boolean} params.example2
|
|
75
|
+
* @param {"0"|"1"|"2"|"3"|"4"} params.resolution
|
|
76
|
+
* @param {boolean} params.center
|
|
77
|
+
* @param {boolean} params.cutawayEnable
|
|
78
|
+
* @param {'x'|'y'|'z'} params.cutawayAxis
|
|
79
|
+
* @returns {CSG[]}
|
|
80
|
+
*/
|
|
65
81
|
function main(params) {
|
|
66
82
|
var start = performance.now();
|
|
67
83
|
var resolutions = [
|
|
@@ -80,7 +96,7 @@ function main(params) {
|
|
|
80
96
|
|
|
81
97
|
/**
|
|
82
98
|
* The `Parts` object needs to contain
|
|
83
|
-
* the values from the `
|
|
99
|
+
* the values from the `ENABLED` object.
|
|
84
100
|
*/
|
|
85
101
|
var Parts = {
|
|
86
102
|
example1: () => example1(),
|
|
@@ -6,31 +6,35 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "gulp",
|
|
8
8
|
"clean": "gulp clean",
|
|
9
|
-
"
|
|
9
|
+
"build": "gulp inject",
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"docs:dev": "vitepress dev",
|
|
12
|
+
"docs:build": "vitepress build",
|
|
13
|
+
"docs:preview": "vitepress preview"
|
|
13
14
|
},
|
|
14
15
|
"author": "<%= author %>",
|
|
15
16
|
"license": "ISC",
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@jwc/jscad-utils": "*",
|
|
18
|
-
"@jwc/jscad-hardware": "*"
|
|
19
|
-
},
|
|
20
17
|
"devDependencies": {
|
|
21
|
-
"@jscad/web": "
|
|
22
|
-
"@jwc/vue-openjscad": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"gulp
|
|
27
|
-
"gulp-
|
|
18
|
+
"@jscad/web": "^1.10.0",
|
|
19
|
+
"@jwc/vue-openjscad": "2.0.4",
|
|
20
|
+
"copy-dir": "0.3.0",
|
|
21
|
+
"cross-env": "10.0.0",
|
|
22
|
+
"del": "8.0.1",
|
|
23
|
+
"gulp": "5.0.1",
|
|
24
|
+
"gulp-cli": "3.1.0",
|
|
25
|
+
"gulp-debug": "5.0.1",
|
|
28
26
|
"gulp-inject": "^5.0.4",
|
|
29
27
|
"gulp-jscad-files": "^4.0.0",
|
|
30
28
|
"gulp-plumber": "^1.1.0",
|
|
31
|
-
"gulp-terser": "^
|
|
29
|
+
"gulp-terser": "^2.0.1",
|
|
32
30
|
"gulp-watch": "^5.0.1",
|
|
33
31
|
"merge2": "^1.3.0",
|
|
34
|
-
"
|
|
32
|
+
"vitepress": "2.0.0-alpha.12"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@jscad/scad-api": "0.5.1",
|
|
36
|
+
"@jwc/jscad-hardware": "3.3.0",
|
|
37
|
+
"@jwc/jscad-raspberrypi": "3.2.1",
|
|
38
|
+
"@jwc/jscad-utils": "4.9.0"
|
|
35
39
|
}
|
|
36
40
|
}
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
## 2.2.0 (2020-09-13)
|
|
2
|
-
|
|
3
|
-
* Add options for multiple part projects ([63005a5](https://gitlab.com/johnwebbcole/generator-jscad/commit/63005a5))
|
|
4
|
-
* Updating readme ([ed33447](https://gitlab.com/johnwebbcole/generator-jscad/commit/ed33447))
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## <small>2.1.2 (2019-01-12)</small>
|
|
9
|
-
|
|
10
|
-
* 2.1.2 ([44051d1](https://gitlab.com/johnwebbcole/generator-jscad/commit/44051d1))
|
|
11
|
-
* cicd changes ([decc610](https://gitlab.com/johnwebbcole/generator-jscad/commit/decc610))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## <small>2.1.1 (2019-01-12)</small>
|
|
16
|
-
|
|
17
|
-
* 2.1.1 ([0461e7c](https://gitlab.com/johnwebbcole/generator-jscad/commit/0461e7c))
|
|
18
|
-
* update watch to match v4 ([05d96f1](https://gitlab.com/johnwebbcole/generator-jscad/commit/05d96f1))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## 2.1.0 (2019-01-06)
|
|
23
|
-
|
|
24
|
-
* 2.1.0 ([d06e677](https://gitlab.com/johnwebbcole/generator-jscad/commit/d06e677))
|
|
25
|
-
* add vuepress and vue-openjscad ([5204f44](https://gitlab.com/johnwebbcole/generator-jscad/commit/5204f44))
|
|
26
|
-
* add vuepress and vue-openjscad ([dac022b](https://gitlab.com/johnwebbcole/generator-jscad/commit/dac022b))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## <small>2.0.2 (2018-12-24)</small>
|
|
31
|
-
|
|
32
|
-
* 2.0.2 ([7203c0e](https://gitlab.com/johnwebbcole/generator-jscad/commit/7203c0e))
|
|
33
|
-
* renamed dot template files ([d23e7a0](https://gitlab.com/johnwebbcole/generator-jscad/commit/d23e7a0))
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## <small>2.0.1 (2018-12-24)</small>
|
|
38
|
-
|
|
39
|
-
* 2.0.1 ([5208a2b](https://gitlab.com/johnwebbcole/generator-jscad/commit/5208a2b))
|
|
40
|
-
* add lodash ([e53a8f0](https://gitlab.com/johnwebbcole/generator-jscad/commit/e53a8f0))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## 2.0.0 (2018-12-24)
|
|
45
|
-
|
|
46
|
-
* 2.0.0 ([a805277](https://gitlab.com/johnwebbcole/generator-jscad/commit/a805277))
|
|
47
|
-
* add cicd ([d341b77](https://gitlab.com/johnwebbcole/generator-jscad/commit/d341b77))
|
|
48
|
-
* add release script ([e90810a](https://gitlab.com/johnwebbcole/generator-jscad/commit/e90810a))
|
|
49
|
-
* Added `node_modules` to watch list ([20d72d0](https://gitlab.com/johnwebbcole/generator-jscad/commit/20d72d0))
|
|
50
|
-
* Added readme to generator and moved one into the project. Camel cased the name to make it a valid o ([66880e6](https://gitlab.com/johnwebbcole/generator-jscad/commit/66880e6))
|
|
51
|
-
* added yarn files ([8c96cff](https://gitlab.com/johnwebbcole/generator-jscad/commit/8c96cff))
|
|
52
|
-
* changed to use new gulp-jscadfiles plugin ([567183f](https://gitlab.com/johnwebbcole/generator-jscad/commit/567183f))
|
|
53
|
-
* Fix gulp file, it needed to be a template. ([ccab77e](https://gitlab.com/johnwebbcole/generator-jscad/commit/ccab77e))
|
|
54
|
-
* Initial commit ([e43fb5b](https://gitlab.com/johnwebbcole/generator-jscad/commit/e43fb5b))
|
|
55
|
-
* no message ([857331c](https://gitlab.com/johnwebbcole/generator-jscad/commit/857331c))
|
|
56
|
-
* no message ([9572114](https://gitlab.com/johnwebbcole/generator-jscad/commit/9572114))
|
|
57
|
-
* no message ([bb05b43](https://gitlab.com/johnwebbcole/generator-jscad/commit/bb05b43))
|
|
58
|
-
* publish 1.0.1 ([8c26637](https://gitlab.com/johnwebbcole/generator-jscad/commit/8c26637))
|
|
59
|
-
* Rebuit using `generator-generator`. ([d7ea44e](https://gitlab.com/johnwebbcole/generator-jscad/commit/d7ea44e))
|
|
60
|
-
* removed fileExists dependency ([a239839](https://gitlab.com/johnwebbcole/generator-jscad/commit/a239839))
|
|
61
|
-
* reset version ([0932c0e](https://gitlab.com/johnwebbcole/generator-jscad/commit/0932c0e))
|
|
62
|
-
* updated dependencies ([93c19df](https://gitlab.com/johnwebbcole/generator-jscad/commit/93c19df))
|
|
63
|
-
* updated example, added readme from generator. ([b0df213](https://gitlab.com/johnwebbcole/generator-jscad/commit/b0df213))
|
|
64
|
-
* updated to use newer utils ([17b81ea](https://gitlab.com/johnwebbcole/generator-jscad/commit/17b81ea))
|
|
65
|
-
* Updating to use `jscad-utils` 2.0 ([7ca7621](https://gitlab.com/johnwebbcole/generator-jscad/commit/7ca7621))
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
package/generators/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<open-jscad v-bind="$attrs"></open-jscad>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
<script>
|
|
7
|
-
import OpenJscad from "@jwc/vue-openjscad";
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
name: "VuepressOpenJscad",
|
|
11
|
-
components: { OpenJscad },
|
|
12
|
-
inheritAttrs: false
|
|
13
|
-
};
|
|
14
|
-
</script>
|