fragment-tools 0.1.0 → 0.1.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/. npmignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ .vscode
3
+ /examples
4
+ /docs
@@ -6,7 +6,6 @@
6
6
  "p5": "^1.4.1",
7
7
  "three": "^0.140.2"
8
8
  },
9
- "devDependencies": {},
10
9
  "scripts": {
11
10
  "start": "fragment ./circle-2d.js"
12
11
  },
@@ -23,6 +23,7 @@ export let props = {
23
23
  export let fps = 0;
24
24
 
25
25
  export let update = ({ context, width, height }) => {
26
+ console.log("shape2d update");
26
27
  // draw background
27
28
  context.fillStyle = props.background.value;
28
29
  context.fillRect(0, 0, width, height);
@@ -43,3 +44,7 @@ export let update = ({ context, width, height }) => {
43
44
  };
44
45
 
45
46
  export let rendering = "2d";
47
+
48
+ export let buildConfig = {
49
+ gui: true,
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fragment-tools",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A web development environment for creative coding",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/cli/server.js CHANGED
@@ -86,11 +86,17 @@ export async function start({ options, filepaths, entries, fragment }) {
86
86
  '__PRODUCTION__': options.build,
87
87
  },
88
88
  optimizeDeps: {
89
+ include: ['convert-length', 'webm-writer', 'changedpi'],
89
90
  exclude: [
90
91
  "@fragment/sketches",
91
92
  ...entriesPaths,
92
93
  ]
93
- }
94
+ },
95
+ build: {
96
+ commonjsOptions: {
97
+ include: ['convert-length', 'webm-writer', 'changedpi'],
98
+ },
99
+ },
94
100
  });
95
101
 
96
102
  if (options.build) {
@@ -21,6 +21,18 @@ let selected = sketchKey ?
21
21
  sketchKey :
22
22
  ($preview ? $preview : $sketchesKeys[Math.min(id, $sketchesKeys.length - 1)]);
23
23
 
24
+ sketchesKeys.subscribe((keys) => {
25
+ if (!selected && keys.length > 0) {
26
+ $monitors = $monitors.map(monitor => {
27
+ if (monitor.id === id) {
28
+ monitor.selected = $sketchesKeys[Math.min(id, $sketchesKeys.length - 1)];
29
+ }
30
+
31
+ return monitor;
32
+ });
33
+ }
34
+ });
35
+
24
36
  onMount(() => {
25
37
  $monitors = [
26
38
  ...$monitors,