create-coralite 0.33.0 → 0.33.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-coralite",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Coralite scaffolding script",
5
5
  "bin": {
6
6
  "create-coralite": "bin/index.js",
@@ -8,7 +8,7 @@
8
8
  "build": "coralite-scripts build"
9
9
  },
10
10
  "devDependencies": {
11
- "coralite-scripts": "^0.33.0",
11
+ "coralite-scripts": "^0.33.1",
12
12
  "cross-env": "^10.1.0"
13
13
  }
14
14
  }
@@ -27,29 +27,22 @@
27
27
  import { defineComponent } from 'coralite'
28
28
 
29
29
  export default defineComponent({
30
- client: {
31
- imports: [
32
- {
33
- specifier: 'https://esm.sh/canvas-confetti@latest',
34
- defaultExport: 'confetti'
35
- }
36
- ],
37
- script ({ values, helpers, imports }) {
38
- const button = helpers.refs('count-button')
39
- const step = values.step ? parseInt(values.step) : 1
40
- let count = 0
41
-
42
- button.addEventListener('click', () => {
43
- // increment the counter by the specified step value
44
- count += step
30
+ async script ({ properties, refs }) {
31
+ const { default: confetti } = await import('https://esm.sh/canvas-confetti@latest')
32
+ const button = refs('count-button')
33
+ const step = properties.step ? parseInt(properties.step) : 1
34
+ let count = 0
45
35
 
46
- // update the button's text content to reflect the new count value
47
- button.textContent = `Count is ${count}`
36
+ button.addEventListener('click', () => {
37
+ // increment the counter by the specified step value
38
+ count += step
48
39
 
49
- // Explode confetti :)
50
- imports.confetti()
51
- })
52
- }
40
+ // update the button's text content to reflect the new count value
41
+ button.textContent = `Count is ${count}`
42
+
43
+ // Explode confetti :)
44
+ confetti()
45
+ })
53
46
  }
54
47
  })
55
48
  </script>
@@ -8,7 +8,7 @@
8
8
  import { defineComponent } from 'coralite'
9
9
 
10
10
  export default defineComponent({
11
- tokens: {
11
+ properties: {
12
12
  capitaliseName ({ name }) {
13
13
  if (name) {
14
14
  return name[0].toUpperCase() + name.slice(1)
@@ -8,7 +8,7 @@
8
8
  "build": "coralite-scripts build"
9
9
  },
10
10
  "devDependencies": {
11
- "coralite-scripts": "^0.33.0",
11
+ "coralite-scripts": "^0.33.1",
12
12
  "cross-env": "^10.1.0"
13
13
  }
14
14
  }
@@ -27,29 +27,22 @@
27
27
  import { defineComponent } from 'coralite'
28
28
 
29
29
  export default defineComponent({
30
- client: {
31
- imports: [
32
- {
33
- specifier: 'https://esm.sh/canvas-confetti@latest',
34
- defaultExport: 'confetti'
35
- }
36
- ],
37
- script ({ values, helpers, imports }) {
38
- const button = helpers.refs('count-button')
39
- const step = values.step ? parseInt(values.step) : 1
40
- let count = 0
41
-
42
- button.addEventListener('click', () => {
43
- // increment the counter by the specified step value
44
- count += step
30
+ async script ({ properties, refs }) {
31
+ const { default: confetti } = await import('https://esm.sh/canvas-confetti@latest')
32
+ const button = refs('count-button')
33
+ const step = properties.step ? parseInt(properties.step) : 1
34
+ let count = 0
45
35
 
46
- // update the button's text content to reflect the new count value
47
- button.textContent = `Count is ${count}`
36
+ button.addEventListener('click', () => {
37
+ // increment the counter by the specified step value
38
+ count += step
48
39
 
49
- // Explode confetti :)
50
- imports.confetti()
51
- })
52
- }
40
+ // update the button's text content to reflect the new count value
41
+ button.textContent = `Count is ${count}`
42
+
43
+ // Explode confetti :)
44
+ confetti()
45
+ })
53
46
  }
54
47
  })
55
48
  </script>
@@ -8,7 +8,7 @@
8
8
  import { defineComponent } from 'coralite'
9
9
 
10
10
  export default defineComponent({
11
- tokens: {
11
+ properties: {
12
12
  capitaliseName ({ name }) {
13
13
  if (name) {
14
14
  return name[0].toUpperCase() + name.slice(1)