Skip to content

Commit 10f9ebd

Browse files
author
fernandocode
committed
ionic 4 upgrade
1 parent 19e6a2a commit 10f9ebd

File tree

96 files changed

+3493
-3032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3493
-3032
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
# Specifies intentionally untracked files to ignore when using Git
2-
# http://git-scm.com/docs/gitignore
3-
4-
*~
5-
*.sw[mnpcod]
6-
*.log
7-
*.tmp
8-
*.tmp.*
9-
log.txt
10-
*.sublime-project
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events.json
15+
speed-measure-plugin.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
1124
*.sublime-workspace
12-
.vscode/
13-
npm-debug.log*
14-
15-
.idea/
16-
.sass-cache/
17-
.tmp/
18-
.versions/
19-
20-
.ng_pkg_build/
21-
.sonarlint/
22-
.vscode/
23-
24-
node_modules/
2525

26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
2645
.DS_Store
2746
Thumbs.db
28-
UserInterfaceState.xcuserstate
29-
30-
*.js
31-
*.js.map
32-
*.umd.js.map
33-
*.d.ts
34-
35-
dist.tgz
36-
dist/
37-
38-
!protractor.conf.js
39-
!karma.conf.js

.npmignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
"type": "node",
9+
"request": "launch",
10+
"name": "Mocha Tests",
11+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12+
"args": [
13+
"-u",
14+
"tdd",
15+
"--timeout",
16+
"999999",
17+
"--colors",
18+
"${workspaceFolder}/test"
19+
],
20+
"internalConsoleOptions": "openOnSessionStart"
21+
},
22+
{
23+
"type": "node",
24+
"request": "launch",
25+
"name": "Launch Program",
26+
"program": "${workspaceFolder}\\serve",
27+
"preLaunchTask": "tsc: build - tsconfig.json",
28+
"outFiles": [
29+
"${workspaceFolder}/dist/out-tsc/**/*.js"
30+
]
31+
}
32+
]
33+
}

angular.json

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"ionic-database-builder": {
6+
"ionic-database-builder-library": {
77
"root": "",
88
"sourceRoot": "src",
99
"projectType": "application",
1010
"prefix": "app",
11-
"schematics": {},
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "sass"
14+
}
15+
},
1216
"architect": {
1317
"build": {
1418
"builder": "@angular-devkit/build-angular:browser",
1519
"options": {
16-
"outputPath": "dist/ionic-database-builder",
20+
"outputPath": "dist/ionic-database-builder-library",
1721
"index": "src/index.html",
1822
"main": "src/main.ts",
1923
"polyfills": "src/polyfills.ts",
@@ -23,9 +27,10 @@
2327
"src/assets"
2428
],
2529
"styles": [
26-
"src/styles.css"
30+
"src/styles.scss"
2731
],
28-
"scripts": []
32+
"scripts": [],
33+
"es5BrowserSupport": true
2934
},
3035
"configurations": {
3136
"production": {
@@ -43,25 +48,32 @@
4348
"aot": true,
4449
"extractLicenses": true,
4550
"vendorChunk": false,
46-
"buildOptimizer": true
51+
"buildOptimizer": true,
52+
"budgets": [
53+
{
54+
"type": "initial",
55+
"maximumWarning": "2mb",
56+
"maximumError": "5mb"
57+
}
58+
]
4759
}
4860
}
4961
},
5062
"serve": {
5163
"builder": "@angular-devkit/build-angular:dev-server",
5264
"options": {
53-
"browserTarget": "ionic-database-builder:build"
65+
"browserTarget": "ionic-database-builder-library:build"
5466
},
5567
"configurations": {
5668
"production": {
57-
"browserTarget": "ionic-database-builder:build:production"
69+
"browserTarget": "ionic-database-builder-library:build:production"
5870
}
5971
}
6072
},
6173
"extract-i18n": {
6274
"builder": "@angular-devkit/build-angular:extract-i18n",
6375
"options": {
64-
"browserTarget": "ionic-database-builder:build"
76+
"browserTarget": "ionic-database-builder-library:build"
6577
}
6678
},
6779
"test": {
@@ -71,7 +83,9 @@
7183
"polyfills": "src/polyfills.ts",
7284
"tsConfig": "src/tsconfig.spec.json",
7385
"karmaConfig": "src/karma.conf.js",
74-
"styles": [],
86+
"styles": [
87+
"src/styles.scss"
88+
],
7589
"scripts": [],
7690
"assets": [
7791
"src/favicon.ico",
@@ -93,19 +107,20 @@
93107
}
94108
}
95109
},
96-
"ionic-database-builder-e2e": {
110+
"ionic-database-builder-library-e2e": {
97111
"root": "e2e/",
98112
"projectType": "application",
113+
"prefix": "",
99114
"architect": {
100115
"e2e": {
101116
"builder": "@angular-devkit/build-angular:protractor",
102117
"options": {
103118
"protractorConfig": "e2e/protractor.conf.js",
104-
"devServerTarget": "ionic-database-builder:serve"
119+
"devServerTarget": "ionic-database-builder-library:serve"
105120
},
106121
"configurations": {
107122
"production": {
108-
"devServerTarget": "ionic-database-builder:serve:production"
123+
"devServerTarget": "ionic-database-builder-library:serve:production"
109124
}
110125
}
111126
},
@@ -119,7 +134,46 @@
119134
}
120135
}
121136
}
137+
},
138+
"ionic-database-builder": {
139+
"root": "projects/ionic-database-builder",
140+
"sourceRoot": "projects/ionic-database-builder/src",
141+
"projectType": "library",
142+
"prefix": "lib",
143+
"architect": {
144+
"build": {
145+
"builder": "@angular-devkit/build-ng-packagr:build",
146+
"options": {
147+
"tsConfig": "projects/ionic-database-builder/tsconfig.lib.json",
148+
"project": "projects/ionic-database-builder/ng-package.json"
149+
},
150+
"configurations": {
151+
"production": {
152+
}
153+
}
154+
},
155+
"test": {
156+
"builder": "@angular-devkit/build-angular:karma",
157+
"options": {
158+
"main": "projects/ionic-database-builder/src/test.ts",
159+
"tsConfig": "projects/ionic-database-builder/tsconfig.spec.json",
160+
"karmaConfig": "projects/ionic-database-builder/karma.conf.js"
161+
}
162+
},
163+
"lint": {
164+
"builder": "@angular-devkit/build-angular:tslint",
165+
"options": {
166+
"tsConfig": [
167+
"projects/ionic-database-builder/tsconfig.lib.json",
168+
"projects/ionic-database-builder/tsconfig.spec.json"
169+
],
170+
"exclude": [
171+
"**/node_modules/**"
172+
]
173+
}
174+
}
175+
}
122176
}
123177
},
124-
"defaultProject": "ionic-database-builder"
178+
"defaultProject": "ionic-database-builder-library"
125179
}

e2e/protractor.conf.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('Welcome to ionic-database-builder-library!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get(browser.baseUrl) as Promise<any>;
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root h1')).getText() as Promise<string>;
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

ng-package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)