Skip to content

Commit b806688

Browse files
authored
Merge pull request #5 from Protocore-UI/develop
Develop
2 parents 34997e4 + a66d448 commit b806688

9 files changed

+102
-27
lines changed

README.md

+84-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,90 @@
11
# protocore-typescript-edition
22

3+
Protocore-typescript-edition is special TypeScript implementation edition of Protocore project.
4+
5+
## Supports
6+
* Node.js v6.0.0 or above
7+
8+
## List of npm/libs etc. that are used to build it
9+
10+
* jQuery - Used for DOM manipulation.
11+
* Webpack - Used for module loader & bundler.
12+
* Hasher & Crossroads - Used for application routing
13+
* Signals - Used for pubsub events.
14+
* Express - Used for local HTTP-server static serving.
15+
* Mocha & Chai - Used for unit testing [Coming soon]
16+
* JSHint, CSSLint, JSCS, LESS, JSON [Coming soon] & Handlebars templating
17+
318
## Installation
419

20+
Assuming that Git is already installed & running:
21+
```
22+
git clone https://github.com/Protocore-UI/protocore-typescript-edition.git
23+
```
24+
25+
Assuming that Node.js is already installed & running,
26+
27+
Install dependencies:
28+
```
29+
npm install
30+
31+
npm install -g webpack
32+
```
33+
34+
Generate bundle file: (First command after installing dependencies)
35+
```
36+
npm run build
37+
```
38+
39+
To start the development server:
40+
```
41+
npm start
42+
```
43+
44+
## Protocore Experiments
45+
46+
[Protocore](https://github.com/Protocore-UI/Protocore) is an open source walking application skeleton for a typical unstructured JavaScript/jQuery web apps. You can use it to quickly bootstrap your unstructured JavaScript/jQuery web application projects.
47+
48+
[protocore-webpack-edition](https://github.com/Protocore-UI/protocore-webpack-edition) is a special ECMAScript 6 + Webpack implementation edition of Protocore project.
49+
50+
[generator-protocore](https://github.com/Protocore-UI/generator-protocore) is a Yeoman generator for Protocore. The tool will help to generate walking application skeleton for a typical unstructured JavaScript/jQuery web apps.
51+
52+
[Protocore-cli](https://github.com/Protocore-UI/protocore-cli) is a command line generator for Protocore. This tool will help to generate a walking application skeleton for a typical unstructured JavaScript/jQuery web apps.
53+
54+
## Server layer
55+
56+
The server side codebase resides in the ```server.js``` and ```config.js``` files. By default, the server layer is written in JavaScript (Node.js with Express 4.x) which can be configured and flexible to work with any server side scripting language like Java, PHP, ASP.NET or others. As client and server layer are seperate entity.
57+
58+
## Client layer
59+
60+
The client side codebase resides in the ```src``` folder. This folder contains following subfolders.
61+
562
```
6-
npm install -g typings typescript tsd webpack
7-
tsd install
63+
/src
64+
+-- /stylesheets
65+
+--/css
66+
+--/less
67+
+--/common
68+
+--/base
69+
+--/layout
70+
+--/modules
71+
+--/state
72+
+--/theme
73+
+-- /assets
74+
+--/fonts
75+
+--/images
76+
+-- /apps
77+
+--/views
78+
+--/router
79+
+--/templates
880
```
81+
82+
## Stylesheet layer
83+
84+
The codebase comes with LESS setup with a ```Scalable and Modular Architecture for CSS (SMACSS)``` approach. SMACSS is a way to examine your design process and as a way to fit those rigid frameworks into a flexible thought process. It is an attempt to document a consistent approach to site development when using CSS.
85+
86+
## License
87+
88+
The MIT License (MIT)
89+
90+
Copyright (c) 2016 Ashwin Hegde

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"name": "protocore-typescript-edition",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Protocore-typescript-edition is special Typescript implementation edition of Protocore project.",
55
"scripts": {
66
"start": "node server.js",
77
"dev": "webpack -d --watch",
8-
"build": "webpack -p",
9-
"postinstall": "typings install"
8+
"build": "webpack -p"
109
},
1110
"repository": {
1211
"type": "git",
@@ -19,11 +18,6 @@
1918
},
2019
"homepage": "https://github.com/Protocore-UI/protocore-typescript-edition#readme",
2120
"dependencies": {
22-
"@types/crossroads": "0.0.29",
23-
"@types/handlebars": "^4.0.31",
24-
"@types/hasher": "0.0.28",
25-
"@types/jquery": "^2.0.33",
26-
"@types/signals": "0.0.17",
2721
"body-parser": "~1.14.2",
2822
"cookie-parser": "~1.3.2",
2923
"crossroads": "^0.12.2",
@@ -36,6 +30,11 @@
3630
"typescript": "^2.0.3"
3731
},
3832
"devDependencies": {
33+
"@types/crossroads": "0.0.29",
34+
"@types/handlebars": "^4.0.31",
35+
"@types/hasher": "0.0.28",
36+
"@types/jquery": "^2.0.33",
37+
"@types/signals": "0.0.17",
3938
"chai": "^3.0.0",
4039
"css-loader": "^0.23.1",
4140
"csslint-loader": "^0.2.1",

src/apps/router/routes.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import * as signals from "signals";
22
import * as hasher from "hasher";
33
import * as crossroads from "crossroads";
44

5+
declare function require(module: string): any;
6+
57
import HomeView from '../views/homeView';
6-
import HomeTemplate from '../templates/homeTpl.handlebars';
8+
let HomeTemplate = require('../templates/homeTpl.handlebars');
79

810
import AboutView from '../views/aboutView';
9-
import AboutTemplate from '../templates/aboutTpl.handlebars';
11+
let AboutTemplate = require('../templates/aboutTpl.handlebars');
1012

1113
let router = crossroads.create();
1214

@@ -15,7 +17,6 @@ let parseHash = (newHash: any) => {
1517
};
1618

1719
router.addRoute('', () => {
18-
console.log("Home View");
1920
new HomeView({
2021
template: HomeTemplate
2122
});

src/apps/templates/aboutTpl.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="cover-container">
44
<div class="masthead clearfix">
55
<div class="inner">
6-
<h1 class="masthead-brand">Protocore Typescript <sup><small class="release">v0.0.3</small></sup></h1>
6+
<h1 class="masthead-brand">Protocore Typescript <sup><small class="release">v0.0.4</small></sup></h1>
77
<ul class="nav masthead-nav">
88
<li><a href="#">Home</a></li>
99
<li class="active"><a href="#about">About</a></li>

src/apps/templates/declarations.d.ts

-5
This file was deleted.

src/apps/templates/homeTpl.handlebars

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="cover-container">
44
<div class="masthead clearfix">
55
<div class="inner">
6-
<h1 class="masthead-brand">Protocore Typescript <sup><small class="release">v0.0.3</small></sup></h1>
6+
<h1 class="masthead-brand">Protocore Typescript <sup><small class="release">v0.0.4</small></sup></h1>
77
<ul class="nav masthead-nav">
88
<li class="active"><a href="#">Home</a></li>
99
<li><a href="#about">About</a></li>

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<head>
99
<meta charset="utf-8"/>
1010
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
11-
<title>Protocore Typescript Edition&brvbar; v0.0.3</title>
11+
<title>Protocore Typescript Edition&brvbar; v0.0.4</title>
1212
</head>
1313
<body>
1414
<!--[if lt IE 7]>

tsconfig.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
"module": "commonjs",
88
"moduleResolution": "node",
99
"target": "es5",
10-
"removeComments": true
10+
"removeComments": true,
11+
"strictNullChecks": false
1112
},
1213
"include": [
1314
"src/**/*"
1415
],
1516
"exclude": [
1617
"node_modules"
17-
],
18-
"files": [
19-
"src/apps/templates/declarations.d.ts"
20-
]
18+
]
2119
}

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var config = {
3131
test: /\.(jpg|jpeg|png|gif|svg)$/i,
3232
loader: 'file'
3333
}, {
34-
test: /\.handlebars?$/i,
34+
test: /\.handlebars$/,
3535
loader: 'handlebars-loader'
3636
}, {
3737
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,

0 commit comments

Comments
 (0)