@ofidj/generator-fidj 1.0.0

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 (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/generators/app/index.js +200 -0
  4. package/generators/app/templates/app2018/.travis.yml +35 -0
  5. package/generators/app/templates/app2018/LICENSE +21 -0
  6. package/generators/app/templates/app2018/Procfile +1 -0
  7. package/generators/app/templates/app2018/README.md +49 -0
  8. package/generators/app/templates/app2018/config.xml +91 -0
  9. package/generators/app/templates/app2018/gulpfile.js +63 -0
  10. package/generators/app/templates/app2018/ionic.config.json +9 -0
  11. package/generators/app/templates/app2018/package.json +90 -0
  12. package/generators/app/templates/app2018/platforms/README.md +1 -0
  13. package/generators/app/templates/app2018/resources/README.md +6 -0
  14. package/generators/app/templates/app2018/resources/icon.png +0 -0
  15. package/generators/app/templates/app2018/resources/marketing-01-ipad.png +0 -0
  16. package/generators/app/templates/app2018/resources/marketing-01-iphone.png +0 -0
  17. package/generators/app/templates/app2018/resources/marketing-02-ipad.png +0 -0
  18. package/generators/app/templates/app2018/resources/marketing-02-iphone.png +0 -0
  19. package/generators/app/templates/app2018/resources/marketing-03-ipad.png +0 -0
  20. package/generators/app/templates/app2018/resources/marketing-03-iphone.png +0 -0
  21. package/generators/app/templates/app2018/resources/marketing.json +19 -0
  22. package/generators/app/templates/app2018/resources/splash.png +0 -0
  23. package/generators/app/templates/app2018/src/app/app.component.ts +88 -0
  24. package/generators/app/templates/app2018/src/app/app.html +19 -0
  25. package/generators/app/templates/app2018/src/app/app.module.ts +40 -0
  26. package/generators/app/templates/app2018/src/app/app.scss +16 -0
  27. package/generators/app/templates/app2018/src/app/main.ts +5 -0
  28. package/generators/app/templates/app2018/src/app/shared/card.model.ts +10 -0
  29. package/generators/app/templates/app2018/src/app/shared/profile.service.ts +46 -0
  30. package/generators/app/templates/app2018/src/app/shared/shared.module.ts +35 -0
  31. package/generators/app/templates/app2018/src/app/shared/storage.service.ts +11 -0
  32. package/generators/app/templates/app2018/src/app/shared/version.const.ts +5 -0
  33. package/generators/app/templates/app2018/src/assets/icon/favicon.ico +0 -0
  34. package/generators/app/templates/app2018/src/assets/imgs/gg.png +0 -0
  35. package/generators/app/templates/app2018/src/assets/imgs/github.png +0 -0
  36. package/generators/app/templates/app2018/src/assets/imgs/login.svg +5668 -0
  37. package/generators/app/templates/app2018/src/assets/imgs/logo.png +0 -0
  38. package/generators/app/templates/app2018/src/index.html +49 -0
  39. package/generators/app/templates/app2018/src/manifest.json +13 -0
  40. package/generators/app/templates/app2018/src/pages/home/home.html +56 -0
  41. package/generators/app/templates/app2018/src/pages/home/home.scss +3 -0
  42. package/generators/app/templates/app2018/src/pages/home/home.ts +126 -0
  43. package/generators/app/templates/app2018/src/pages/login/login.html +56 -0
  44. package/generators/app/templates/app2018/src/pages/login/login.scss +44 -0
  45. package/generators/app/templates/app2018/src/pages/login/login.ts +59 -0
  46. package/generators/app/templates/app2018/src/pages/profile/profile.html +33 -0
  47. package/generators/app/templates/app2018/src/pages/profile/profile.scss +3 -0
  48. package/generators/app/templates/app2018/src/pages/profile/profile.ts +36 -0
  49. package/generators/app/templates/app2018/src/service-worker.js +31 -0
  50. package/generators/app/templates/app2018/src/theme/variables.scss +88 -0
  51. package/generators/app/templates/app2018/tests/karma.unit-tests.conf.js +84 -0
  52. package/generators/app/templates/app2018/tests/unit/app.test.js +10 -0
  53. package/generators/app/templates/app2018/tsconfig.json +28 -0
  54. package/generators/app/templates/app2018/tslint.json +8 -0
  55. package/generators/app/templates/app2018/web.js +21 -0
  56. package/generators/app/templates/app2021/.travis.yml +32 -0
  57. package/generators/app/templates/app2021/LICENSE +21 -0
  58. package/generators/app/templates/app2021/Procfile +1 -0
  59. package/generators/app/templates/app2021/README.md +45 -0
  60. package/generators/app/templates/app2021/angular.json +188 -0
  61. package/generators/app/templates/app2021/browserslist +12 -0
  62. package/generators/app/templates/app2021/ionic.config.json +9 -0
  63. package/generators/app/templates/app2021/karma.conf.js +31 -0
  64. package/generators/app/templates/app2021/package-lock.json +5 -0
  65. package/generators/app/templates/app2021/package.json +77 -0
  66. package/generators/app/templates/app2021/platforms/README.md +1 -0
  67. package/generators/app/templates/app2021/resources/README.md +6 -0
  68. package/generators/app/templates/app2021/resources/icon.png +0 -0
  69. package/generators/app/templates/app2021/resources/marketing-01-ipad.png +0 -0
  70. package/generators/app/templates/app2021/resources/marketing-01-iphone.png +0 -0
  71. package/generators/app/templates/app2021/resources/marketing-02-ipad.png +0 -0
  72. package/generators/app/templates/app2021/resources/marketing-02-iphone.png +0 -0
  73. package/generators/app/templates/app2021/resources/marketing-03-ipad.png +0 -0
  74. package/generators/app/templates/app2021/resources/marketing-03-iphone.png +0 -0
  75. package/generators/app/templates/app2021/resources/marketing.json +19 -0
  76. package/generators/app/templates/app2021/resources/splash.png +0 -0
  77. package/generators/app/templates/app2021/src/app/app-routing.module.ts +25 -0
  78. package/generators/app/templates/app2021/src/app/app.component.html +3 -0
  79. package/generators/app/templates/app2021/src/app/app.component.scss +0 -0
  80. package/generators/app/templates/app2021/src/app/app.component.spec.ts +50 -0
  81. package/generators/app/templates/app2021/src/app/app.component.ts +28 -0
  82. package/generators/app/templates/app2021/src/app/app.module.ts +24 -0
  83. package/generators/app/templates/app2021/src/app/content/content-routing.module.ts +16 -0
  84. package/generators/app/templates/app2021/src/app/content/content.module.ts +20 -0
  85. package/generators/app/templates/app2021/src/app/content/content.page.html +31 -0
  86. package/generators/app/templates/app2021/src/app/content/content.page.scss +0 -0
  87. package/generators/app/templates/app2021/src/app/content/content.page.ts +26 -0
  88. package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.html +4 -0
  89. package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.scss +4 -0
  90. package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.spec.ts +24 -0
  91. package/generators/app/templates/app2021/src/app/explore-container/explore-container.component.ts +16 -0
  92. package/generators/app/templates/app2021/src/app/explore-container/explore-container.module.ts +14 -0
  93. package/generators/app/templates/app2021/src/app/my/my-routing.module.ts +36 -0
  94. package/generators/app/templates/app2021/src/app/my/my.module.ts +19 -0
  95. package/generators/app/templates/app2021/src/app/my/my.page.html +15 -0
  96. package/generators/app/templates/app2021/src/app/my/my.page.scss +1 -0
  97. package/generators/app/templates/app2021/src/app/my/my.page.spec.ts +26 -0
  98. package/generators/app/templates/app2021/src/app/my/my.page.ts +25 -0
  99. package/generators/app/templates/app2021/src/app/profile/profile-routing.module.ts +16 -0
  100. package/generators/app/templates/app2021/src/app/profile/profile.module.ts +20 -0
  101. package/generators/app/templates/app2021/src/app/profile/profile.page.html +49 -0
  102. package/generators/app/templates/app2021/src/app/profile/profile.page.scss +0 -0
  103. package/generators/app/templates/app2021/src/app/profile/profile.page.spec.ts +25 -0
  104. package/generators/app/templates/app2021/src/app/profile/profile.page.ts +44 -0
  105. package/generators/app/templates/app2021/src/app/shared/const.ts +3 -0
  106. package/generators/app/templates/app2021/src/app/signin/signin-routing.module.ts +16 -0
  107. package/generators/app/templates/app2021/src/app/signin/signin.module.ts +18 -0
  108. package/generators/app/templates/app2021/src/app/signin/signin.page.html +53 -0
  109. package/generators/app/templates/app2021/src/app/signin/signin.page.scss +36 -0
  110. package/generators/app/templates/app2021/src/app/signin/signin.page.ts +69 -0
  111. package/generators/app/templates/app2021/src/assets/icon/favicon.png +0 -0
  112. package/generators/app/templates/app2021/src/assets/shapes.svg +1 -0
  113. package/generators/app/templates/app2021/src/environments/environment.prod.ts +3 -0
  114. package/generators/app/templates/app2021/src/environments/environment.ts +16 -0
  115. package/generators/app/templates/app2021/src/global.scss +26 -0
  116. package/generators/app/templates/app2021/src/index.html +26 -0
  117. package/generators/app/templates/app2021/src/main.ts +12 -0
  118. package/generators/app/templates/app2021/src/polyfills.ts +67 -0
  119. package/generators/app/templates/app2021/src/test.ts +20 -0
  120. package/generators/app/templates/app2021/src/theme/variables.scss +232 -0
  121. package/generators/app/templates/app2021/src/zone-flags.ts +5 -0
  122. package/generators/app/templates/app2021/tests/protractor.conf.js +36 -0
  123. package/generators/app/templates/app2021/tests/src/app.e2e-spec.ts +14 -0
  124. package/generators/app/templates/app2021/tests/src/app.po.ts +11 -0
  125. package/generators/app/templates/app2021/tests/tsconfig.json +13 -0
  126. package/generators/app/templates/app2021/tsconfig.app.json +18 -0
  127. package/generators/app/templates/app2021/tsconfig.json +23 -0
  128. package/generators/app/templates/app2021/tsconfig.spec.json +18 -0
  129. package/generators/app/templates/app2021/tslint.json +149 -0
  130. package/generators/app/templates/app2021/web.js +21 -0
  131. package/package.json +41 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 fidj.ovh
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
13
+ all 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
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # @ofidj/generator-fidj
2
+
3
+ [![NPM version][npm-image]][npm-url]
4
+ [![Build Status][travis-image]][travis-url]
5
+
6
+ > build great mobile and web angular/ionic apps based on fidj.ovh authentication.
7
+ >
8
+ > _Renamed from `generator-fidj` at 1.0.0. The old `generator-fidj@3.x` is deprecated. The yeoman command becomes `yo @ofidj/fidj` (note the `@ofidj/` prefix)._
9
+
10
+ ## Prerequisites
11
+
12
+ Look at mat's gist : https://gist.github.com/mlefree/2156f66dfb441f107bef157dde56a836
13
+
14
+ ## Installation
15
+
16
+ First, install [Yeoman](http://yeoman.io) and generator-fidj using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)) :
17
+ ```bash
18
+ npm install -g yo
19
+ npm install -g @ionic/cli
20
+ npm install -g @angular/cli
21
+ npm install -g @ofidj/generator-fidj
22
+ ```
23
+ Then generate your new project:
24
+ ```bash
25
+ yo @ofidj/fidj
26
+ ```
27
+ or as an expert :
28
+ ```bash
29
+ yo @ofidj/fidj my-app app2021 your-app-id "" me-as-user "my description" \
30
+ "Welcome there" \
31
+ "Hey<br>Heres my content: <img src=blank /><br> \o/ "
32
+ ```
33
+
34
+ ## Development
35
+
36
+ Make sure you've got yeoman installed :
37
+ ```bash
38
+ npm install -g yo
39
+ npm install -g @ionic/cli
40
+ npm install -g @angular/cli
41
+ ```
42
+
43
+ Clone the repo, install it :
44
+ ```bash
45
+ cd generator-fidj
46
+ npm install
47
+ npm link
48
+ ```
49
+
50
+ And then use your local Fidj generator :
51
+ ```bash
52
+ mkdir your-app && cd your-app && \
53
+ yo @ofidj/fidj my-app app2021 your-app-id "" me-as-user "my description" \
54
+ "Welcome there" \
55
+ "Hey<br>Heres my content: <img src=blank /><br> \o/ "
56
+
57
+ # look at the code : code .
58
+ # or start it : npm start
59
+ ```
60
+
61
+ ## License
62
+
63
+ MIT 2021 © [fidj.ovh](fidj.ovh)
64
+
65
+ [npm-image]: https://badge.fury.io/js/@ofidj%2Fgenerator-fidj.svg
66
+ [npm-url]: https://npmjs.org/package/@ofidj/generator-fidj
67
+ [travis-image]: https://travis-ci.org/ofidj/generator-fidj.svg?branch=master
68
+ [travis-url]: https://travis-ci.org/ofidj/generator-fidj
69
+ [daviddm-image]: https://david-dm.org/ofidj/generator-fidj.svg?theme=shields.io
70
+ [daviddm-url]: https://david-dm.org/ofidj/generator-fidj
71
+ [coveralls-image]: https://coveralls.io/repos/ofidj/generator-fidj/badge.svg
72
+ [coveralls-url]: https://coveralls.io/r/ofidj/generator-fidj
73
+ [codecov-image]: https://codecov.io/gh/ofidj/generator-fidj/branch/master/graph/badge.svg
74
+ [codecov-url]: https://codecov.io/gh/ofidj/generator-fidj
@@ -0,0 +1,200 @@
1
+ const Generator = require('yeoman-generator');
2
+ const yosay = require('yosay');
3
+ const chalk = require('chalk');
4
+
5
+ module.exports = class extends Generator {
6
+ constructor(args, opts) {
7
+ super(args, opts);
8
+
9
+ this.hasBeenRecordedInFidjOvh = true;
10
+ this.templateName = 'app2021'; //'app2021'; //'app2018' ''ionic2020'
11
+
12
+ this.option('skip-welcome-message', {
13
+ desc: 'Skips the welcome message',
14
+ type: Boolean
15
+ });
16
+
17
+ this.argument('appname', {type: String, required: false, desc: 'Your app name'});
18
+ this.argument('appType', {type: String, required: false, desc: 'For ex: "app2021" '});
19
+ this.argument('appId', {type: String, required: false});
20
+ this.argument('appOptions', {type: String, required: false});
21
+ this.argument('appUserName', {type: String, required: false});
22
+ this.argument('appDescription', {type: String, required: false});
23
+ this.argument('appWelcome', {type: String, required: false});
24
+ this.argument('appContent', {type: String, required: false});
25
+ }
26
+
27
+ async initializing() {
28
+ this.pkg = require('../../package.json');
29
+ }
30
+
31
+ async prompting() {
32
+ if (!this.options['skip-welcome-message'] && !this.options.appId) {
33
+ this.log(yosay('\'Allo \'Welcome to ' + chalk.red('fidj.ovh') + ' generator'));
34
+
35
+ const promptConditions = [{
36
+ type: 'confirm',
37
+ name: 'hasBeenRecordedInFidjOvh',
38
+ message: 'Did you recorded your app in fidj.ovh and received your appId ?',
39
+ default: false
40
+ }];
41
+
42
+ const conditions = await this.prompt(promptConditions);
43
+ this.hasBeenRecordedInFidjOvh = !!conditions.hasBeenRecordedInFidjOvh;
44
+ if (!this.hasBeenRecordedInFidjOvh) {
45
+ const err = 'You need to submit your app on https://fidj.ovh first. ' +
46
+ 'It will help you to build a valid app name and give you a appId.';
47
+ this.log(yosay('Sorry : ' + chalk.red(err) + ' See you in 2 minutes ?'));
48
+ }
49
+ }
50
+
51
+ if (!this.options.appname || !this.options.appUserName || !this.options.appDescription) {
52
+ const prompts = [
53
+ {
54
+ type: 'input',
55
+ name: 'appUserName',
56
+ message: 'Your (github) user name'
57
+ },
58
+ {
59
+ type: 'input',
60
+ name: 'appName',
61
+ message: 'Your app name (as shown on device)',
62
+ default: this.appname.replace(/[^\w\s]/gi, '').replace(/\s/g, '_').replace(/\s+/g, '').replace(/[\. ,:-]+/g, '').toLowerCase()
63
+ },
64
+ {
65
+ type: 'input',
66
+ name: 'appDescription',
67
+ message: 'App description',
68
+ default: this.appname
69
+ }
70
+ ];
71
+
72
+ this.props = await this.prompt(prompts);
73
+ } else {
74
+ this.props = {
75
+ appName: this.options.appname,
76
+ appUserName: this.options.appUserName,
77
+ appDescription: this.options.appDescription,
78
+ appWelcome: this.options.appWelcome || '<h1>Welcome</h1>',
79
+ appContent: this.options.appContent || '<h1>Hello</h1>'
80
+ };
81
+ }
82
+
83
+ const pack = this.props.appUserName.replace(/[^\w\s]/gi, '').replace(/\s+/g, '').replace(/[\. ,:-]+/g, '').toLowerCase();
84
+ const age = this.props.appName.replace(/[^\w\s]/gi, '').replace(/\s/g, '_').replace(/\s+/g, '').replace(/[\. ,:-]+/g, '').toLowerCase();
85
+ const packageDefault = 'ovh.' + (pack ? pack : 'fidj') + '.' + age;
86
+
87
+ if (!this.options.appId) {
88
+ const prompts02 = [{
89
+ type: 'input',
90
+ name: 'appId',
91
+ message: 'Your app Id'
92
+ },
93
+ {
94
+ type: 'input',
95
+ name: 'appPackage',
96
+ message: 'Your app package name',
97
+ default: packageDefault
98
+ },
99
+ {
100
+ type: 'input',
101
+ name: 'appHomepage',
102
+ message: 'Home page url',
103
+ default: 'https://fidj.ovh/_/' + age
104
+ }
105
+ ];
106
+
107
+ this.props02 = await this.prompt(prompts02);
108
+ } else {
109
+ this.props02 = {
110
+ appId: this.options.appId,
111
+ appPackage: packageDefault,
112
+ appHomepage: 'https://fidj.ovh/_/' + age
113
+ };
114
+ }
115
+ }
116
+
117
+ async writing() {
118
+ if (!this.hasBeenRecordedInFidjOvh) {
119
+ return;
120
+ }
121
+
122
+ let copyAll = true;
123
+ if (this.options.appType === 'app2018') {
124
+ this.templateName = 'app2018';
125
+ } else {
126
+ this.templateName = 'app2021';
127
+ }
128
+
129
+ const now = new Date();
130
+ const version = '' + ('' + now.getFullYear()).substr(2) + '.' + (now.getMonth() + 1) + '.' + now.getDate();
131
+
132
+ const appArguments = {
133
+ appName: this.props.appName,
134
+ appNameStrict: this.props.appName.replace(/[^\w\s]/gi, '').replace(/\s+/g, '').replace(/[\. ,:-]+/g, '').toLowerCase(),
135
+ appDescription: this.props.appDescription,
136
+ appWelcome: this.props.appWelcome,
137
+ appContent: this.props.appContent,
138
+ appUserName: this.props.appUserName,
139
+ appHomepage: this.props02.appHomepage,
140
+ appPackage: this.props02.appPackage,
141
+ appId: this.props02.appId,
142
+ appOptions: this.options.appOptions ? ', {' + this.options.appOptions + '}' : '',
143
+ appVersion: version,
144
+ appKeywords: 'fidj',
145
+ appYear: now.getFullYear(),
146
+ appColor: 'white'
147
+ };
148
+
149
+ this.fs.copyTpl(
150
+ this.templatePath(this.templateName + '/*'),
151
+ this.destinationPath(),
152
+ appArguments
153
+ );
154
+
155
+ this.fs.copyTpl(
156
+ this.templatePath(this.templateName + '/.*'),
157
+ this.destinationPath(),
158
+ appArguments
159
+ );
160
+
161
+ this.fs.copyTpl(
162
+ this.templatePath(this.templateName + '/src'),
163
+ this.destinationPath('src'),
164
+ appArguments
165
+ );
166
+
167
+ if (copyAll) {
168
+ this.fs.copy(
169
+ this.templatePath(this.templateName + '/platforms'),
170
+ this.destinationPath('platforms')
171
+ );
172
+
173
+ this.fs.copy(
174
+ this.templatePath(this.templateName + '/resources'),
175
+ this.destinationPath('resources')
176
+ );
177
+
178
+ this.fs.copy(
179
+ this.templatePath(this.templateName + '/tests'),
180
+ this.destinationPath('tests')
181
+ );
182
+
183
+ //this.fs.copy(
184
+ // this.templatePath(this.templateName + '/www'),
185
+ // this.destinationPath('www')
186
+ //);
187
+ }
188
+ }
189
+
190
+ async install() {
191
+ if (!this.hasBeenRecordedInFidjOvh) {
192
+ return;
193
+ }
194
+ this.npmInstall();
195
+ }
196
+
197
+ async end() {
198
+
199
+ }
200
+ };
@@ -0,0 +1,35 @@
1
+ language:
2
+ - node_js
3
+ node_js:
4
+ - 6.11.5
5
+ branches:
6
+ only:
7
+ - master
8
+ install:
9
+ - git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
10
+ - git fetch --tags --depth=10000
11
+ - npm install
12
+ - npm version patch -m "[ci skip] version bumped %s"
13
+ script:
14
+ - npm test
15
+ - npm run build
16
+ after_success:
17
+ - git remote add upstream "https://${GH_TOKEN}@github.com/${GH_REPO}.git"
18
+ - git add .
19
+ - git commit -m "[ci skip] version ok"
20
+ - git push upstream HEAD:master
21
+ - rm -r src
22
+ - rm -r tests
23
+ - rm -r coverage
24
+ - rm -r node_modules
25
+ - rm www/.gitignore
26
+ deploy:
27
+ provider: pages
28
+ skip-cleanup: true
29
+ github-token: $GH_TOKEN
30
+ keep-history: true
31
+ on:
32
+ branch: master
33
+ env:
34
+ global:
35
+ - GH_REPO: "<%= appUserName %>/<%= appName %>"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 fidj.ovh team
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.
@@ -0,0 +1 @@
1
+ web: node web.js
@@ -0,0 +1,49 @@
1
+ # <%= appName %>
2
+
3
+ > <%= appDescription %>
4
+
5
+ ## Prerequisite
6
+
7
+ Look at [mat's gist](https://gist.github.com/mlefree/2156f66dfb441f107bef157dde56a836),
8
+ in order to check your node, cordova, ionic and yeoman installation.
9
+
10
+ [![Fidj.ovh Status][fidj-image]][fidj-url]
11
+ [![Build Status][travis-image]][travis-url]
12
+
13
+ [![video][youtube-img]][youtube-video]
14
+
15
+ ## Build it
16
+
17
+ Clone and install the project
18
+
19
+ ```bash
20
+ npm install
21
+ ```
22
+
23
+ and then launch on your device
24
+
25
+ ```bash
26
+ npm run ios
27
+ # then ready to launch your app (./platforms/ios/*.xcodeproj) in XCode
28
+ ```
29
+
30
+ ## Deploy
31
+
32
+ Follow this https://ionicframework.com/docs/intro/deploying.
33
+
34
+ ### For test on Github or Heroku
35
+
36
+ It's up to you if you want to use your www generated folder as static page.You can also use the [fidj-sandbox](https://sss) before any production; 2 variables are available for that :
37
+
38
+ ```bash
39
+ FIDJ_APP_ID # force your fidj app Id with your sandbox's one
40
+ FIDJ_APP_PROD # 'true' by default, 'false' to test it on sandbox
41
+ ```
42
+
43
+ [fidj-image]: https://fidj.ovh/_/<%= appName %>/badges/github.svg
44
+ [fidj-url]: https://fidj.ovh/_/<%= appName %>
45
+ [youtube-img]: http://img.youtube.com/vi/0FbnCWWg_NY/0.jpg
46
+ [youtube-video]: https://www.youtube.com/embed/0FbnCWWg_NY?autoplay=true
47
+ [travis-image]: https://travis-ci.org/<%=appUserName %>/<%= appName %>.svg?branch=master
48
+ [travis-url]: https://travis-ci.org/<%=appUserName %>/<%= appName %>
49
+
@@ -0,0 +1,91 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <widget id="<%= appPackage %>" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
+ <name><%= appName %></name>
4
+ <description><%= appDescription %></description>
5
+ <author email="fidj.ovh team" href="https://fidj.ovh/_/<%= appName %>">fidj.ovh team</author>
6
+ <content src="index.html" />
7
+ <access origin="*" />
8
+ <allow-intent href="http://*/*" />
9
+ <allow-intent href="https://*/*" />
10
+ <allow-intent href="tel:*" />
11
+ <allow-intent href="sms:*" />
12
+ <allow-intent href="mailto:*" />
13
+ <allow-intent href="geo:*" />
14
+ <preference name="ScrollEnabled" value="false" />
15
+ <preference name="android-minSdkVersion" value="16" />
16
+ <preference name="BackupWebStorage" value="none" />
17
+ <preference name="SplashMaintainAspectRatio" value="true" />
18
+ <preference name="FadeSplashScreenDuration" value="300" />
19
+ <preference name="SplashShowOnlyFirstTime" value="false" />
20
+ <preference name="SplashScreen" value="screen" />
21
+ <preference name="SplashScreenDelay" value="3000" />
22
+ <platform name="android">
23
+ <preference name="android-minSdkVersion" value="16" />
24
+ <preference name="android-targetSdkVersion" value="26" />
25
+
26
+ <allow-intent href="market:*" />
27
+ <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
28
+ <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
29
+ <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
30
+ <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
31
+ <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
32
+ <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
33
+ <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
34
+ <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
35
+ <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
36
+ <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
37
+ <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
38
+ <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
39
+ <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
40
+ <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
41
+ <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
42
+ <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
43
+ <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
44
+ <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
45
+ </platform>
46
+ <platform name="ios">
47
+ <allow-intent href="itms:*" />
48
+ <allow-intent href="itms-apps:*" />
49
+ <icon height="57" src="resources/ios/icon/icon.png" width="57" />
50
+ <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
51
+ <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
52
+ <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
53
+ <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
54
+ <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
55
+ <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
56
+ <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
57
+ <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
58
+ <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
59
+ <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
60
+ <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
61
+ <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
62
+ <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
63
+ <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
64
+ <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
65
+ <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
66
+ <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
67
+ <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
68
+ <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
69
+ <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
70
+ <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
71
+ <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
72
+ <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
73
+ <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
74
+ <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
75
+ <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
76
+ <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
77
+ <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
78
+ <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
79
+ <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
80
+ <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
81
+ </platform>
82
+ <plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
83
+ <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
84
+ <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
85
+ <plugin name="cordova-plugin-device" spec="2.0.2" />
86
+ <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
87
+ <plugin name="cordova-plugin-ionic-webview" spec="^2.0.0" />
88
+ <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
89
+ <engine name="android" spec="7.1.0" />
90
+ <engine name="ios" spec="4.5.4" />
91
+ </widget>
@@ -0,0 +1,63 @@
1
+ const gulp = require('gulp');
2
+ const replace = require('gulp-replace');
3
+ const cheerio = require('gulp-cheerio');
4
+
5
+ const paths = {
6
+ config: ['./package.json']
7
+ };
8
+
9
+ function configTask() {
10
+ return gulp.src(['config.xml'])
11
+ .pipe(cheerio({
12
+ run: function ($) {
13
+ // get the version number from package.json
14
+ $('widget').attr('version', require('./package').version);
15
+ $('widget').attr('id', require('./package').id);
16
+ $('name').text(require('./package').name);
17
+ $('description').text(require('./package').description);
18
+ $('author').text(require('./package').author);
19
+ $('author').attr('email', require('./package').author);
20
+ $('author').attr('href', require('./package').homepage);
21
+
22
+ // in development launch the app with a different html file
23
+ //$('content').attr('src', process.env.NODE_ENV == 'development' ? 'debug.html' : 'index.html');
24
+
25
+ },
26
+ parserOptions: {
27
+ xmlMode: true
28
+ }
29
+ }))
30
+ .pipe(gulp.dest('.'));
31
+ }
32
+
33
+ function configSrcTask() {
34
+ const version = "const version = '" + require('./package').version + "';";
35
+ return gulp.src(['src/app/shared/version.const.ts'])
36
+ // See http://mdn.io/string.replace#Specifying_a_string_as_a_parameter
37
+ .pipe(replace(/const version = '(.*)';/g, version))
38
+ .pipe(gulp.dest('src/app/shared/'));
39
+ }
40
+
41
+ const fidjId = process.env.FIDJ_ID;
42
+ const fidjProd = process.env.FIDJ_PROD || 'true';
43
+ gulp.task('config:www', function () {
44
+
45
+ if (fidjId && fidjProd) {
46
+ return gulp.src(['www/build/main.js'])
47
+ .pipe(replace(/fidjService.init.*/g, "fidjService.init('" + fidjId + "', { prod: " + fidjProd + " })"))
48
+ .pipe(gulp.dest('www/build/'));
49
+ } else {
50
+ return Promise.resolve();
51
+ }
52
+
53
+ });
54
+
55
+ gulp.task('config', configTask);
56
+
57
+ gulp.task('config-src', configSrcTask);
58
+
59
+ gulp.task('default', gulp.series(configTask, configSrcTask));
60
+
61
+ gulp.task('watch', function () {
62
+ gulp.watch(paths.config, ['config', 'config-src']);
63
+ });
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "type": "fidj",
4
+ "integrations": {
5
+ "cordova": {},
6
+ "gulp": {}
7
+ },
8
+ "app_id": ""
9
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "version": "<%= appVersion %>",
4
+ "id": "<%= appPackage %>",
5
+ "description": "<%= appDescription %>",
6
+ "author": "<%= appUserName %>",
7
+ "homepage": "https://fidj.ovh/_/<%= appName %>",
8
+ "main": "www/index.html",
9
+ "scripts": {
10
+ "test": "./node_modules/.bin/karma start tests/karma.unit-tests.conf.js",
11
+ "clean": "ionic-app-scripts clean",
12
+ "build:app": "ionic-app-scripts build",
13
+ "build:config": "./node_modules/.bin/gulp",
14
+ "build:ids": "./node_modules/.bin/gulp config:www",
15
+ "build": "npm run build:config && npm run build:app && npm run build:ids",
16
+ "lint": "ionic-app-scripts lint",
17
+ "serve": "ionic-app-scripts serve",
18
+ "resources": "fidj-resources --ios --android --marketing && cp resources/ios/icon/icon-60.png src/assets/icon/favicon.ico",
19
+ "ios": "npm run build && npm run resources && ionic cordova platform add ios && ionic cordova build ios"
20
+ },
21
+ "devDependencies": {
22
+ "@ionic/app-scripts": "3.1.6",
23
+ "gulp": "^4.0.0",
24
+ "gulp-cheerio": "^0.6.3",
25
+ "gulp-replace": "^0.6.1",
26
+ "gulp-util": "^3.0.8",
27
+ "jasmine-ajax": "^3.3.1",
28
+ "jasmine-core": "^2.99.1",
29
+ "karma": "^3.0.0",
30
+ "karma-chrome-launcher": "^2.2.0",
31
+ "karma-coverage": "^1.1.0",
32
+ "karma-html-reporter": "*",
33
+ "karma-jasmine": "^1.1.1",
34
+ "karma-jasmine-ajax": "^0.1.13",
35
+ "karma-jasmine-html-reporter-livereload": "*",
36
+ "shelljs": "^0.8.1",
37
+ "typescript": "2.4.2"
38
+ },
39
+ "dependencies": {
40
+ "@angular/animations": "5.0.3",
41
+ "@angular/common": "5.0.3",
42
+ "@angular/compiler": "5.0.3",
43
+ "@angular/compiler-cli": "5.0.3",
44
+ "@angular/core": "5.0.3",
45
+ "@angular/forms": "5.0.3",
46
+ "@angular/http": "5.0.3",
47
+ "@angular/platform-browser": "5.0.3",
48
+ "@angular/platform-browser-dynamic": "5.0.3",
49
+ "@ionic-native/core": "4.4.0",
50
+ "@ionic-native/network": "^4.7.0",
51
+ "@ionic-native/splash-screen": "4.4.0",
52
+ "@ionic-native/status-bar": "4.4.0",
53
+ "@ionic/storage": "2.1.3",
54
+ "cordova-android": "^7.0.0",
55
+ "cordova-ios": "4.5.5",
56
+ "cordova-plugin-device": "^1.1.7",
57
+ "cordova-plugin-ionic-keyboard": "^2.1.2",
58
+ "cordova-plugin-ionic-webview": "^1.2.1",
59
+ "cordova-plugin-network-information": "^2.0.1",
60
+ "cordova-plugin-splashscreen": "^4.1.0",
61
+ "cordova-plugin-sqlite-2": "^1.0.5",
62
+ "cordova-plugin-statusbar": "^2.4.2",
63
+ "cordova-plugin-whitelist": "^1.3.3",
64
+ "fidj": "^2.1.7",
65
+ "ionic-angular": "3.9.2",
66
+ "ionic-plugin-keyboard": "^2.2.1",
67
+ "ionicons": "3.0.0",
68
+ "rxjs": "5.5.2",
69
+ "save-dev": "^2.0.0",
70
+ "sw-toolbox": "3.6.0",
71
+ "zone.js": "0.8.18"
72
+ },
73
+ "cordova": {
74
+ "platforms": [
75
+ "android",
76
+ "ios"
77
+ ],
78
+ "plugins": {
79
+ "ionic-plugin-keyboard": {},
80
+ "cordova-plugin-whitelist": {},
81
+ "cordova-plugin-device": {},
82
+ "cordova-plugin-splashscreen": {},
83
+ "cordova-plugin-ionic-webview": {},
84
+ "cordova-plugin-sqlite-2": {},
85
+ "cordova-plugin-statusbar": {},
86
+ "cordova-plugin-network-information": {},
87
+ "cordova-plugin-ionic-keyboard": {}
88
+ }
89
+ }
90
+ }
@@ -0,0 +1 @@
1
+ devices projects