pict 1.0.7

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.
Files changed (50) hide show
  1. package/.babelrc +3 -0
  2. package/.browserslistrc +1 -0
  3. package/.browserslistrc_compatible +1 -0
  4. package/.browserslistrc_default +1 -0
  5. package/.config/code-server/config.yaml +4 -0
  6. package/.config/configstore/update-notifier-npm-check-updates.json +4 -0
  7. package/.config/configstore/update-notifier-npm.json +4 -0
  8. package/.config/installation/UI-Requirements.md +32 -0
  9. package/.config/installation/install_luxury_code.js +105 -0
  10. package/.config/installation/install_luxury_default_configuration.json +45 -0
  11. package/.config/installation/install_luxury_interaction.json +3 -0
  12. package/.config/installation/precedent.1.0.5.js +339 -0
  13. package/.config/luxury-extras/.vscode/launch.json +46 -0
  14. package/.config/luxury-extras/Dockerfile_LUXURYCode +39 -0
  15. package/.config/luxury-extras/MySQL/Dockerfile_LUXURYCODE_MySQL +65 -0
  16. package/.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh +17 -0
  17. package/.config/luxury-extras/MySQL/MySQL-Security.sql +5 -0
  18. package/.travis.yml +14 -0
  19. package/.vscode/launch.json +46 -0
  20. package/Dockerfile_LUXURYCode +39 -0
  21. package/LICENSE +22 -0
  22. package/README.md +79 -0
  23. package/bower.json +25 -0
  24. package/debug/Harness.js +35 -0
  25. package/debug/examples/informary/Harness.js +19 -0
  26. package/debug/examples/informary/README.md +43 -0
  27. package/debug/examples/informary/bootstrap/css/bootstrap.css +10259 -0
  28. package/debug/examples/informary/bootstrap/js/bootstrap.min.js +7 -0
  29. package/debug/examples/informary/index.html +379 -0
  30. package/debug/examples/simpleApp/index.html +66 -0
  31. package/dist/pict.compatible.js +5705 -0
  32. package/dist/pict.compatible.min.js +246 -0
  33. package/dist/pict.compatible.min.js.map +1 -0
  34. package/dist/pict.js +5705 -0
  35. package/dist/pict.min.js +238 -0
  36. package/dist/pict.min.js.map +1 -0
  37. package/gulpfile-config.json +11 -0
  38. package/gulpfile-config_compatible.json +11 -0
  39. package/gulpfile-config_default.json +11 -0
  40. package/gulpfile.js +164 -0
  41. package/package.json +66 -0
  42. package/site_prototype/index.html +23 -0
  43. package/source/Pict-Browser-Shim.js +15 -0
  44. package/source/Pict-Fable-Service-Elucidator.js +17 -0
  45. package/source/Pict-Fable-Service-Informary.js +17 -0
  46. package/source/Pict-Fable-Service-Manyfest.js +24 -0
  47. package/source/Pict-Template-Provider.js +105 -0
  48. package/source/Pict.js +141 -0
  49. package/test/Pict_tests.js +139 -0
  50. package/test/data/SampleRecord-Quantity.json +13 -0
@@ -0,0 +1,39 @@
1
+ # Use the codercom/code-server image
2
+ FROM codercom/code-server:latest
3
+ MAINTAINER steven velozo
4
+
5
+ VOLUME /home/coder/.config
6
+ VOLUME /home/coder/.vscode
7
+
8
+ RUN echo "...installing debian dependencies..."
9
+ RUN sudo apt update
10
+ RUN sudo apt install vim curl tmux -y
11
+
12
+ RUN echo "Building development image..."
13
+
14
+ RUN echo "...installing vscode extensions..."
15
+ RUN code-server --install-extension ritwickdey.LiveServer \
16
+ code-server --install-extension hbenl.vscode-mocha-test-adapter \
17
+ code-server --install-extension hbenl.vscode-test-explorer \
18
+ code-server --install-extension hbenl.test-adapter-converter \
19
+ code-server --install-extension daylerees.rainglow \
20
+ code-server --install-extension oderwat.indent-rainbow
21
+
22
+ RUN echo "...mapping library specific volumes..."
23
+ # Volume mappings for code
24
+ VOLUME /home/coder/YOURLIBRARYNAMEHERE
25
+ # VOLUME /home/coder/YOURLIBRARYNAMEHERE/node_modules
26
+
27
+ SHELL ["/bin/bash", "-c"]
28
+ USER coder
29
+
30
+ RUN echo "...installing node version manager..."
31
+ # Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in. This is not great.
32
+ RUN touch ~/.bashrc && chmod +x ~/.bashrc
33
+ RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
34
+
35
+ RUN echo "...installing node version 14 as the default..."
36
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
37
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
38
+
39
+ WORKDIR /home/coder/YOURLIBRARYNAMEHERE
@@ -0,0 +1,65 @@
1
+ # Use the codercom/code-server image
2
+ FROM codercom/code-server:latest
3
+ MAINTAINER steven velozo
4
+
5
+ VOLUME /home/coder/.config
6
+ VOLUME /home/coder/.vscode
7
+
8
+ RUN echo "...installing debian dependencies..."
9
+ RUN sudo apt update
10
+ RUN sudo apt install vim curl tmux -y
11
+ RUN sudo apt install default-mysql-server default-mysql-client -y
12
+ # RUN sudo apt install sysv-rc-conf -y
13
+
14
+ RUN echo "Building RETOLD development image..."
15
+
16
+ RUN echo "...configuring mariadb (mysql) server..."
17
+ RUN sudo sed -i "s|bind-address|#bind-address|g" /etc/mysql/mariadb.conf.d/50-server.cnf
18
+ ADD ./.config/luxury-extras/MySQL/MySQL-Security.sql /home/coder/MySQL-Configure-Security.sql
19
+ ADD ./.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh /usr/bin/MySQL-Laden-Entry.sh
20
+ RUN sudo chmod +x /usr/bin/MySQL-Laden-Entry.sh
21
+ RUN ( sudo mysqld_safe --skip-grant-tables --skip-networking & ) && sleep 5 && mysql -u root < /home/coder/MySQL-Configure-Security.sql
22
+
23
+ # Enable MariaDB even without systemd
24
+ # RUN sudo sysv-rc-conf --level 0123456S mariadb on
25
+
26
+ # Import the initial database
27
+ RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE YOURDATABASENAMEHERE;"
28
+
29
+ RUN echo "...installing vscode extensions..."
30
+ RUN code-server --install-extension ritwickdey.LiveServer \
31
+ code-server --install-extension hbenl.vscode-mocha-test-adapter \
32
+ code-server --install-extension hbenl.vscode-test-explorer \
33
+ code-server --install-extension hbenl.test-adapter-converter \
34
+ code-server --install-extension daylerees.rainglow \
35
+ code-server --install-extension oderwat.indent-rainbow \
36
+ code-server --install-extension evan-buss.font-switcher \
37
+ code-server --install-extension vscode-icons-team.vscode-icons \
38
+ code-server --install-extension bengreenier.vscode-node-readme \
39
+ code-server --install-extension bierner.color-info \
40
+ code-server --install-extension dbaeumer.vscode-eslint \
41
+ code-server --install-extension PKief.material-icon-theme
42
+
43
+ SHELL ["/bin/bash", "-c"]
44
+ USER coder
45
+
46
+ # Copy any default configs for the coding environment we want (e.g. dark theme)
47
+ # COPY ./.config/.default_home/ /home/coder/
48
+
49
+ RUN echo "...mapping library specific volumes..."
50
+ # Volume mappings for code
51
+ VOLUME /home/coder/YOURLIBRARYNAMEHERE
52
+ # VOLUME /home/coder/YOURLIBRARYNAMEHERE/node_modules
53
+
54
+ RUN echo "...installing node version manager..."
55
+ # Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in. This is not great.
56
+ RUN touch ~/.bashrc && chmod +x ~/.bashrc
57
+ RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
58
+
59
+ RUN echo "...installing node version 14 as the default..."
60
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
61
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
62
+
63
+ WORKDIR /home/coder/YOURLIBRARYNAMEHERE
64
+
65
+ ENTRYPOINT ["/usr/bin/MySQL-Laden-Entry.sh"]
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ trap 'kill -TERM $PID' TERM INT
4
+
5
+ /usr/bin/entrypoint.sh --bind-addr "0.0.0.0:8080" . &
6
+
7
+ PID=$!
8
+
9
+ sleep 2
10
+
11
+ sudo service mariadb restart
12
+
13
+ wait $PID
14
+ trap - TERM INT
15
+ wait $PID
16
+ EXIT_STATUS=$?
17
+ echo "Service exited with status ${EXIT_STATUS}"
@@ -0,0 +1,5 @@
1
+ FLUSH PRIVILEGES;
2
+
3
+ ALTER USER 'root'@'localhost' IDENTIFIED BY '123456789';
4
+
5
+ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456789' WITH GRANT OPTION;
package/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: node_js
2
+ node_js:
3
+ - "4.1"
4
+ - "4.0"
5
+ addons:
6
+ code_climate:
7
+ repo_token: cf43f6eac54da4cd49c803d61f437107260dd2ef70ce81d804ae173df3f54121
8
+ after_success:
9
+ - npm run coverage
10
+ after_script:
11
+ - cat coverage/lcov.info | ./node_modules/codeclimate-test-reporter/bin/codeclimate.js
12
+ - cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
13
+ notifications:
14
+ slack: paviateam:C1q99hL9XXpiPpau2PUrVZPC
@@ -0,0 +1,46 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Launch Debug Harness",
9
+ "type": "pwa-node",
10
+ "request": "launch",
11
+ "outputCapture": "std",
12
+ "skipFiles": [
13
+ "<node_internals>/**"
14
+ ],
15
+ "program": "${workspaceFolder}/debug/Harness.js",
16
+ "presentation": {
17
+ "hidden": false,
18
+ "group": "",
19
+ "order": 1
20
+ }
21
+ },
22
+ {
23
+ "name": "Mocha Tests",
24
+ "args": [
25
+ "-u",
26
+ "tdd",
27
+ "--timeout",
28
+ "999999",
29
+ "--colors",
30
+ "${workspaceFolder}/test"
31
+ ],
32
+ "internalConsoleOptions": "openOnSessionStart",
33
+ "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
34
+ "request": "launch",
35
+ "skipFiles": [
36
+ "<node_internals>/**"
37
+ ],
38
+ "type": "pwa-node",
39
+ "presentation": {
40
+ "hidden": false,
41
+ "group": "",
42
+ "order": 2
43
+ }
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,39 @@
1
+ # Use the codercom/code-server image
2
+ FROM codercom/code-server:latest
3
+ MAINTAINER steven velozo
4
+
5
+ VOLUME /home/coder/.config
6
+ VOLUME /home/coder/.vscode
7
+
8
+ RUN echo "...installing debian dependencies..."
9
+ RUN sudo apt update
10
+ RUN sudo apt install vim curl tmux -y
11
+
12
+ RUN echo "Building development image..."
13
+
14
+ RUN echo "...installing vscode extensions..."
15
+ RUN code-server --install-extension ritwickdey.LiveServer \
16
+ code-server --install-extension hbenl.vscode-mocha-test-adapter \
17
+ code-server --install-extension hbenl.vscode-test-explorer \
18
+ code-server --install-extension hbenl.test-adapter-converter \
19
+ code-server --install-extension daylerees.rainglow \
20
+ code-server --install-extension oderwat.indent-rainbow
21
+
22
+ RUN echo "...mapping library specific volumes..."
23
+ # Volume mappings for code
24
+ VOLUME /home/coder/pict
25
+ # VOLUME /home/coder/pict/node_modules
26
+
27
+ SHELL ["/bin/bash", "-c"]
28
+ USER coder
29
+
30
+ RUN echo "...installing node version manager..."
31
+ # Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in. This is not great.
32
+ RUN touch ~/.bashrc && chmod +x ~/.bashrc
33
+ RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
34
+
35
+ RUN echo "...installing node version 14 as the default..."
36
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
37
+ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
38
+
39
+ WORKDIR /home/coder/pict
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Steven Velozo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # Pict
2
+
3
+ Behaviors and access to Retold stuff in the browser.
4
+
5
+ Uses browserify to generate dist/pict.* and such from node modules.
6
+
7
+ Currently relies on Fable-Settings but may change.
8
+
9
+ ## Building
10
+ ```
11
+ gulp minified
12
+ gulp debug
13
+ ```
14
+
15
+ (or)
16
+
17
+ `gulp build`
18
+
19
+
20
+ # A PICT Web Application
21
+
22
+ There is a main controller, the PICT Controller, which handles brokerage between the data
23
+ sources and the view data.
24
+
25
+ Eventually we will want to add a mechanism for persisting ViewData and ViewConfig pairs, as
26
+ well as in isolate. We've used the term Project to describe these, but, it is so generic
27
+ and we already use that term elsewhere in the HeadLight ecosystem.
28
+
29
+
30
+ +-----------------------+
31
+ | |
32
+ +--------->+ Pict Controller +<--------+
33
+ | | | |
34
+ | +-----------------------+ |
35
+ | |
36
+ | |
37
+ | |
38
+ +-------+--------+ +-------+------+
39
+ | | | |
40
+ | DataSource | | ViewData +--------------------->+
41
+ | | | | |
42
+ +----------------+ +--------------+ |
43
+ ^ |
44
+ | |
45
+ | |
46
+ | |
47
+ | |
48
+ | |
49
+ | |
50
+ +----------------+ +---------+--------+
51
+ | | | |
52
+ | ViewConfig +---------->+ View |
53
+ | | | |
54
+ +----------------+ +---------+--------+
55
+ |
56
+ |
57
+ |
58
+ |
59
+ |
60
+ +--------+--------+
61
+ | |
62
+ | View Renderer |
63
+ | |
64
+ +-----------------+
65
+
66
+
67
+ # Notes:
68
+
69
+ If when you try to `gulp build` or `gulp debug` you get the following error:
70
+
71
+ ```
72
+ Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (93)
73
+ ```
74
+
75
+ You can run this simple command to fix it:
76
+
77
+ ```
78
+ npm rebuild node-sass
79
+ ```
package/bower.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "pict",
3
+ "version": "1.0.0",
4
+ "description": "Pict retold dependency library.",
5
+ "main": "dist/pict.min.js",
6
+ "authors": [
7
+ "steven velozo <steven@velozo.com>"
8
+ ],
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/stevenvelozo/pict",
11
+ "moduleType": [
12
+ "globals",
13
+ "node"
14
+ ],
15
+ "ignore": [
16
+ "**/.*",
17
+ "node_modules",
18
+ "bower_components",
19
+ "coverage",
20
+ "test",
21
+ "tests"
22
+ ],
23
+ "dependencies": {
24
+ }
25
+ }
@@ -0,0 +1,35 @@
1
+ console.log(`--> Launching pict debug harness...`);
2
+
3
+ let libPict = require('../dist/pict.compatible.js');
4
+
5
+ console.log(`--> Instantiating pict...`);
6
+
7
+ let tmpPict = new libPict({"Nombre":"Numero uno hombre."});
8
+ tmpPict.initializeTemplateMethods();
9
+
10
+ tmpPict.log.info(`Pict initialized ... Nombre [${tmpPict.settings.Nombre}]`);
11
+
12
+
13
+ let tmpTemplateOutput2 = tmpPict.parseTemplate(`
14
+ <td>{~Data:Record.worktype_String~}</td>
15
+ <td align="center">{~Data:Record.itemnumber~}</td>
16
+ <td width="45%">{~Data:Record.description~}</td>
17
+ <td align="left">{~Data:Record.units~}</td>
18
+ <td align="right">{~Dollars:Record.costperunit~}</td>
19
+ <td align="right">{~Digits:Record.quantity~}</td>
20
+ <td align="right">{~Dollars:Record.amount~}</td>
21
+ `, {
22
+ "addressprefix": "MaterialsOnHand.UUID1",
23
+ "idrecord": 1,
24
+ "description": "Stockpile Qty Obs - January 25",
25
+ "quantity": 2593.78,
26
+ "units": "LNFT",
27
+ "costperunit": "0.0",
28
+ "worktype": 310381,
29
+ "worktype_String": "0032 Horizontal Directional Drill (Carrier Conduit)",
30
+ "worktype_StringAbbreviated": "0032",
31
+ "worktype_PayItems": "TS-728-37007",
32
+ "itemnumber": "TS-728-37007"
33
+ });
34
+
35
+ tmpPict.log.info('...Done: '+tmpTemplateOutput2);
@@ -0,0 +1,19 @@
1
+ let libInformary = require('../source/Informary.js');
2
+
3
+ let tmpInformary = new libInformary();
4
+
5
+ console.log(`Default nonFormData: ${JSON.stringify(tmpInformary.nonFormData)}`);
6
+
7
+ tmpInformary.nonFormData.d = 4;
8
+
9
+ console.log(`Some set value in nonFormData: ${JSON.stringify(tmpInformary.nonFormData)}`);
10
+
11
+ let tmpTestObject = ( { a: 1, b: 2, c: 3 } );
12
+
13
+ tmpInformary.nonFormData = tmpTestObject;
14
+
15
+ console.log(`Assigning the object outright shouldn't work: ${JSON.stringify(tmpInformary.nonFormData)}`);
16
+
17
+ tmpInformary.nonFormData.OtherValues = tmpTestObject;
18
+
19
+ console.log(`Assigning a property should work: ${JSON.stringify(tmpInformary.nonFormData)}`);
@@ -0,0 +1,43 @@
1
+ # Test Harness
2
+
3
+ This index.html loads informary (in its non-minified form) and allows you to fill
4
+ a form out and marshal it back and forth to simple JSON strings.
5
+
6
+
7
+ ## Minified versus non-minified version
8
+
9
+ The test harness uses the non minified version for easy breakpoints and testing of
10
+ what's going on even without the browser map. If you want to change this to use
11
+ the minified version, just change line 11 in index.html from:
12
+
13
+ ```
14
+ <script src="../dist/informary.js"></script>
15
+ ```
16
+
17
+ to:
18
+
19
+ ```
20
+ <script src="../dist/informary.min.js"></script>
21
+ ```
22
+
23
+ It is possible that minification could cause bugs that don't show up in the
24
+ unfolded version of code, albeit very unlikely.
25
+
26
+
27
+ ## Page load render
28
+ There is an onload override that also can force it to marshal in the data in the
29
+ second text area labeled "Informary Input" when the page loads. You will need to
30
+ uncomment the index.html line #70 containing the marshal call, which looks like this:
31
+
32
+ ```
33
+ // Uncomment this line to automatically load the data below into the form after page load
34
+ //pushInformaryDataToForm();
35
+ ```
36
+
37
+
38
+ ## To render to PDF using wkhtmltopdf
39
+ wkhtmltopdf --enable-local-file-access --enable-javascript --debug-javascript index.html index.pdf
40
+
41
+
42
+ ## Extra javascript wkhtmltopdf options if you want them
43
+ wkhtmltopdf --enable-local-file-access --enable-javascript --javascript-delay 1000 --no-stop-slow-scripts --debug-javascript index.html index.pdf