qcobjectsnewapp 2.4.9 → 2.4.11

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 (126) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.cjs +22 -0
  3. package/.gitlab-ci.yml +6 -5
  4. package/.hintrc +8 -0
  5. package/.prettierignore +7 -0
  6. package/README.md +99 -2
  7. package/VERSION +1 -1
  8. package/_redirects +1 -0
  9. package/config.json +12 -0
  10. package/package.json +69 -15
  11. package/{index.html → src/index.html} +6 -7
  12. package/src/js/config.ts +24 -0
  13. package/src/js/init.ts +27 -0
  14. package/{js/packages/com.qcobjects.installer.js → src/js/packages/com.qcobjects.installer.ts} +45 -17
  15. package/{js/packages/com.qcobjects.services.github.js → src/js/packages/com.qcobjects.services.github.ts} +73 -8
  16. package/{js/packages/org.quickcorp.custom.components.js → src/js/packages/org.quickcorp.custom.components.ts} +4 -0
  17. package/src/js/packages/org.quickcorp.custom.controllers.ts +112 -0
  18. package/{js/packages/org.quickcorp.custom.effects.js → src/js/packages/org.quickcorp.custom.effects.ts} +4 -0
  19. package/{js/packages/org.quickcorp.custom.models.js → src/js/packages/org.quickcorp.custom.models.ts} +3 -0
  20. package/src/js/packages/org.quickcorp.custom.ts +9 -0
  21. package/src/js/packages/org.quickcorp.custom.views.ts +21 -0
  22. package/src/js/types/global.d.ts +26 -0
  23. package/{manifest.json → src/manifest.json} +1 -1
  24. package/src/templates/components/blank.tpl.html +0 -0
  25. package/src/templates/components/footer.tpl.html +12 -0
  26. package/{templates → src/templates}/components/octocat-icon.tpl.html +1 -1
  27. package/{templates → src/templates}/components/shadowed-card.tpl.html +1 -3
  28. package/tsconfig.json +23 -0
  29. package/.eslintrc.js +0 -7
  30. package/js/init.js +0 -58
  31. package/js/packages/org.quickcorp.custom.controllers.js +0 -115
  32. package/js/packages/org.quickcorp.custom.js +0 -8
  33. package/js/packages/org.quickcorp.custom.views.js +0 -14
  34. package/templates/components/footer.tpl.html +0 -12
  35. /package/{app.js → backend/app.js} +0 -0
  36. /package/{css → src/css}/components/button.css +0 -0
  37. /package/{css → src/css}/components/card.css +0 -0
  38. /package/{css → src/css}/components/github-grid-landscape.css +0 -0
  39. /package/{css → src/css}/components/github-grid-portrait.css +0 -0
  40. /package/{css → src/css}/components/hero/hero-call-to-action.css +0 -0
  41. /package/{css → src/css}/components/hero/hero-overlay.css +0 -0
  42. /package/{css → src/css}/components/hero/hero-two-column-form.css +0 -0
  43. /package/{css → src/css}/components/modal.css +0 -0
  44. /package/{css → src/css}/desktop/container.css +0 -0
  45. /package/{css → src/css}/desktop/content.css +0 -0
  46. /package/{css → src/css}/desktop/footer.css +0 -0
  47. /package/{css → src/css}/desktop/index.css +0 -0
  48. /package/{css → src/css}/desktop/navbar.css +0 -0
  49. /package/{css → src/css}/desktop/sidebar.css +0 -0
  50. /package/{css → src/css}/index.css +0 -0
  51. /package/{css → src/css}/mobile/content.css +0 -0
  52. /package/{css → src/css}/mobile/footer.css +0 -0
  53. /package/{css → src/css}/mobile/index.css +0 -0
  54. /package/{css → src/css}/mobile/navbar.css +0 -0
  55. /package/{css → src/css}/mobile/sidebar.css +0 -0
  56. /package/{css → src/css}/modern-base.css +0 -0
  57. /package/{css → src/css}/theme/basic/style.css +0 -0
  58. /package/{css → src/css}/theme/cyan/style.css +0 -0
  59. /package/{css → src/css}/theme/redlight/style.css +0 -0
  60. /package/{css → src/css}/theme/xtra/style.css +0 -0
  61. /package/{favicon.ico → src/favicon.ico} +0 -0
  62. /package/{humans.txt → src/humans.txt} +0 -0
  63. /package/{img → src/img}/Q_web copy.png +0 -0
  64. /package/{img → src/img}/Q_web-white.png +0 -0
  65. /package/{img → src/img}/Q_web.png +0 -0
  66. /package/{img → src/img}/Q_web.svg +0 -0
  67. /package/{img → src/img}/icons/icon-128x128.png +0 -0
  68. /package/{img → src/img}/icons/icon-144x144.png +0 -0
  69. /package/{img → src/img}/icons/icon-152x152.png +0 -0
  70. /package/{img → src/img}/icons/icon-192x192.png +0 -0
  71. /package/{img → src/img}/icons/icon-384x384.png +0 -0
  72. /package/{img → src/img}/icons/icon-512x512.png +0 -0
  73. /package/{img → src/img}/icons/icon-72x72.png +0 -0
  74. /package/{img → src/img}/icons/icon-96x96.png +0 -0
  75. /package/{img → src/img}/logo-qcobjects-version.svg +0 -0
  76. /package/{img → src/img}/logo-qcobjects-white-powered-quickcorp.svg +0 -0
  77. /package/{img → src/img}/logo-qcobjects-white.svg +0 -0
  78. /package/{img → src/img}/logo.png +0 -0
  79. /package/{img → src/img}/octocat.svg +0 -0
  80. /package/{img → src/img}/placeholder.svg +0 -0
  81. /package/{img → src/img}/screenshots/screenshot1.png +0 -0
  82. /package/{img → src/img}/screenshots/screenshot1.webp +0 -0
  83. /package/{img → src/img}/screenshots/screenshot2.png +0 -0
  84. /package/{img → src/img}/screenshots/screenshot2.webp +0 -0
  85. /package/{templates/components/blank.tpl.html → src/js/types/init.d.ts} +0 -0
  86. /package/{robots.txt → src/robots.txt} +0 -0
  87. /package/{sw.js → src/sw.js} +0 -0
  88. /package/{templates → src/templates}/components/article1.tpl.html +0 -0
  89. /package/{templates → src/templates}/components/article2.tpl.html +0 -0
  90. /package/{templates → src/templates}/components/card.tpl.html +0 -0
  91. /package/{templates → src/templates}/components/contentblock.tpl.html +0 -0
  92. /package/{templates → src/templates}/components/footer2.tpl.html +0 -0
  93. /package/{templates → src/templates}/components/github-card.tpl.html +0 -0
  94. /package/{templates → src/templates}/components/header.tpl.html +0 -0
  95. /package/{templates → src/templates}/components/hero/hero-call-to-action.tpl.html +0 -0
  96. /package/{templates → src/templates}/components/hero/hero-overlay.tpl.html +0 -0
  97. /package/{templates → src/templates}/components/hero/hero-two-column-form.tpl.html +0 -0
  98. /package/{templates → src/templates}/components/install-button.tpl.html +0 -0
  99. /package/{templates → src/templates}/components/layout-basic.tpl.html +0 -0
  100. /package/{templates → src/templates}/components/loading.tpl.html +0 -0
  101. /package/{templates → src/templates}/components/loadingfooter.tpl.html +0 -0
  102. /package/{templates → src/templates}/components/login-button.tpl.html +0 -0
  103. /package/{templates → src/templates}/components/login2.tpl.html +0 -0
  104. /package/{templates → src/templates}/components/loginform.tpl.html +0 -0
  105. /package/{templates → src/templates}/components/modal.tpl.html +0 -0
  106. /package/{templates → src/templates}/components/nav.tpl.html +0 -0
  107. /package/{templates → src/templates}/components/pages/about-of.tpl.html +0 -0
  108. /package/{templates → src/templates}/components/pages/author.tpl.html +0 -0
  109. /package/{templates → src/templates}/components/pages/page1.tpl.html +0 -0
  110. /package/{templates → src/templates}/components/pages/page2.tpl.html +0 -0
  111. /package/{templates → src/templates}/components/pages/page3.tpl.html +0 -0
  112. /package/{templates → src/templates}/components/pages/qcobjects-forks-stars.tpl.html +0 -0
  113. /package/{templates → src/templates}/components/product.tpl.html +0 -0
  114. /package/{templates → src/templates}/components/profile.tpl.html +0 -0
  115. /package/{templates → src/templates}/components/section1.tpl.html +0 -0
  116. /package/{templates → src/templates}/components/section2.tpl.html +0 -0
  117. /package/{templates → src/templates}/components/signin-button.tpl.html +0 -0
  118. /package/{templates → src/templates}/components/signup-form.tpl.html +0 -0
  119. /package/{templates → src/templates}/components/signup.tpl.html +0 -0
  120. /package/{templates → src/templates}/components/signupbuttons.tpl.html +0 -0
  121. /package/{templates → src/templates}/components/signupform.tpl.html +0 -0
  122. /package/{templates → src/templates}/components/signuppage.tpl.html +0 -0
  123. /package/{templates → src/templates}/components/signupsuccessful.tpl.html +0 -0
  124. /package/{templates → src/templates}/components/signupsuccessfulfooter.tpl.html +0 -0
  125. /package/{templates → src/templates}/components/splashscreen.tpl.html +0 -0
  126. /package/{templates → src/templates}/components/topmenu.tpl.html +0 -0
package/.eslintignore ADDED
@@ -0,0 +1,3 @@
1
+ build
2
+ dist
3
+ public
package/.eslintrc.cjs ADDED
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ node: true,
5
+ es2021: true,
6
+ es2020: true,
7
+ es2017: true,
8
+ es6: true
9
+ },
10
+
11
+ extends: [
12
+ "semistandard",
13
+ "standard",
14
+ "prettier",
15
+ "eslint:recommended", "plugin:@typescript-eslint/recommended",
16
+ "qcobjects"
17
+
18
+ ],
19
+ parser: "@typescript-eslint/parser",
20
+ plugins: ["@typescript-eslint"],
21
+ root: true
22
+ };
package/.gitlab-ci.yml CHANGED
@@ -3,17 +3,18 @@ image: quickcorp/qcobjects:latest
3
3
  pages:
4
4
  stage: deploy
5
5
  script:
6
+ - npm i qcobjects && npm i -D eslint-config-qcobjects
7
+ - npm ci
8
+ - npm test
9
+ - npm run build:ts
6
10
  - mkdir public
11
+ - cp build/*.* public/
7
12
  - cp -Rf css/ public/
8
13
  - cp -Rf img/ public/
9
14
  - cp -Rf js/ public/
10
15
  - cp -Rf spec/ public/
11
16
  - cp -Rf templates/ public/
12
- - cp *.* public/
13
- - cd public
14
- - npm i qcobjects && npm i -D eslint-config-qcobjects
15
- - npm i
16
- - npm test
17
+ - cp _redirects public/
17
18
  artifacts:
18
19
  paths:
19
20
  - public
package/.hintrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": [
3
+ "development"
4
+ ],
5
+ "hints": {
6
+ "typescript-config/is-valid": "off"
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ # Ignore artifacts:
2
+ node_modules
3
+ lib
4
+ coverage
5
+ dist
6
+ public
7
+ build
package/README.md CHANGED
@@ -80,36 +80,62 @@ You can either use this function or import statement to load QCObjects packages.
80
80
 
81
81
  In package.json file, in scripts section, you will find some common commands that need to be present in every project that works with QCObjects.
82
82
 
83
+ # Run tests
84
+
85
+ The "test" script uses the "eslint" linter and the "jasmine" framework to check the code for errors and run tests. If any errors are found, the script tries to fix them automatically. If all tests pass, the script exits with code 0.
86
+
83
87
  ```shell
84
88
  # Executes the tests of the project (see spec and coverage folders)
85
89
  npm run test
86
90
  ```
87
91
 
92
+ # Run sync
93
+
94
+ The "sync" script stages and commits any changes made to the codebase. This is useful for keeping track of changes and making sure everything is up-to-date.
95
+
88
96
  ```shell
89
97
  # Syncronizes the version between npm and git
90
98
  npm run sync
91
99
  ```
92
100
 
101
+ # Run preversion
102
+
103
+ The "preversion" script runs "npm i --upgrade" and "npm test" before a new version of the package is published. This ensures that the latest version of the code is tested and ready to be released.
104
+
93
105
  ```shell
94
106
  # This command is executed before a npm version is changed
95
107
  npm run preversion
96
108
  ```
97
109
 
110
+ # Run postversion
111
+
112
+ The "postversion" script pushes the changes to the codebase and tags the new version. This helps keep track of the changes made to the code over time.
113
+
98
114
  ```shell
99
115
  # This command is executed after a npm version is changed
100
116
  npm run postversion
101
117
  ```
102
118
 
119
+ # Run coverage
120
+
121
+ The "coverage" script generates a code coverage report using the "nyc" library. This is useful for understanding how much of the code is being tested and where there may be gaps in test coverage.
122
+
103
123
  ```shell
104
124
  # You can run this command to dispatch the coverage scripts (see coverage folder)
105
125
  npm run coverage
106
126
  ```
107
127
 
128
+ # Run start
129
+
130
+ The "start" script runs the "createcert" and "serve" scripts. This is useful for quickly launching the app and getting started with development.
131
+
108
132
  ```shell
109
133
  # Start the QCObjects Server
110
134
  npm run start
111
135
  ```
112
136
 
137
+ The "serve" and "server" scripts launch the app using the "qcobjects" library. This is the main tool used in the development process.
138
+
113
139
  ```shell
114
140
  # An alias to start the QCObjects Server
115
141
  npm run serve
@@ -120,36 +146,107 @@ npm run serve
120
146
  npm run server
121
147
  ```
122
148
 
149
+ # Run QCObjects Collab
150
+
151
+ The "collab" script launches the collaborative coding tool "qcobjects-collab". This is useful for working with other developers on the same codebase.
152
+
123
153
  ```shell
124
154
  # This command will open a shell with QCObjects Collab Tool
125
155
  npm run collab
126
156
  ```
127
157
 
158
+ # Run QCObjects Shell
159
+
160
+ The "shell" script launches a shell terminal using the "qcobjects" library. This is useful for running commands and making changes to the codebase.
161
+
162
+
128
163
  ```shell
129
164
  # This command will open a shell with QCObjects running
130
165
  npm run shell
131
166
  ```
132
167
 
168
+ # Generate SSL certificates
169
+
170
+ The "createcert" script creates a certificate used for HTTPS connections. This is important for security reasons.
171
+ It uses letsencrypt certificate or openssl depending on settings. Default is openssl.
172
+
133
173
  ```shell
134
174
  # This command will create a certificate for ssl
135
175
  npm run createcert
136
176
  ```
137
177
 
178
+ # Dispatch a new version of your app
179
+
180
+ The "v-patch", "v-minor", and "v-major" scripts increment the version number of the package based on patch, minor or major changes. This is useful for keeping track of the changes made to the code over time.
181
+
182
+ ```shell
183
+ npm run v-patch -m "message of commit" --git --npm
184
+ ```
185
+
186
+ # Use the CLI with local dependencies
187
+
188
+ Install QCObjects CLI in local in order to use local dependencies and local settings of your project.
189
+
190
+ ```shell
191
+ # This command will install QCObjects CLI in your local project
192
+ npm i --save-dev qcobjects-cli
193
+ ```
194
+
195
+ The "qcobjects" script launches the "qcobjects" library command-line interface. This is the main tool used in the development process.
196
+
197
+ ```shell
198
+ # This command will execute QCObjects CLI in your local project and show the version installed
199
+ npm run qcobjects -- --version
200
+ ```
201
+
202
+ ```shell
203
+ # To learn more about CLI commands, you can use the --help option
204
+ npm run qcobjects -- --help
205
+ ```
206
+
207
+ ```shell
208
+ # To learn more about CLI commands, you can use the --help option
209
+ npm run qcobjects -- create --help
210
+ ```
211
+
212
+ # Launch a built-in HTTP Server
213
+
214
+ The "http-server" script starts an HTTP server using the "qcobjects-cli" library. This is useful for testing the app in a local environment.
215
+
138
216
  ```shell
139
- # This command will run QCObjects HTTP Server without SSL
140
217
  npm run http-server
141
218
  ```
142
219
 
220
+ # Publish your application to Google App Engine
221
+
222
+ The "gae-server" script starts a Google App Engine HTTP server using the "qcobjects-cli" library. This is useful for deploying the app to production.
223
+
224
+ Use this command in the settings of your GAE Application instead of "npm start"
225
+
143
226
  ```shell
144
- # This command will run QCObjects Server adapted for Google App Engine
145
227
  npm run gae-server
146
228
  ```
147
229
 
230
+ # Build your application from TypeScript to JavaScript
231
+
232
+ The "build:ts" script compiles the TypeScript code and runs the linter to fix any issues. This is useful for ensuring that the code is properly formatted and free of errors.
233
+
234
+ The "build:ts-types" script generates TypeScript type declarations for the codebase. This is useful for making sure that the code is properly typed and free of errors.
235
+
236
+
148
237
  ```shell
149
238
  # This command will be implemented in the future for TypeScript
150
239
  npm run build
151
240
  ```
152
241
 
242
+ # Publish your application to test in local environment
243
+
244
+ The "publish:local" script publishes the package locally using the "qcobjects" library. This is useful for testing the app in a local environment.
245
+
246
+ # Prettify your code before commit to git
247
+
248
+ Finally, the "prepare" script installs the "husky" library, which is used to manage Git hooks. This is useful for automating tasks in the development process.
249
+
153
250
  # Docker installation
154
251
 
155
252
  To run this app with docker, execute the following command:
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.9
1
+ 2.4.11
package/_redirects ADDED
@@ -0,0 +1 @@
1
+ /* /index.html 200
package/config.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "devmode":"debug",
3
3
  "autodiscover":true,
4
+ "documentRoot": "$config(projectPath)public/",
5
+ "documentRootFileIndex":"index.html",
4
6
  "cacheControl":"max-age=31536000",
5
7
  "relativeImportPath":"js/packages/",
6
8
  "serverPortHTTP": "8080",
7
9
  "serverPortHTTPS": "8443",
8
10
  "useLocalSDK":true,
11
+ "private-key-pem": "$config(domain)-privkey.pem",
12
+ "private-cert-pem": "$config(domain)-cert.pem",
9
13
  "backend":{
10
14
  "routes":[
11
15
  {
@@ -34,5 +38,13 @@
34
38
 
35
39
 
36
40
  ]
41
+ },
42
+ "package":{
43
+ "source":{
44
+ "backend":"backend",
45
+ "frontend":"src"
46
+ },
47
+ "build": "build",
48
+ "dist": "dist"
37
49
  }
38
50
  }
package/package.json CHANGED
@@ -1,23 +1,54 @@
1
1
  {
2
2
  "name": "qcobjectsnewapp",
3
- "version": "2.4.9",
3
+ "version": "2.4.11",
4
4
  "description": "App template for New App in QCObjects",
5
- "main": "js/init.js",
5
+ "targets": {
6
+ "default": {
7
+ "source": "build/index.html",
8
+ "distDir": "public"
9
+ }
10
+ },
11
+ "main": "public/js/init.js",
12
+ "type": "commonjs",
13
+ "types": "src/ts/types/init.d.ts",
14
+ "browserslist": "> 0.5%, last 2 versions, not dead",
6
15
  "scripts": {
7
- "test": "((npx eslint *.js js/*.js js/packages/*.js spec/*.js --fix) && (npx jasmine)) || exit 0",
16
+ "test": "(npm run lint && (npx jasmine))",
17
+ "lint": "(npx eslint src/**/*.ts --fix --ext ts)",
8
18
  "sync": "git add . && git commit -am ",
9
19
  "preversion": "npm i --upgrade && npm test",
10
20
  "postversion": "git push && git push --tags",
11
21
  "coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
12
22
  "start": "npm run createcert && npm run serve",
13
- "serve": "node app.js",
14
- "server": "node app.js",
15
- "collab": "node -e \"require('qcobjects-cli/qcobjects-collab')\"",
16
- "shell": "node -e \"require('qcobjects-cli/qcobjects-shell')\"",
17
- "createcert": "node -e \"require('qcobjects-cli/qcobjects-createcert')\"",
23
+ "start:parcel": "npx parcel --dist-dir public",
24
+ "serve": "qcobjects-server",
25
+ "server": "npm run serve",
26
+ "collab": "qcobjects-collab",
27
+ "shell": "qcobjects shell",
28
+ "createcert": "qcobjects-createcert",
29
+ "v-patch": "qcobjects v-patch",
30
+ "v-minor": "qcobjects v-minor",
31
+ "v-major": "qcobjects v-major",
32
+ "qcobjects": "qcobjects",
33
+ "cli": "qcobjects",
18
34
  "http-server": "node -e \"require('qcobjects-cli/qcobjects-http-server')\"",
19
35
  "gae-server": "node -e \"require('qcobjects-cli/qcobjects-gae-http-server')\"",
20
- "build": "exit 0"
36
+ "azure-server": "npm start",
37
+ "aws-server": "npm start",
38
+ "do-server": "npm start",
39
+ "build:static": "rm -Rf build && (rsync -av --progress src/ build --exclude js )",
40
+ "build:ts": "npm test && npx tsc",
41
+ "build:ts-types": "npx -p typescript tsc src/**/*.ts --declaration --allowJs --esModuleInterop --emitDeclarationOnly --outDir types",
42
+ "publish:static": "rm -Rf public && (rsync -av --progress build/ public --exclude js --exclude index.html )",
43
+ "publish:local": "qcobjects publish local",
44
+ "publish:ios": "qcobjects publish ios",
45
+ "publish:android": "qcobjects publish android",
46
+ "publish:electron": "qcobjects publish electron",
47
+ "publish:esbuild": "cp build/index.html public/ && npx esbuild build/js/*.js build/js/**/*.js --bundle --outdir=public/js --keep-names --minify --global-name=global --sourcemap",
48
+ "publish:parcel": "npx parcel build",
49
+ "publish:web": "npm-run-all build:static build:ts publish:static publish:esbuild",
50
+ "prepare": "husky install",
51
+ "prestart": "npm run publish:web"
21
52
  },
22
53
  "repository": {
23
54
  "type": "file",
@@ -32,25 +63,48 @@
32
63
  "author": "Jean Machuca (correojean@gmail.com)",
33
64
  "license": "LGPL-3.0-or-later",
34
65
  "devDependencies": {
66
+ "@parcel/config-default": "^2.8.3",
67
+ "@parcel/packager-raw-url": "^2.8.3",
68
+ "@parcel/packager-ts": "^2.8.3",
69
+ "@parcel/transformer-typescript-tsc": "^2.8.3",
70
+ "@parcel/transformer-typescript-types": "^2.8.3",
71
+ "@parcel/transformer-webmanifest": "^2.8.3",
72
+ "@parcel/validator-typescript": "^2.8.3",
73
+ "@types/qcobjects": "github:QCObjects/-types-qcobjects",
74
+ "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk",
75
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
76
+ "@typescript-eslint/parser": "^5.58.0",
35
77
  "eslint": "^8.38.0",
78
+ "eslint-config-prettier": "^8.8.0",
36
79
  "eslint-config-qcobjects": "^0.0.26",
37
80
  "eslint-config-semistandard": "^17.0.0",
38
81
  "eslint-config-standard": "^17.0.0",
39
82
  "eslint-plugin-import": "^2.27.5",
40
83
  "eslint-plugin-n": "^15.7.0",
41
84
  "eslint-plugin-promise": "^6.1.1",
42
- "jasmine": "^3.99.0"
85
+ "hint": "^2.0.0",
86
+ "husky": "^8.0.3",
87
+ "jasmine": "^3.99.0",
88
+ "lint-staged": "^13.2.1",
89
+ "npm-run-all": "^4.1.5",
90
+ "parcel": "^2.8.3",
91
+ "process": "^0.11.10",
92
+ "qcobjects-cli": "^2.4.32",
93
+ "systemjs": "^6.14.1",
94
+ "typescript": "^5.0.4"
43
95
  },
44
96
  "dependencies": {
45
97
  "grunt": "^1.4.1",
46
98
  "grunt-contrib-jasmine": "^4.0.0",
47
99
  "nyc": "^15.1.0",
48
- "qcobjects": "^2.4.55",
49
- "qcobjects-cli": "^2.4.32",
50
- "qcobjects-sdk": "^2.4.28"
100
+ "qcobjects": "^2.4.67",
101
+ "qcobjects-sdk": "^2.4.30"
51
102
  },
52
103
  "engines": {
53
- "npm": ">=8.10.0",
54
- "node": ">=14.17.6"
104
+ "npm": ">=8",
105
+ "node": ">=16"
106
+ },
107
+ "lint-staged": {
108
+ "**/*": "prettier --write --ignore-unknown"
55
109
  }
56
110
  }
@@ -10,16 +10,16 @@
10
10
  <meta name="description" content="QCObjects New App v2.4">
11
11
  <link rel="canonical" href="https://newapp.qcobjects.dev/">
12
12
  <link rel="manifest" href="manifest.json">
13
- <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
14
- <link rel="icon" href="/favicon.ico" type="image/x-icon">
13
+ <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
14
+ <link rel="icon" href="./favicon.ico" type="image/x-icon">
15
15
  <meta name="mobile-web-app-capable" content="yes">
16
16
  <meta name="apple-mobile-web-app-capable" content="yes">
17
17
  <meta name="application-name" content="QCObjects New App">
18
18
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
19
19
  <meta name="apple-mobile-web-app-title" content="QCObjects New App">
20
- <link rel="icon" sizes="192x192" href="/img/icons/icon-192x192.png">
21
- <link rel="apple-touch-icon" href="/img/icons/icon-192x192.png">
22
- <meta name="msapplication-TileImage" content="/img/icons/icon-144x144.png">
20
+ <link rel="icon" sizes="192x192" href="./img/icons/icon-192x192.png">
21
+ <link rel="apple-touch-icon" href="./img/icons/icon-192x192.png">
22
+ <meta name="msapplication-TileImage" content="./img/icons/icon-144x144.png">
23
23
  <meta name="msapplication-TileColor" content="rgb(1,1,1)">
24
24
  <meta name="theme-color" content="rgb(1,1,1)">
25
25
  <meta property="og:title" content="QCObjects Config">
@@ -45,8 +45,7 @@
45
45
  data-cube_image="./img/Q_web-white.png"></splash-screen>
46
46
  <layout-basic splashscreen shadowed=true controllerClass="MainController" data-one="1" data-two="2">
47
47
  </layout-basic>
48
-
49
- <script type="module" src="js/init.js"></script>
48
+ <script type="module" src="js/init.js"></script>
50
49
  </body>
51
50
 
52
51
  </html>
@@ -0,0 +1,24 @@
1
+ import {CONFIG, Component, RegisterWidgets} from "qcobjects";
2
+ /*
3
+ * The next values are the default settings
4
+ * You can change any value in runtime by using CONFIG.set
5
+ * or changing the static initial value in a config.json file
6
+ */
7
+ CONFIG.set("sourceType", "module");
8
+ CONFIG.set("relativeImportPath", "js/packages/");
9
+ CONFIG.set("componentsBasePath", "templates/components/");
10
+ CONFIG.set("delayForReady", 1); // delay to wait before executing the first ready event, it includes imports
11
+ CONFIG.set("preserveComponentBodyTag", false); // don't use <componentBody></componentBody> tag
12
+ CONFIG.set("useConfigService", false); // Load settings from config.json
13
+ CONFIG.set("routingWay", "hash"); // routingWay possible values are 'hash','pathname','search'
14
+ CONFIG.set("useLocalSDK", true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
15
+ CONFIG.set("tplextension", "tpl.html"); // this is the file extension to locate the template files (if component.name = 'main' then template name will be main.tpl.html)
16
+ CONFIG.set("asynchronousImportsLoad", true); // it is recommended to load the Import declarations in an asyncronous way
17
+ CONFIG.set("serviceWorkerURI", "/sw.js"); // QCObjects will register an launch this service worker automatically to work offline
18
+
19
+ // if Component.cached is true, all the Class('Component') declarations will save the template in a localStorage cache
20
+ // until a cached=false attribute is found in a <component> html declaration
21
+ Component.cached = true; // this will load js/packages/org.quickcorp.custom.js file
22
+
23
+ // eslint-disable-next-line no-undef
24
+ RegisterWidgets("layout-basic", "splash-screen", "github-grid", "octocat-icon", "lib-list");
package/src/js/init.ts ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * QCObjects New App PWA Template 1.x
4
+ * ________________
5
+ *
6
+ * Author: Jean Machuca <correojean@gmail.com>
7
+ *
8
+ * Cross Browser Javascript Framework for MVC Patterns
9
+ * QuickCorp/QCObjects is licensed under the
10
+ * GNU Lesser General Public License v3.0
11
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
12
+ *
13
+ * Permissions of this copyleft license are conditioned on making available
14
+ * complete source code of licensed works and modifications under the same
15
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
16
+ * Contributors provide an express grant of patent rights. However, a larger
17
+ * work using the licensed work through interfaces provided by the licensed
18
+ * work may be distributed under different terms and without source code for
19
+ * the larger work.
20
+ *
21
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
22
+ *
23
+ * Everyone is permitted to copy and distribute verbatim copies of this
24
+ * license document, but changing it is not allowed.
25
+ */
26
+ import "./config";
27
+ import "./packages/org.quickcorp.custom";
@@ -1,15 +1,29 @@
1
+ /* eslint-disable no-unreachable */
1
2
  "use strict";
3
+ import global, { InheritClass, Package, logger } from "qcobjects";
4
+ import { NotificationComponent } from "qcobjects-sdk";
5
+
2
6
  Package("com.qcobjects.installer", [
3
- class Installer extends ClassFactory("InheritClass") {
4
- constructor ({ root }) {
5
- super(...arguments);
7
+ class Installer extends InheritClass{
8
+ root: Element;
9
+ promptEvent!: HTMLElement;
10
+
11
+ /**
12
+ * Creates an instance of Installer.
13
+ * @date 18/04/2023 - 22:27:17
14
+ *
15
+ * @constructor
16
+ * @param {HTMLElement} root
17
+ */
18
+ constructor(root:HTMLElement) {
19
+ super();
6
20
 
7
21
  this.root = root;
8
- window.addEventListener("beforeinstallprompt", this.beforeinstallprompt.bind(this), false);
9
- window.addEventListener("appinstalled", this.installed.bind(this), false);
22
+ window.addEventListener("beforeinstallprompt", ()=>this.beforeinstallprompt.bind(this), false);
23
+ window.addEventListener("appinstalled", ()=>this.installed.bind(this), false);
10
24
 
11
- root.addEventListener("click", this.install.bind(this));
12
- root.addEventListener("touchend", this.install.bind(this));
25
+ root.addEventListener("click", ()=>this.install.bind(this));
26
+ root.addEventListener("touchend", ()=>this.install.bind(this));
13
27
 
14
28
  window.matchMedia("(display-mode: standalone)").addEventListener("change", (evt) => {
15
29
  let displayMode = "browser";
@@ -21,33 +35,46 @@ Package("com.qcobjects.installer", [
21
35
  global.set("installer", this);
22
36
  }
23
37
 
24
- promptEvent = null;
25
-
26
- beforeinstallprompt (e) {
38
+ /**
39
+ * It is executed before the install prompt event
40
+ * @date 18/04/2023 - 22:27:30
41
+ *
42
+ * @param {Event} e
43
+ * @returns {boolean}
44
+ */
45
+ beforeinstallprompt(e:Event) {
27
46
  logger.debug("registering installer event");
28
47
  e.preventDefault();
29
- this.promptEvent = e;
48
+ global.set("promptEvent", e);
30
49
  this.root.classList.add("available");
31
50
  return false;
32
51
  }
33
52
 
34
- installed () {
53
+ /**
54
+ * it works after the install event
55
+ * @date 18/04/2023 - 22:28:36
56
+ */
57
+ installed() {
35
58
  logger.debug("app is already installed");
36
- this.promptEvent = null;
59
+ global.set("promptEvent", null);
37
60
  // This fires after onbeforinstallprompt OR after manual add to homescreen.
38
61
  this.root.classList.remove("available");
39
62
  }
40
63
 
41
- install () {
64
+ /**
65
+ * it executes the install after the button click
66
+ * @date 18/04/2023 - 22:29:11
67
+ */
68
+ install() {
42
69
  const root = this.root;
43
70
  logger.debug("installer actioned");
44
- let promptEvent = this.promptEvent;
71
+ let promptEvent = global.get("promptEvent", null);
45
72
  if (promptEvent) {
46
73
  logger.debug("prompt event");
47
74
 
48
75
  promptEvent.prompt();
49
76
  promptEvent.userChoice
50
- .then(function (choiceResult) {
77
+ .then(function (choiceResult: { outcome: string; }) {
51
78
  if (choiceResult.outcome === "accepted") {
52
79
  // The user actioned the prompt (good or bad).
53
80
  // good is handled in
@@ -57,7 +84,7 @@ Package("com.qcobjects.installer", [
57
84
  }
58
85
  promptEvent = null;
59
86
  })
60
- .catch(function (installError) {
87
+ .catch(function (installError: { toString: () => any; }) {
61
88
  // Boo. update the UI.
62
89
  promptEvent = null;
63
90
  root.classList.remove("available");
@@ -69,3 +96,4 @@ Package("com.qcobjects.installer", [
69
96
  }
70
97
  }
71
98
  ]);
99
+