Skip to content

Commit 26ac50a

Browse files
committed
Init
1 parent b120463 commit 26ac50a

File tree

87 files changed

+3264
-2
lines changed

Some content is hidden

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

87 files changed

+3264
-2
lines changed

.editorconfig

+13
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

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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/
24+
*.sublime-workspace
25+
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
45+
.DS_Store
46+
Thumbs.db
47+
48+
/package-lock.json

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Narik
3+
Copyright (c) 2019 NarikMe
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
# narik-material-demo-coreui-panel
1+
# narik-material-demo-coreui-admin-template
2+
3+
A demo for [**Narik**](http://narik.me "Narik Angular Framework") with [Angular Material](https://material.angular.io/ "Angular Material") and [CoreUI for Angular](https://coreui.io/)
4+
5+
## Running the demo
6+
7+
First of all copy repo to local machine .
8+
9+
```shell
10+
git clone https://github.com/NarikMe/narik-material-demo-coreui-admin-template
11+
```
12+
13+
After that install dependencies.
14+
15+
```shell
16+
npm install
17+
```
18+
19+
Finally run the demo
20+
21+
```shell
22+
ng serve
23+
```
24+
25+
Use **admin** as username and **123** as password.
26+
27+
## Documentation
28+
29+
You can find documentation in [Narik Wiki](https://github.com/NarikMe/narik-angular/wiki)
30+
and [Narik.me](http://narik.me)

angular.json

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"narik-material-demo-coreui-admin-template": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "sass"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-builders/custom-webpack:browser",
19+
"options": {
20+
"customWebpackConfig": {
21+
"path": "./extra-webpack.config.js",
22+
"mergeStrategies": {
23+
"module": "prepend",
24+
"module.rules": "prepend",
25+
"plugins": "prepend"
26+
}
27+
},
28+
"outputPath": "dist/narik-material-demo-coreui-admin-template",
29+
"index": "src/index.html",
30+
"main": "src/main.ts",
31+
"polyfills": "src/polyfills.ts",
32+
"tsConfig": "tsconfig.app.json",
33+
"assets": ["src/favicon.ico", "src/assets"],
34+
"styles": [
35+
"node_modules/bootstrap/dist/css/bootstrap.css",
36+
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
37+
"node_modules/@coreui/icons/css/coreui-icons.css",
38+
"node_modules/ngx-toastr/toastr.css",
39+
"src/styles/styles.scss",
40+
"node_modules/narik-ui-material/styles/narik-ui-material.css"
41+
],
42+
"stylePreprocessorOptions": {
43+
"includePaths": ["src/styles/"]
44+
},
45+
"scripts": [],
46+
"es5BrowserSupport": true
47+
},
48+
"configurations": {
49+
"production": {
50+
"fileReplacements": [
51+
{
52+
"replace": "src/environments/environment.ts",
53+
"with": "src/environments/environment.prod.ts"
54+
}
55+
],
56+
"optimization": true,
57+
"outputHashing": "all",
58+
"sourceMap": false,
59+
"extractCss": true,
60+
"namedChunks": false,
61+
"aot": true,
62+
"extractLicenses": true,
63+
"vendorChunk": false,
64+
"buildOptimizer": true,
65+
"budgets": [
66+
{
67+
"type": "initial",
68+
"maximumWarning": "2mb",
69+
"maximumError": "5mb"
70+
}
71+
]
72+
}
73+
}
74+
},
75+
"serve": {
76+
"builder": "@angular-builders/custom-webpack:dev-server",
77+
"options": {
78+
"browserTarget": "narik-material-demo-coreui-admin-template:build",
79+
"proxyConfig": "proxy.config.json"
80+
},
81+
"configurations": {
82+
"production": {
83+
"browserTarget": "narik-material-demo-coreui-admin-template:build:production"
84+
}
85+
}
86+
},
87+
"extract-i18n": {
88+
"builder": "@angular-devkit/build-angular:extract-i18n",
89+
"options": {
90+
"browserTarget": "narik-material-demo-coreui-admin-template:build"
91+
}
92+
},
93+
"test": {
94+
"builder": "@angular-devkit/build-angular:karma",
95+
"options": {
96+
"main": "src/test.ts",
97+
"polyfills": "src/polyfills.ts",
98+
"tsConfig": "tsconfig.spec.json",
99+
"karmaConfig": "src/karma.conf.js",
100+
"styles": ["src/styles.scss"],
101+
"scripts": [],
102+
"assets": ["src/favicon.ico", "src/assets"]
103+
}
104+
},
105+
"lint": {
106+
"builder": "@angular-devkit/build-angular:tslint",
107+
"options": {
108+
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json"],
109+
"exclude": ["**/node_modules/**"]
110+
}
111+
}
112+
}
113+
},
114+
"narik-material-demo-coreui-admin-template-e2e": {
115+
"root": "e2e/",
116+
"projectType": "application",
117+
"prefix": "",
118+
"architect": {
119+
"e2e": {
120+
"builder": "@angular-devkit/build-angular:protractor",
121+
"options": {
122+
"protractorConfig": "e2e/protractor.conf.js",
123+
"devServerTarget": "narik-material-demo-coreui-admin-template:serve"
124+
},
125+
"configurations": {
126+
"production": {
127+
"devServerTarget": "narik-material-demo-coreui-admin-template:serve:production"
128+
}
129+
}
130+
},
131+
"lint": {
132+
"builder": "@angular-devkit/build-angular:tslint",
133+
"options": {
134+
"tsConfig": "e2e/tsconfig.e2e.json",
135+
"exclude": ["**/node_modules/**"]
136+
}
137+
}
138+
}
139+
}
140+
},
141+
"defaultProject": "narik-material-demo-coreui-admin-template"
142+
}

build-tools/template-resolver.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class TemplateResolver {
2+
Resolve(key) {
3+
switch (key) {
4+
case "NarikListUi":
5+
return {
6+
template: "",
7+
templateUrl: "./src/app/templates/list-template.html"
8+
};
9+
case "NarikDetailUi":
10+
return {
11+
template: "",
12+
templateUrl: "./src/app/templates/detail-template.html"
13+
};
14+
15+
default:
16+
break;
17+
}
18+
}
19+
}
20+
module.exports = TemplateResolver;

e2e/protractor.conf.js

+28
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: ["./src/**/*.e2e-spec.ts"],
9+
capabilities: {
10+
browserName: "chrome"
11+
},
12+
directConnect: true,
13+
baseUrl: "http://localhost:4200/",
14+
framework: "jasmine",
15+
jasmineNodeOpts: {
16+
showColors: true,
17+
defaultTimeoutInterval: 30000,
18+
print: function() {}
19+
},
20+
onPrepare() {
21+
require("ts-node").register({
22+
project: require("path").join(__dirname, "./tsconfig.e2e.json")
23+
});
24+
jasmine
25+
.getEnv()
26+
.addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

+23
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 narik-material-starter!');
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

+11
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

+13
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+
}

extra-webpack.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var NarikCompilerPlugin = require("narik-webpack-tools/narik-compiler-plugin");
2+
var TemplateResolver = require("./build-tools/template-resolver");
3+
4+
module.exports = {
5+
module: {
6+
rules: [
7+
{
8+
test: /\.tsx?$/,
9+
use: [
10+
{
11+
loader: "narik-webpack-tools",
12+
options: {
13+
resolver: new TemplateResolver()
14+
}
15+
}
16+
]
17+
}
18+
]
19+
},
20+
plugins: [
21+
new NarikCompilerPlugin({
22+
decoratorPattern: new RegExp(/Ui$/),
23+
resolver: new TemplateResolver({})
24+
})
25+
]
26+
};

0 commit comments

Comments
 (0)