@gamelearn/arcade-components 1.10.1-hotfix-1 → 1.10.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 CHANGED
@@ -1,106 +1,106 @@
1
- # Arcade Components
2
- > librería de componentes para Arcade (aka engine 2.0)
3
-
4
- [![NPM](https://img.shields.io/npm/v/arcade-components.svg)](https://www.npmjs.com/package/arcade-components) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
5
-
6
- ## Install
7
-
8
- ```bash
9
- yarn add @gamelearn/arcade-components
10
- ```
11
-
12
- ## Usage
13
-
14
- ```jsx
15
- import React, { Component } from 'react';
16
-
17
- import { Button } from 'arcade-components';
18
-
19
- export default class App extends Component {
20
- render() {
21
- return (
22
- <div>
23
- <Button>Enjoy</Button>
24
- </div>
25
- );
26
- }
27
- }
28
-
29
- ```
30
-
31
- ## Generar version hotfix para arcade/master-stg
32
-
33
- Para generar una version hotfix nos vamos al commit que desplego la version que utiliza actualmente arcade/master-stg y creamos una rama sobre ella.
34
-
35
- Generamos los cambios o hacemos cherrypick de ellos si ya estan creados y una vez terminemos con los cambios tendremos que cambiar la version del package.json a una tal que asi :
36
-
37
- `"version": "1.3.5-fix-1",`
38
-
39
- Habiendo cambiado ya la version para publicarla ejecutamos:
40
- * `yarn publish-hotfix`
41
-
42
- Una vez publicada en npm ir a la versión master de arcade y sustituir la versión de arcade-components.
43
-
44
- ## Available Scripts
45
-
46
- Para ver Storybook en local
47
-
48
- ### `yarn start`
49
-
50
- Para compilar la librería a dist
51
-
52
- ### `yarn compile`
53
-
54
- Para dejar a babel observando cambios y ejecuntando auto-compilación puedes pasarle --watch
55
-
56
- `yarn compile --watch`
57
-
58
- ### `yarn generate <componentName>`
59
-
60
- Para añadir un componente nuevo se recomienda usar el generador automático que hara el scaffolding básico de dicho componente, coge el nombre como primer parámetro y si lo llamas sin parámetro te lo preguntará por el prompt.
61
-
62
- `yarn generate`
63
-
64
- ## How to link arcade-components in other repos (WIP)
65
-
66
- Para trabajar con arcade-components en local si necesidad de subir a git ni a npm no podemos trabajar con `yarn link` ya que da un error con los hooks de react.
67
-
68
- Cómo solución alternativa podemos instalar `yalc` que permite publicar el paquete en local e importarlo desde `arcade`.
69
-
70
- ```bash
71
- yarn global add yalc
72
- ```
73
- Si teneis problemas instalándolo en global :
74
- yarn global add yalc --prefix /usr/local
75
-
76
- Para generar el paquete en el store local:
77
-
78
- ```bash
79
- yarn
80
- yarn compile
81
- yalc publish o yarn yalc publish
82
- ```
83
-
84
- Si queremos escuchar los cambios y que se vayan publicando en el store de yalc se puede hacer directamente con:
85
-
86
- ```bash
87
- yarn watch
88
- ```
89
-
90
- Después, en el repositorio de `arcade` tendremos que linkar el paquete generado de la siguiente forma:
91
-
92
- ```bash
93
- yalc link @gamelearn/arcade-components
94
- ```
95
-
96
- Y voilá, ya podremos trabajar con arcade y arcade-components en local sin publicar nada.
97
-
98
- Una vez terminemos de trabajar con el paquete linkado en `arcade`, no nos olvidemos de borrar el link:
99
-
100
- ```bash
101
- yalc remove --all
102
- ```
103
-
104
- ## License
105
-
106
- UNLICENSED © [gamelearn](https://github.com/gamelearn)
1
+ # Arcade Components
2
+ > librería de componentes para Arcade (aka engine 2.0)
3
+
4
+ [![NPM](https://img.shields.io/npm/v/arcade-components.svg)](https://www.npmjs.com/package/arcade-components) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ yarn add @gamelearn/arcade-components
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```jsx
15
+ import React, { Component } from 'react';
16
+
17
+ import { Button } from 'arcade-components';
18
+
19
+ export default class App extends Component {
20
+ render() {
21
+ return (
22
+ <div>
23
+ <Button>Enjoy</Button>
24
+ </div>
25
+ );
26
+ }
27
+ }
28
+
29
+ ```
30
+
31
+ ## Generar version hotfix para arcade/master-stg
32
+
33
+ Para generar una version hotfix nos vamos al commit que desplego la version que utiliza actualmente arcade/master-stg y creamos una rama sobre ella.
34
+
35
+ Generamos los cambios o hacemos cherrypick de ellos si ya estan creados y una vez terminemos con los cambios tendremos que cambiar la version del package.json a una tal que asi :
36
+
37
+ `"version": "1.3.5-fix-1",`
38
+
39
+ Habiendo cambiado ya la version para publicarla ejecutamos:
40
+ * `yarn publish-hotfix`
41
+
42
+ Una vez publicada en npm ir a la versión master de arcade y sustituir la versión de arcade-components.
43
+
44
+ ## Available Scripts
45
+
46
+ Para ver Storybook en local
47
+
48
+ ### `yarn start`
49
+
50
+ Para compilar la librería a dist
51
+
52
+ ### `yarn compile`
53
+
54
+ Para dejar a babel observando cambios y ejecuntando auto-compilación puedes pasarle --watch
55
+
56
+ `yarn compile --watch`
57
+
58
+ ### `yarn generate <componentName>`
59
+
60
+ Para añadir un componente nuevo se recomienda usar el generador automático que hara el scaffolding básico de dicho componente, coge el nombre como primer parámetro y si lo llamas sin parámetro te lo preguntará por el prompt.
61
+
62
+ `yarn generate`
63
+
64
+ ## How to link arcade-components in other repos (WIP)
65
+
66
+ Para trabajar con arcade-components en local si necesidad de subir a git ni a npm no podemos trabajar con `yarn link` ya que da un error con los hooks de react.
67
+
68
+ Cómo solución alternativa podemos instalar `yalc` que permite publicar el paquete en local e importarlo desde `arcade`.
69
+
70
+ ```bash
71
+ yarn global add yalc
72
+ ```
73
+ Si teneis problemas instalándolo en global :
74
+ yarn global add yalc --prefix /usr/local
75
+
76
+ Para generar el paquete en el store local:
77
+
78
+ ```bash
79
+ yarn
80
+ yarn compile
81
+ yalc publish o yarn yalc publish
82
+ ```
83
+
84
+ Si queremos escuchar los cambios y que se vayan publicando en el store de yalc se puede hacer directamente con:
85
+
86
+ ```bash
87
+ yarn watch
88
+ ```
89
+
90
+ Después, en el repositorio de `arcade` tendremos que linkar el paquete generado de la siguiente forma:
91
+
92
+ ```bash
93
+ yalc link @gamelearn/arcade-components
94
+ ```
95
+
96
+ Y voilá, ya podremos trabajar con arcade y arcade-components en local sin publicar nada.
97
+
98
+ Una vez terminemos de trabajar con el paquete linkado en `arcade`, no nos olvidemos de borrar el link:
99
+
100
+ ```bash
101
+ yalc remove --all
102
+ ```
103
+
104
+ ## License
105
+
106
+ UNLICENSED © [gamelearn](https://github.com/gamelearn)
@@ -59,8 +59,6 @@ var ImageReview = function ImageReview() {
59
59
  };
60
60
 
61
61
  var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
62
- var _info$timerFeedback3, _info$timerFeedback4;
63
-
64
62
  // Common config
65
63
  var soundActions = props.soundActions,
66
64
  emitEvent = props.emitEvent,
@@ -376,20 +374,18 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
376
374
 
377
375
  if (actualDate.current > finalDate.current) {
378
376
  setFeedbackData(function () {
379
- var _info$timerFeedback, _info$timerFeedback2;
380
-
381
377
  return {
382
378
  show: true,
383
379
  success: false,
384
- text: info !== null && info !== void 0 && (_info$timerFeedback = info.timerFeedback) !== null && _info$timerFeedback !== void 0 && _info$timerFeedback.desc ? info.timerFeedback.desc : '',
385
- rewards: info === null || info === void 0 ? void 0 : (_info$timerFeedback2 = info.timerFeedback) === null || _info$timerFeedback2 === void 0 ? void 0 : _info$timerFeedback2.rewards
380
+ text: info.timerFeedback.desc ? info.timerFeedback.desc : '',
381
+ rewards: info.timerFeedback.rewards
386
382
  };
387
383
  });
388
384
  setTimeExpired(true);
389
385
  clearListenerForActualDate();
390
386
  }
391
387
  }, 0);
392
- }, [clearListenerForActualDate, info === null || info === void 0 ? void 0 : (_info$timerFeedback3 = info.timerFeedback) === null || _info$timerFeedback3 === void 0 ? void 0 : _info$timerFeedback3.desc, info === null || info === void 0 ? void 0 : (_info$timerFeedback4 = info.timerFeedback) === null || _info$timerFeedback4 === void 0 ? void 0 : _info$timerFeedback4.rewards]);
388
+ }, [clearListenerForActualDate, info.timerFeedback.desc, info.timerFeedback.rewards]);
393
389
  var createStartAndEndDate = (0, _react.useCallback)(function () {
394
390
  setDialogForTimer(false);
395
391
  startDate.current = Date.now();
@@ -398,14 +394,14 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
398
394
  }, [listenerForActualDate, timer]);
399
395
  (0, _react.useEffect)(function () {
400
396
  // start automatically the time
401
- if (timer && slideNumber > 0) {
397
+ if (slideNumber > 0) {
402
398
  if (puzzlesAutoCompleted[slideNumber - 1]) {
403
399
  setDialogForTimer(true);
404
400
  } else {
405
401
  createStartAndEndDate();
406
402
  }
407
403
  }
408
- }, [createStartAndEndDate, puzzlesAutoCompleted, slideNumber, timer]);
404
+ }, [createStartAndEndDate, puzzlesAutoCompleted, slideNumber]);
409
405
  return /*#__PURE__*/_react.default.createElement("div", {
410
406
  className: className
411
407
  }, feedbackData.show ? /*#__PURE__*/_react.default.createElement(_FeedbackComponent.default, {
package/package.json CHANGED
@@ -1,111 +1,111 @@
1
- {
2
- "name": "@gamelearn/arcade-components",
3
- "author": "Gamelearn",
4
- "license": "unlicense",
5
- "version": "1.10.1-hotfix-1",
6
- "main": "dist/index.js",
7
- "files": [
8
- "dist",
9
- "README.md"
10
- ],
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/gamelearn/arcade-components"
14
- },
15
- "dependencies": {
16
- "@gamelearn/arcade-styles": "0.10.0",
17
- "@gamelearn/arcade-three-core": "1.1.10",
18
- "@react-three/drei": "^7.20.0",
19
- "@react-three/fiber": "^7.0.17",
20
- "@testing-library/jest-dom": "5.11.4",
21
- "@testing-library/react": "11.1.0",
22
- "@testing-library/user-event": "13.5.0",
23
- "global": "^4.4.0",
24
- "hls.js": "0.12.4",
25
- "html-react-parser": "^1.4.0",
26
- "interactjs": "^1.10.11",
27
- "konva": "^7.2.5",
28
- "prop-types": "15.7.2",
29
- "react-konva": "^17.0.2-0",
30
- "react-konva-utils": "^0.2.0",
31
- "react-pdf": "5.2.0",
32
- "react-promise-suspense": "0.3.3",
33
- "react-typist": "^2.0.5",
34
- "three": "0.132.2",
35
- "web-vitals": "0.2.4"
36
- },
37
- "scripts": {
38
- "start": "npm run storybook",
39
- "clean": "rimraf dist",
40
- "watch": "npx nodemon -e js --ignore dist --exec \"yarn compile && yalc push --changed\"",
41
- "compile": "npm run clean && cross-env NODE_ENV=production babel src -d dist --ignore src/**/*.stories.js,src/**/*.test.js,src/setupTests.js",
42
- "test": "react-scripts test",
43
- "eject": "react-scripts eject",
44
- "storybook": "start-storybook -p 6006 -s public",
45
- "build-storybook": "build-storybook -o build",
46
- "generate": "plop",
47
- "lint": "npx eslint src --ext js,json",
48
- "lint:fix": "npx eslint src --ext js,json --fix",
49
- "lint:quiet": "npx eslint src --ext js,json --quiet",
50
- "publish-hotfix": "yarn compile && npm publish && npm run version-tag",
51
- "version-tag": "P_VER=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$P_VER && git push origin v$P_VER"
52
- },
53
- "browserslist": {
54
- "production": [
55
- ">0.2%",
56
- "not dead",
57
- "not op_mini all"
58
- ],
59
- "development": [
60
- "last 1 chrome version",
61
- "last 1 firefox version",
62
- "last 1 safari version"
63
- ]
64
- },
65
- "devDependencies": {
66
- "@babel/cli": "7.12.10",
67
- "@babel/eslint-parser": "^7.15.8",
68
- "@babel/preset-env": "7.12.11",
69
- "@babel/preset-react": "7.12.10",
70
- "@gamelearn/version": "^1.3.1",
71
- "@react-three/test-renderer": "6.0.6",
72
- "@storybook/addon-actions": "6.1.11",
73
- "@storybook/addon-essentials": "6.1.11",
74
- "@storybook/addon-links": "6.1.11",
75
- "@storybook/addons": "^6.3.8",
76
- "@storybook/node-logger": "6.1.11",
77
- "@storybook/preset-create-react-app": "3.1.5",
78
- "@storybook/react": "6.1.11",
79
- "@storybook/theming": "^6.3.8",
80
- "babel-loader": "8.2.2",
81
- "cross-env": "7.0.3",
82
- "eslint-config-airbnb": "^18.2.1",
83
- "eslint-config-prettier": "^8.3.0",
84
- "eslint-plugin-json-format": "^2.0.1",
85
- "eslint-plugin-prettier": "^4.0.0",
86
- "husky": "4.3.0",
87
- "nodemon": "^2.0.13",
88
- "plop": "^2.7.4",
89
- "prettier": "^2.5.0",
90
- "react": "0.0.0-experimental-27659559e",
91
- "react-dom": "0.0.0-experimental-27659559e",
92
- "react-scripts": "4.0.1",
93
- "rimraf": "3.0.2"
94
- },
95
- "jest": {
96
- "transformIgnorePatterns": [
97
- "node_modules/(?!(three)/)"
98
- ],
99
- "moduleNameMapper": {
100
- "^react-pdf$": "react-pdf/dist/umd/entry.jest",
101
- "^react-konva-utils$": "react-pdf/dist/umd/entry.jest"
102
- }
103
- },
104
- "husky": {
105
- "hooks": {
106
- "prepare-commit-msg": "bash node_modules/@gamelearn/version/scripts/update_version.sh -p hooks.config ${HUSKY_GIT_PARAMS}",
107
- "post-commit": "bash node_modules/@gamelearn/version/scripts/after_version_update.sh -p hooks.config",
108
- "post-merge": "bash node_modules/@gamelearn/version/scripts/after_version_update.sh -p hooks.config"
109
- }
110
- }
111
- }
1
+ {
2
+ "name": "@gamelearn/arcade-components",
3
+ "author": "Gamelearn",
4
+ "license": "unlicense",
5
+ "version": "1.10.1",
6
+ "main": "dist/index.js",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/gamelearn/arcade-components"
14
+ },
15
+ "dependencies": {
16
+ "@gamelearn/arcade-styles": "0.10.0",
17
+ "@gamelearn/arcade-three-core": "1.1.10",
18
+ "@react-three/drei": "^7.20.0",
19
+ "@react-three/fiber": "^7.0.17",
20
+ "@testing-library/jest-dom": "5.11.4",
21
+ "@testing-library/react": "11.1.0",
22
+ "@testing-library/user-event": "13.5.0",
23
+ "global": "^4.4.0",
24
+ "hls.js": "0.12.4",
25
+ "html-react-parser": "^1.4.0",
26
+ "interactjs": "^1.10.11",
27
+ "konva": "^7.2.5",
28
+ "prop-types": "15.7.2",
29
+ "react-konva": "^17.0.2-0",
30
+ "react-konva-utils": "^0.2.0",
31
+ "react-pdf": "5.2.0",
32
+ "react-promise-suspense": "0.3.3",
33
+ "react-typist": "^2.0.5",
34
+ "three": "0.132.2",
35
+ "web-vitals": "0.2.4"
36
+ },
37
+ "scripts": {
38
+ "start": "npm run storybook",
39
+ "clean": "rimraf dist",
40
+ "watch": "npx nodemon -e js --ignore dist --exec \"yarn compile && yalc push --changed\"",
41
+ "compile": "npm run clean && cross-env NODE_ENV=production babel src -d dist --ignore src/**/*.stories.js,src/**/*.test.js,src/setupTests.js",
42
+ "test": "react-scripts test",
43
+ "eject": "react-scripts eject",
44
+ "storybook": "start-storybook -p 6006 -s public",
45
+ "build-storybook": "build-storybook -o build",
46
+ "generate": "plop",
47
+ "lint": "npx eslint src --ext js,json",
48
+ "lint:fix": "npx eslint src --ext js,json --fix",
49
+ "lint:quiet": "npx eslint src --ext js,json --quiet",
50
+ "publish-hotfix": "yarn compile && npm publish && npm run version-tag",
51
+ "version-tag": "P_VER=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$P_VER && git push origin v$P_VER"
52
+ },
53
+ "browserslist": {
54
+ "production": [
55
+ ">0.2%",
56
+ "not dead",
57
+ "not op_mini all"
58
+ ],
59
+ "development": [
60
+ "last 1 chrome version",
61
+ "last 1 firefox version",
62
+ "last 1 safari version"
63
+ ]
64
+ },
65
+ "devDependencies": {
66
+ "@babel/cli": "7.12.10",
67
+ "@babel/eslint-parser": "^7.15.8",
68
+ "@babel/preset-env": "7.12.11",
69
+ "@babel/preset-react": "7.12.10",
70
+ "@gamelearn/version": "^1.3.1",
71
+ "@react-three/test-renderer": "6.0.6",
72
+ "@storybook/addon-actions": "6.1.11",
73
+ "@storybook/addon-essentials": "6.1.11",
74
+ "@storybook/addon-links": "6.1.11",
75
+ "@storybook/addons": "^6.3.8",
76
+ "@storybook/node-logger": "6.1.11",
77
+ "@storybook/preset-create-react-app": "3.1.5",
78
+ "@storybook/react": "6.1.11",
79
+ "@storybook/theming": "^6.3.8",
80
+ "babel-loader": "8.2.2",
81
+ "cross-env": "7.0.3",
82
+ "eslint-config-airbnb": "^18.2.1",
83
+ "eslint-config-prettier": "^8.3.0",
84
+ "eslint-plugin-json-format": "^2.0.1",
85
+ "eslint-plugin-prettier": "^4.0.0",
86
+ "husky": "4.3.0",
87
+ "nodemon": "^2.0.13",
88
+ "plop": "^2.7.4",
89
+ "prettier": "^2.5.0",
90
+ "react": "0.0.0-experimental-27659559e",
91
+ "react-dom": "0.0.0-experimental-27659559e",
92
+ "react-scripts": "4.0.1",
93
+ "rimraf": "3.0.2"
94
+ },
95
+ "jest": {
96
+ "transformIgnorePatterns": [
97
+ "node_modules/(?!(three)/)"
98
+ ],
99
+ "moduleNameMapper": {
100
+ "^react-pdf$": "react-pdf/dist/umd/entry.jest",
101
+ "^react-konva-utils$": "react-pdf/dist/umd/entry.jest"
102
+ }
103
+ },
104
+ "husky": {
105
+ "hooks": {
106
+ "prepare-commit-msg": "bash node_modules/@gamelearn/version/scripts/update_version.sh -p hooks.config ${HUSKY_GIT_PARAMS}",
107
+ "post-commit": "bash node_modules/@gamelearn/version/scripts/after_version_update.sh -p hooks.config",
108
+ "post-merge": "bash node_modules/@gamelearn/version/scripts/after_version_update.sh -p hooks.config"
109
+ }
110
+ }
111
+ }