@gloww/gloww 0.9.0-beta.59 → 0.9.0-beta.61
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 +24 -24
- package/compute-version.js +117 -117
- package/esm2020/gloww-gloww.mjs +4 -4
- package/esm2020/lib/Components/auto-complete/auto-complete.component.mjs +151 -151
- package/esm2020/lib/Components/code-editor/code-editor.component.mjs +155 -155
- package/esm2020/lib/Components/confirmation/confirmation.component.mjs +43 -43
- package/esm2020/lib/Components/datetime/datetime.component.mjs +84 -84
- package/esm2020/lib/Components/display-objects/display-objects.component.mjs +618 -618
- package/esm2020/lib/Components/display-objects-configuration.mjs +2 -2
- package/esm2020/lib/Components/download-progress/download-progress.component.mjs +117 -117
- package/esm2020/lib/Components/dummy/dummy.component.mjs +14 -14
- package/esm2020/lib/Components/folders/file-edit/file-edit.component.mjs +90 -90
- package/esm2020/lib/Components/folders/folders/folders.component.mjs +180 -180
- package/esm2020/lib/Components/header/header.component.mjs +14 -14
- package/esm2020/lib/Components/html-editor/html-editor.component.mjs +175 -175
- package/esm2020/lib/Components/menu-list-item/menu-list-item.component.mjs +107 -107
- package/esm2020/lib/Components/prompt/prompt.component.mjs +52 -52
- package/esm2020/lib/Components/result-table/result-table.component.mjs +21 -21
- package/esm2020/lib/Components/search-form/search-form.component.mjs +14 -14
- package/esm2020/lib/Components/secure-a/secure-a.component.mjs +31 -31
- package/esm2020/lib/Components/secure-img/secure-img.component.mjs +45 -45
- package/esm2020/lib/Components/select/select.component.mjs +123 -123
- package/esm2020/lib/Components/upload-doc/upload-doc.component.mjs +95 -95
- package/esm2020/lib/Components/upload-file/upload-file.component.mjs +146 -146
- package/esm2020/lib/Directives/file-sink.directive.mjs +52 -52
- package/esm2020/lib/Guards/has-unsaved-data.guard.mjs +29 -29
- package/esm2020/lib/Guards/ihas-unsaved-data.mjs +2 -2
- package/esm2020/lib/Helpers/gloww-validators.mjs +116 -116
- package/esm2020/lib/Models/nav-item.mjs +2 -2
- package/esm2020/lib/Pipes/html-format.pipe.mjs +23 -23
- package/esm2020/lib/Pipes/retry-with-delay.mjs +12 -12
- package/esm2020/lib/Pipes/safe-html.pipe.mjs +22 -22
- package/esm2020/lib/Pipes/secure.pipe.mjs +34 -34
- package/esm2020/lib/Services/dialog.service.mjs +29 -29
- package/esm2020/lib/Services/folder-service-config.mjs +21 -21
- package/esm2020/lib/Services/folder.service.mjs +54 -54
- package/esm2020/lib/Services/gloww.service.mjs +83 -83
- package/esm2020/lib/Services/nav.service.mjs +28 -28
- package/esm2020/lib/Services/snippets.service.mjs +25 -25
- package/esm2020/lib/Services/version-check.service.mjs +81 -81
- package/esm2020/lib/Services/voice-recognition.service.mjs +55 -55
- package/esm2020/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.mjs +67 -67
- package/esm2020/lib/gloww-security/Components/login/login.component.mjs +173 -173
- package/esm2020/lib/gloww-security/Components/social-network/social-network.component.mjs +46 -46
- package/esm2020/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.mjs +52 -52
- package/esm2020/lib/gloww-security/Components/user-menu/user-menu.component.mjs +73 -73
- package/esm2020/lib/gloww-security/Helpers/administrator.guard.mjs +27 -27
- package/esm2020/lib/gloww-security/Helpers/auth.guard.mjs +57 -57
- package/esm2020/lib/gloww-security/Helpers/error.interceptor.mjs +29 -29
- package/esm2020/lib/gloww-security/Helpers/index.mjs +5 -5
- package/esm2020/lib/gloww-security/Helpers/jwt.interceptor.mjs +31 -31
- package/esm2020/lib/gloww-security/Helpers/staging.interceptor.mjs +24 -24
- package/esm2020/lib/gloww-security/Models/oauthassociation.mjs +6 -6
- package/esm2020/lib/gloww-security/Models/user.mjs +3 -3
- package/esm2020/lib/gloww-security/Services/authentication-service-config.mjs +25 -25
- package/esm2020/lib/gloww-security/Services/authentication.service.mjs +205 -205
- package/esm2020/lib/gloww-security/Services/gloww-security.service.mjs +14 -14
- package/esm2020/lib/gloww-security/gloww-security.module.mjs +171 -171
- package/esm2020/lib/gloww.module.mjs +281 -281
- package/esm2020/lib/injection-token.mjs +3 -3
- package/esm2020/public-api.mjs +40 -40
- package/fesm2015/gloww-gloww.mjs +3752 -3752
- package/fesm2015/gloww-gloww.mjs.map +1 -1
- package/fesm2020/gloww-gloww.mjs +3694 -3694
- package/fesm2020/gloww-gloww.mjs.map +1 -1
- package/gloww-assets/gloww.svg +315 -315
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.eps +814 -814
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.svg +23 -23
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.eps +1866 -1866
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.svg +50 -50
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.eps +1031 -1031
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.svg +49 -49
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.eps +1031 -1031
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.svg +49 -49
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.eps +814 -814
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.svg +23 -23
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.eps +1837 -1837
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.svg +43 -43
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.eps +1002 -1002
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.svg +42 -42
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.eps +1002 -1002
- package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.svg +42 -42
- package/gloww-gloww.d.ts +5 -5
- package/gloww.theme.scss +157 -157
- package/lib/Components/auto-complete/auto-complete.component.d.ts +39 -39
- package/lib/Components/code-editor/code-editor.component.d.ts +45 -45
- package/lib/Components/confirmation/confirmation.component.d.ts +20 -20
- package/lib/Components/datetime/datetime.component.d.ts +22 -22
- package/lib/Components/display-objects/display-objects.component.d.ts +101 -101
- package/lib/Components/display-objects-configuration.d.ts +5 -5
- package/lib/Components/download-progress/download-progress.component.d.ts +30 -30
- package/lib/Components/dummy/dummy.component.d.ts +8 -8
- package/lib/Components/folders/file-edit/file-edit.component.d.ts +38 -38
- package/lib/Components/folders/folders/folders.component.d.ts +33 -33
- package/lib/Components/header/header.component.d.ts +8 -8
- package/lib/Components/html-editor/html-editor.component.d.ts +36 -36
- package/lib/Components/menu-list-item/menu-list-item.component.d.ts +30 -30
- package/lib/Components/prompt/prompt.component.d.ts +25 -25
- package/lib/Components/result-table/result-table.component.d.ts +11 -11
- package/lib/Components/search-form/search-form.component.d.ts +8 -8
- package/lib/Components/secure-a/secure-a.component.d.ts +13 -13
- package/lib/Components/secure-img/secure-img.component.d.ts +17 -17
- package/lib/Components/select/select.component.d.ts +33 -33
- package/lib/Components/upload-doc/upload-doc.component.d.ts +19 -19
- package/lib/Components/upload-file/upload-file.component.d.ts +34 -34
- package/lib/Directives/file-sink.directive.d.ts +11 -11
- package/lib/Guards/has-unsaved-data.guard.d.ts +8 -8
- package/lib/Guards/ihas-unsaved-data.d.ts +3 -3
- package/lib/Helpers/gloww-validators.d.ts +39 -39
- package/lib/Models/nav-item.d.ts +9 -9
- package/lib/Pipes/html-format.pipe.d.ts +10 -10
- package/lib/Pipes/retry-with-delay.d.ts +2 -2
- package/lib/Pipes/safe-html.pipe.d.ts +10 -10
- package/lib/Pipes/secure.pipe.d.ts +13 -13
- package/lib/Services/dialog.service.d.ts +11 -11
- package/lib/Services/folder-service-config.d.ts +7 -7
- package/lib/Services/folder.service.d.ts +20 -20
- package/lib/Services/gloww.service.d.ts +28 -28
- package/lib/Services/nav.service.d.ts +13 -13
- package/lib/Services/snippets.service.d.ts +16 -16
- package/lib/Services/version-check.service.d.ts +30 -30
- package/lib/Services/voice-recognition.service.d.ts +14 -14
- package/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.d.ts +19 -19
- package/lib/gloww-security/Components/login/login.component.d.ts +43 -43
- package/lib/gloww-security/Components/social-network/social-network.component.d.ts +25 -25
- package/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.d.ts +21 -21
- package/lib/gloww-security/Components/user-menu/user-menu.component.d.ts +24 -24
- package/lib/gloww-security/Helpers/administrator.guard.d.ts +14 -14
- package/lib/gloww-security/Helpers/auth.guard.d.ts +14 -14
- package/lib/gloww-security/Helpers/error.interceptor.d.ts +11 -11
- package/lib/gloww-security/Helpers/index.d.ts +4 -4
- package/lib/gloww-security/Helpers/jwt.interceptor.d.ts +11 -11
- package/lib/gloww-security/Helpers/staging.interceptor.d.ts +9 -9
- package/lib/gloww-security/Models/oauthassociation.d.ts +7 -7
- package/lib/gloww-security/Models/user.d.ts +9 -9
- package/lib/gloww-security/Services/authentication-service-config.d.ts +17 -17
- package/lib/gloww-security/Services/authentication.service.d.ts +40 -40
- package/lib/gloww-security/Services/gloww-security.service.d.ts +6 -6
- package/lib/gloww-security/gloww-security.module.d.ts +35 -35
- package/lib/gloww.module.d.ts +76 -76
- package/lib/injection-token.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +36 -36
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# Gloww
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.7.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project gloww` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project gloww`.
|
|
8
|
-
> Note: Don't forget to add `--project gloww` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build gloww` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build gloww`, go to the dist folder `cd dist/gloww` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test gloww` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
1
|
+
# Gloww
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.7.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project gloww` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project gloww`.
|
|
8
|
+
> Note: Don't forget to add `--project gloww` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build gloww` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build gloww`, go to the dist folder `cd dist/gloww` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test gloww` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
package/compute-version.js
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const util = require('util');
|
|
4
|
-
const yargs = require('yargs');
|
|
5
|
-
|
|
6
|
-
// get application version from package.json
|
|
7
|
-
console.log(`Current directory: ${process.cwd()}`);
|
|
8
|
-
|
|
9
|
-
const argv = yargs
|
|
10
|
-
.option('project', { alias: 'p', description: 'project', type: 'string' })
|
|
11
|
-
.option('path', { alias: 'd', description: 'path', type: 'string' })
|
|
12
|
-
.help()
|
|
13
|
-
.alias('help', 'h')
|
|
14
|
-
.argv;
|
|
15
|
-
|
|
16
|
-
let packagejsonfile = `${process.cwd()}/package.json`
|
|
17
|
-
let distPath = `${process.cwd()}/${argv.path}`;
|
|
18
|
-
let versionFilePath = path.join(`${process.cwd()}/${argv.path}/version.json`);
|
|
19
|
-
const appVersion = require(packagejsonfile).version;
|
|
20
|
-
|
|
21
|
-
if (argv.project) {
|
|
22
|
-
packagejsonfile = `${process.cwd()}/projects/${argv.project}/package.json`
|
|
23
|
-
distPath = path.join(`${process.cwd()}/${argv.path}/${argv.project}`);
|
|
24
|
-
versionFilePath = path.join(`${process.cwd()}/${argv.path}/${argv.project}/version.json`);
|
|
25
|
-
console.log(packagejsonfile);
|
|
26
|
-
console.log(versionFilePath);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
console.log(`packagejsonfile: ${packagejsonfile}`);
|
|
30
|
-
var appVersionPrj = appVersion;
|
|
31
|
-
try {
|
|
32
|
-
appVersionPrj = require(packagejsonfile).version;//require('./../package.json').version;
|
|
33
|
-
} catch { }
|
|
34
|
-
|
|
35
|
-
// promisify core API's
|
|
36
|
-
const readDir = util.promisify(fs.readdir);
|
|
37
|
-
const writeFile = util.promisify(fs.writeFile);
|
|
38
|
-
const readFile = util.promisify(fs.readFile);
|
|
39
|
-
|
|
40
|
-
console.log('\nRunning post-build tasks');
|
|
41
|
-
|
|
42
|
-
// our version.json will be in the dist folder
|
|
43
|
-
console.log(`versionFilePath: ${versionFilePath}`);
|
|
44
|
-
|
|
45
|
-
let mainHash = '';
|
|
46
|
-
let mainBundleEs5File = '';
|
|
47
|
-
|
|
48
|
-
// RegExp to find main.bundle.js, even if it doesn't include a hash in it's name (dev build)
|
|
49
|
-
let mainBundleEs5Regexp = /^main-es5.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
50
|
-
let mainBundleRegexp = /^main.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
51
|
-
let mainRegexp = /^main.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
52
|
-
|
|
53
|
-
// read the dist folder files and find the one we're looking for
|
|
54
|
-
readDir(distPath)
|
|
55
|
-
.then(files => {
|
|
56
|
-
mainBundleFile = files.find(f => mainBundleRegexp.test(f));
|
|
57
|
-
mainBundleEs5File = files.find(f => mainBundleEs5Regexp.test(f));
|
|
58
|
-
mainFile = files.find(f => mainRegexp.test(f));
|
|
59
|
-
console.log(`mainBundleEs5File ${mainBundleEs5File}`);
|
|
60
|
-
|
|
61
|
-
if (mainBundleEs5File) {
|
|
62
|
-
let matchHash = mainBundleEs5File.match(mainBundleEs5Regexp);
|
|
63
|
-
|
|
64
|
-
// if it has a hash in it's name, mark it down
|
|
65
|
-
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
66
|
-
mainHash = matchHash[1];
|
|
67
|
-
}
|
|
68
|
-
} if (mainBundleFile) {
|
|
69
|
-
let matchHash = mainBundleFile.match(mainBundleRegexp);
|
|
70
|
-
|
|
71
|
-
// if it has a hash in it's name, mark it down
|
|
72
|
-
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
73
|
-
mainHash = matchHash[1];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (mainFile) {
|
|
77
|
-
let matchHash = mainFile.match(mainRegexp);
|
|
78
|
-
|
|
79
|
-
// if it has a hash in it's name, mark it down
|
|
80
|
-
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
81
|
-
mainHash = matchHash[1];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
console.log(`Writing version and hash to ${versionFilePath}`);
|
|
87
|
-
|
|
88
|
-
// write current version and hash into the version.json file
|
|
89
|
-
const src = `{ "version": "${appVersionPrj}", "hash": "${mainHash}" }`;
|
|
90
|
-
return writeFile(versionFilePath, src);
|
|
91
|
-
}).then(() => {
|
|
92
|
-
// main bundle file not found, dev build?
|
|
93
|
-
if (!mainBundleEs5File && !mainBundleFile && !mainFile) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
console.log(`Replacing hash in the main files`);
|
|
98
|
-
|
|
99
|
-
// replace hash placeholder in our main.js file so the code knows it's current hash
|
|
100
|
-
readDir(distPath)
|
|
101
|
-
.then(files => {
|
|
102
|
-
console.log(files.length);
|
|
103
|
-
files.forEach(f => {
|
|
104
|
-
const mainFilepath = path.join(distPath, f);
|
|
105
|
-
if (mainFilepath.match(/\.js$/ig) && !f.match(/^runtime/ig)) {
|
|
106
|
-
console.log(`mainFilepath ${mainFilepath}`);
|
|
107
|
-
readFile(mainFilepath, 'utf8')
|
|
108
|
-
.then(mainFileData => {
|
|
109
|
-
const replacedFile = mainFileData.replace(/\{\{POST_BUILD_ENTERS_HASH_HERE\}\}/ig, mainHash);
|
|
110
|
-
writeFile(mainFilepath, replacedFile);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
}).catch(err => {
|
|
116
|
-
console.log('Error with post build:', err);
|
|
117
|
-
});
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const util = require('util');
|
|
4
|
+
const yargs = require('yargs');
|
|
5
|
+
|
|
6
|
+
// get application version from package.json
|
|
7
|
+
console.log(`Current directory: ${process.cwd()}`);
|
|
8
|
+
|
|
9
|
+
const argv = yargs
|
|
10
|
+
.option('project', { alias: 'p', description: 'project', type: 'string' })
|
|
11
|
+
.option('path', { alias: 'd', description: 'path', type: 'string' })
|
|
12
|
+
.help()
|
|
13
|
+
.alias('help', 'h')
|
|
14
|
+
.argv;
|
|
15
|
+
|
|
16
|
+
let packagejsonfile = `${process.cwd()}/package.json`
|
|
17
|
+
let distPath = `${process.cwd()}/${argv.path}`;
|
|
18
|
+
let versionFilePath = path.join(`${process.cwd()}/${argv.path}/version.json`);
|
|
19
|
+
const appVersion = require(packagejsonfile).version;
|
|
20
|
+
|
|
21
|
+
if (argv.project) {
|
|
22
|
+
packagejsonfile = `${process.cwd()}/projects/${argv.project}/package.json`
|
|
23
|
+
distPath = path.join(`${process.cwd()}/${argv.path}/${argv.project}`);
|
|
24
|
+
versionFilePath = path.join(`${process.cwd()}/${argv.path}/${argv.project}/version.json`);
|
|
25
|
+
console.log(packagejsonfile);
|
|
26
|
+
console.log(versionFilePath);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(`packagejsonfile: ${packagejsonfile}`);
|
|
30
|
+
var appVersionPrj = appVersion;
|
|
31
|
+
try {
|
|
32
|
+
appVersionPrj = require(packagejsonfile).version;//require('./../package.json').version;
|
|
33
|
+
} catch { }
|
|
34
|
+
|
|
35
|
+
// promisify core API's
|
|
36
|
+
const readDir = util.promisify(fs.readdir);
|
|
37
|
+
const writeFile = util.promisify(fs.writeFile);
|
|
38
|
+
const readFile = util.promisify(fs.readFile);
|
|
39
|
+
|
|
40
|
+
console.log('\nRunning post-build tasks');
|
|
41
|
+
|
|
42
|
+
// our version.json will be in the dist folder
|
|
43
|
+
console.log(`versionFilePath: ${versionFilePath}`);
|
|
44
|
+
|
|
45
|
+
let mainHash = '';
|
|
46
|
+
let mainBundleEs5File = '';
|
|
47
|
+
|
|
48
|
+
// RegExp to find main.bundle.js, even if it doesn't include a hash in it's name (dev build)
|
|
49
|
+
let mainBundleEs5Regexp = /^main-es5.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
50
|
+
let mainBundleRegexp = /^main.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
51
|
+
let mainRegexp = /^main.?([a-z0-9]*)?(\.bundle)?.js$/;
|
|
52
|
+
|
|
53
|
+
// read the dist folder files and find the one we're looking for
|
|
54
|
+
readDir(distPath)
|
|
55
|
+
.then(files => {
|
|
56
|
+
mainBundleFile = files.find(f => mainBundleRegexp.test(f));
|
|
57
|
+
mainBundleEs5File = files.find(f => mainBundleEs5Regexp.test(f));
|
|
58
|
+
mainFile = files.find(f => mainRegexp.test(f));
|
|
59
|
+
console.log(`mainBundleEs5File ${mainBundleEs5File}`);
|
|
60
|
+
|
|
61
|
+
if (mainBundleEs5File) {
|
|
62
|
+
let matchHash = mainBundleEs5File.match(mainBundleEs5Regexp);
|
|
63
|
+
|
|
64
|
+
// if it has a hash in it's name, mark it down
|
|
65
|
+
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
66
|
+
mainHash = matchHash[1];
|
|
67
|
+
}
|
|
68
|
+
} if (mainBundleFile) {
|
|
69
|
+
let matchHash = mainBundleFile.match(mainBundleRegexp);
|
|
70
|
+
|
|
71
|
+
// if it has a hash in it's name, mark it down
|
|
72
|
+
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
73
|
+
mainHash = matchHash[1];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (mainFile) {
|
|
77
|
+
let matchHash = mainFile.match(mainRegexp);
|
|
78
|
+
|
|
79
|
+
// if it has a hash in it's name, mark it down
|
|
80
|
+
if (matchHash.length > 1 && !!matchHash[1]) {
|
|
81
|
+
mainHash = matchHash[1];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
console.log(`Writing version and hash to ${versionFilePath}`);
|
|
87
|
+
|
|
88
|
+
// write current version and hash into the version.json file
|
|
89
|
+
const src = `{ "version": "${appVersionPrj}", "hash": "${mainHash}" }`;
|
|
90
|
+
return writeFile(versionFilePath, src);
|
|
91
|
+
}).then(() => {
|
|
92
|
+
// main bundle file not found, dev build?
|
|
93
|
+
if (!mainBundleEs5File && !mainBundleFile && !mainFile) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
console.log(`Replacing hash in the main files`);
|
|
98
|
+
|
|
99
|
+
// replace hash placeholder in our main.js file so the code knows it's current hash
|
|
100
|
+
readDir(distPath)
|
|
101
|
+
.then(files => {
|
|
102
|
+
console.log(files.length);
|
|
103
|
+
files.forEach(f => {
|
|
104
|
+
const mainFilepath = path.join(distPath, f);
|
|
105
|
+
if (mainFilepath.match(/\.js$/ig) && !f.match(/^runtime/ig)) {
|
|
106
|
+
console.log(`mainFilepath ${mainFilepath}`);
|
|
107
|
+
readFile(mainFilepath, 'utf8')
|
|
108
|
+
.then(mainFileData => {
|
|
109
|
+
const replacedFile = mainFileData.replace(/\{\{POST_BUILD_ENTERS_HASH_HERE\}\}/ig, mainHash);
|
|
110
|
+
writeFile(mainFilepath, replacedFile);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}).catch(err => {
|
|
116
|
+
console.log('Error with post build:', err);
|
|
117
|
+
});
|
package/esm2020/gloww-gloww.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xvd3ctZ2xvd3cuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9nbG93dy9zcmMvZ2xvd3ctZ2xvd3cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|