generator-jscad 2.2.0 → 3.0.0

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 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
  ![yo jscad cli example](./yo-jscad.gif)
23
23
 
24
- You can also create a VuePress site with a live viewer.
24
+ You can also create a VitePress site with a live viewer.
25
25
 
26
26
  ![example vuepress site](./example.gif)
27
27
 
@@ -19,4 +19,7 @@ coverage
19
19
 
20
20
  # Dependency directories
21
21
  node_modules/
22
- public
22
+ public
23
+
24
+ .vitepress/dist
25
+ .vitepress/cache
@@ -4,6 +4,9 @@ pages:
4
4
  script:
5
5
  - npm install
6
6
  - npm run build
7
+ - npm run docs:build
8
+ - mv .vitepress/dist public
9
+ - cp dist/PiPiece.jscad public/
7
10
  - ls -al -R public
8
11
  artifacts:
9
12
  paths:
@@ -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,6 @@
1
+ /* Custom styles for your VitePress site */
2
+
3
+ /* Add your custom CSS here */
4
+ .custom-component {
5
+ /* Example styles */
6
+ }
@@ -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
- var gulp = require('gulp');
2
- var del = require('del');
3
- var jscadFiles = require('gulp-jscad-files');
4
- var { getInjected } = require('gulp-jscad-files/getPackage');
5
- var merge2 = require('merge2');
6
- var debug = require('gulp-debug');
7
- var inject = require('gulp-inject');
8
- var plumber = require('gulp-plumber');
9
- var terser = require('gulp-terser');
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
- del(['dist/*']).then((paths) => {
15
- console.log('Deleted files and folders:\n', paths.join('\n')); // eslint-disable-line no-console, no-undef
16
- done();
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
- 'vuepress',
59
- gulp.series(['inject'], function () {
62
+ 'vitepress',
63
+ gulp.series('inject', function () {
60
64
  return gulp
61
65
  .src('dist/<%= name %>.jscad')
62
- .pipe(debug({ title: 'vuepress:' }))
63
- .pipe(gulp.dest('.vuepress/public/'));
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(['clean', 'inject'], function () {
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(['inject'])
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 `ENALBED` object.
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
- "inject": "gulp inject",
9
+ "build": "gulp inject",
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "gulp vuepress && cross-env BASEPATH=/<%= name %>/ vuepress build",
12
- "serve": "gulp vuepress && vuepress dev"
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
- "cross-env": "^7.0.2",
24
- "del": "^5.1.0",
25
- "gulp": "^4.0.2",
26
- "gulp-cli": "^2.2.0",
27
- "gulp-debug": "^4.0.0",
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": "^1.2.0",
29
+ "gulp-terser": "^2.0.1",
32
30
  "gulp-watch": "^5.0.1",
33
31
  "merge2": "^1.3.0",
34
- "vuepress": "^1.1.0"
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-jscad",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "Create a jscad project",
5
5
  "homepage": "https://gitlab.com/johnwebbcole/generator-jscad",
6
6
  "author": {
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
-
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>
@@ -1,10 +0,0 @@
1
- const pkg = require('../package.json');
2
- module.exports = {
3
- title: pkg.name,
4
- description: pkg.description,
5
- dest: 'public',
6
- themeConfig: {
7
- navbar: false
8
- },
9
- base: process.env.BASEPATH || '/'
10
- };