Skip to content

Commit

Permalink
feat: shop web angular modify structure #1427
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-rocket committed Dec 8, 2021
1 parent 43a8f37 commit e60a89c
Show file tree
Hide file tree
Showing 14 changed files with 523 additions and 480 deletions.
16 changes: 16 additions & 0 deletions packages/shop-web-angular/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
16 changes: 16 additions & 0 deletions packages/shop-web-angular/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
5 changes: 4 additions & 1 deletion packages/shop-web-angular/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ webpack-cache
.env
.env.prod
/src/environments/environment.ts
/src/environments/environment.prod.ts
/src/environments/environment.prod.ts

# angular files
.angular
8 changes: 4 additions & 4 deletions packages/shop-web-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"preserveSymlinks": true,
"outputPath": "build",
"index": "src/index.html",
"main": "src/main.browser.ts",
"tsConfig": "tsconfig.webpack.json",
"polyfills": "src/polyfills.browser.ts",
"main": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
Expand Down Expand Up @@ -148,4 +148,4 @@
"prefix": "ea"
}
}
}
}
10 changes: 5 additions & 5 deletions packages/shop-web-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"@angular/platform-server": "^12.2.10",
"@angular/router": "^12.2.10",
"@angular/service-worker": "^12.2.10",
"@apollo/client": "^3.5.5",
"@ever-platform/common": "^0.4.3",
"@ever-platform/common-angular": "^0.4.3",
"@fortawesome/angular-fontawesome": "^0.9.0",
Expand All @@ -117,19 +118,20 @@
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/googlemaps": "^3.30.16",
"apollo-angular": "^2.6.0",
"@apollo/client": "^3.5.5",
"bootstrap": "^4.6.0",
"browser-detect": "^0.2.28",
"bson-objectid": "^2.0.1",
"classlist.js": "^1.1.20150312",
"core-js": "^3.18.3",
"css-element-queries": "^1.2.3",
"eventemitter3": "^4.0.7",
"follow-redirects": "^1.14.4",
"fstream": "^1.0.12",
"graphql": "15.7.2",
"graphql-tag": "^2.12.6",
"handlebars": "^4.7.7",
"http-proxy": "^1.18.1",
"http-server": "^13.0.2",
"ie-shim": "^0.1.0",
"lodash": "^4.17.21",
Expand All @@ -145,9 +147,6 @@
"ngx-infinite-scroll": "^10.0.1",
"ngx-toastr": "^14.1.3",
"pm2": "^5.1.2",
"http-proxy": "^1.18.1",
"follow-redirects": "^1.14.4",
"eventemitter3": "^4.0.7",
"raw-loader": "4.0.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.4.0",
Expand All @@ -170,6 +169,7 @@
"@angular/cli": "^12.2.10",
"@angular/compiler-cli": "^12.2.10",
"@ngtools/webpack": "^12.2.10",
"@types/googlemaps": "^3.43.3",
"@types/jasmine": "~3.9.1",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^16.11.0",
Expand Down
Empty file.
40 changes: 9 additions & 31 deletions packages/shop-web-angular/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,11 @@
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<meta
name="description"
content="<%= htmlWebpackPlugin.options.metadata.description %>"
/>
<!-- base url -->
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>" />

<% if (webpackConfig.htmlElements.headTags) { %>
<!-- Configured Head Tags -->
<%= webpackConfig.htmlElements.headTags %> <% } %> <%=
htmlWebpackPlugin.files.webpackManifest %> <% if
(htmlWebpackPlugin.options.metadata.isDevServer &&
htmlWebpackPlugin.options.metadata.HMR !== true) { %>
<!-- Webpack Dev Server reload -->
<script src="/webpack-dev-server.js"></script>
<% } %>
<title>Ever</title>
<meta name="description" content="Ever Web Shop" />
<base href="/">

<!-- Async Google Tag Manager: change gtmKey value inside config.prod.conf to your to be your site's ID-->
<% if (htmlWebpackPlugin.options.gtmKey) { %>
<!-- Google Tag Manager -->
<script>
(function (w, d, s, l, i) {
Expand All @@ -45,14 +28,13 @@
document,
'script',
'dataLayer',
'<%= htmlWebpackPlugin.options.gtmKey %>'
'GTM-XXXXXXX'
);
</script>
<!-- End Google Tag Manager -->
<% } %>
<!-- End Google Analytics -->

<!-- CSS will be injected by webpack here -->
<!-- CSS will be injected here -->
<!-- Preload link tags will be injected by webpack here -->

<style type="text/css">
Expand All @@ -79,9 +61,7 @@
width: 200px;
height: 200px;
position: absolute;

background: url(./assets/img/ever-logo.svg) center center
no-repeat;
background: url(./assets/img/ever-logo.svg) center center no-repeat;
}

@keyframes example {
Expand All @@ -99,7 +79,6 @@
</head>

<body>
<% if (htmlWebpackPlugin.options.gtmKey) { %>
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
Expand All @@ -110,15 +89,14 @@
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->
<% } %>

<app>
<!-- loading layout replaced by app after startupp -->
<!-- loading layout replaced by app after startup -->
<div class="app-loading">
<div class="logo-loading"></div>
<!-- <svg class="spinner" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
</svg> -->
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
</svg> -->
</div>
</app>

Expand Down
13 changes: 13 additions & 0 deletions packages/shop-web-angular/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
62 changes: 62 additions & 0 deletions packages/shop-web-angular/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
*/

/***************************************************************************************************
* BROWSER POLYFILLS
*/

// Internet Explorer 9 support
// import 'ie-shim';

// IE9, IE10 and IE11 requires all of the following polyfills.
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

// Evergreen browsers require these.
// import 'core-js/es6/reflect';
// import 'core-js/es7/reflect';
import 'core-js/proposals/reflect-metadata';
/**
* Required to support Web Animations `@angular/animation`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
*/

// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js';
// import 'zone.js/dist/long-stack-trace-zone' // async stack traces with zone.js included for dev

/***************************************************************************************************
* APPLICATION IMPORTS
*/
1 change: 1 addition & 0 deletions packages/shop-web-angular/src/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* You can add global styles to this file, and also import other style files */
26 changes: 26 additions & 0 deletions packages/shop-web-angular/src/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
<T>(id: string): T;
keys(): string[];
};
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
15 changes: 15 additions & 0 deletions packages/shop-web-angular/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["googlemaps"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
19 changes: 19 additions & 0 deletions packages/shop-web-angular/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"googlemaps"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
Loading

0 comments on commit e60a89c

Please sign in to comment.