@robotical/martyblocks 1.4.26 → 1.4.34

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.
@@ -1,8 +1,10 @@
1
1
  name: Build and publish to npm
2
2
 
3
- on:
4
- release:
5
- types: [created]
3
+ # on:
4
+ # release:
5
+ # types: [created]
6
+ on: workflow_dispatch
7
+
6
8
 
7
9
  jobs:
8
10
  build_and_release:
@@ -25,7 +27,7 @@ jobs:
25
27
 
26
28
  - uses: actions/setup-python@v4
27
29
  with:
28
- python-version: '2.7'
30
+ python-version: '2.7.18'
29
31
 
30
32
  - name: Use Node.js 16.15.0
31
33
  uses: actions/setup-node@v2
@@ -90,16 +92,19 @@ jobs:
90
92
  - name: Build Blocks
91
93
  run: |
92
94
  cd ${{ env.blocks_original }}
95
+ export LC_ALL=en_US.UTF-8
93
96
  npm run prepublish
94
97
 
95
98
  - name: Build VM
96
99
  run: |
97
100
  cd ${{ env.vm_original }}
101
+ export LC_ALL=en_US.UTF-8
98
102
  npm run build
99
103
 
100
104
  - name: Build Scratch
101
105
  run: |
102
106
  cd ${{ env.gui_original }}
107
+ export LC_ALL=en_US.UTF-8
103
108
  BUILD_MODE=dist npm run build
104
109
 
105
110
  - name: Copy dist files
@@ -110,7 +115,7 @@ jobs:
110
115
  # Setup .npmrc file to publish to npm
111
116
  - uses: actions/setup-node@v2
112
117
  with:
113
- node-version: "16.x"
118
+ node-version: "16.15.0"
114
119
  registry-url: "https://registry.npmjs.org"
115
120
  - run: npm publish
116
121
  env:
@@ -55,8 +55,9 @@ npmlinkAll() {
55
55
  buildAllAndStart () {
56
56
  # arguments [all, blocks, vm, gui]
57
57
  local type="${1:-all}"
58
+ setDevelopment
58
59
  cpReplacements
59
- buildScratch $type
60
+ buildScratchStart $type
60
61
  cd $gui_original
61
62
  npm start
62
63
  }
@@ -71,12 +72,23 @@ buildAllAndStart () {
71
72
  ##################### Helper functions ####################
72
73
  buildAllAndCpToWebApp () {
73
74
  local type="${1:-all}"
75
+ setDevelopment
74
76
  cpReplacements
75
77
  buildScratch $type
76
78
  cpToDist
77
79
  cpToWebapp
78
80
  }
79
81
 
82
+ setProduction () {
83
+ cd $mblib
84
+ npx node ./set-production.js
85
+ }
86
+
87
+ setDevelopment () {
88
+ cd $mblib
89
+ npx node ./set-development.js
90
+ }
91
+
80
92
  cpReplacements ()
81
93
  {
82
94
  cp -r $REPLACEMENTS/* $MBHome
@@ -90,6 +102,14 @@ buildScratch () {
90
102
  if [ $type = gui ]; then buildGui; fi
91
103
  }
92
104
 
105
+ buildScratchStart () {
106
+ local type="${1:-all}"
107
+ if [ $type = all ]; then buildBlocks; buildVm; buildGui; fi
108
+ if [ $type = blocks ]; then buildBlocks; fi
109
+ if [ $type = vm ]; then buildBlocks; buildVm; fi
110
+ if [ $type = gui ]; then buildGuiStart; fi
111
+ }
112
+
93
113
  cpToWebapp () {
94
114
  rm -rf $WebappHome/public/MartyBlocks/*
95
115
  cp -r $gui_original/build/* $WebappHome/public/MartyBlocks
@@ -120,6 +140,10 @@ buildGui() {
120
140
  cd $gui_original && BUILD_MODE=dist npm run build
121
141
  }
122
142
 
143
+ buildGuiStart() {
144
+ cd $gui_original && npm run build
145
+ }
146
+
123
147
  publishPackage() {
124
148
  cdhome;
125
149
  rm -rf dist;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/martyblocks",
3
- "version": "1.4.26",
3
+ "version": "1.4.34",
4
4
  "description": "MartyBlocks based on Scratch for Marty the Robot by Robotical",
5
5
  "main": "README.md",
6
6
  "scripts": {