Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Initial project structure with working build job
Browse files Browse the repository at this point in the history
Typescript is compiled to ES6 which is then transpiled with babel
to ES5 and finally bundled by webpack.
  • Loading branch information
lepus2589 committed Dec 5, 2015
0 parents commit 041eb89
Show file tree
Hide file tree
Showing 126 changed files with 22,885 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# raster graphics
*.bmp binary -delta
*.gif binary -delta
*.giff binary -delta
*.jpg binary -delta
*.jpeg binary -delta
*.png binary -delta
*.tif binary -delta
*.tiff binary -delta
*.xcf binary -delta

# vector graphics
*.eps binary
*.pdf binary
*.ps binary
*.svg binary
*.swf binary
*.wmf binary

122 changes: 122 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
.*
!.gitattributes
!.gitignore

# Created by https://www.gitignore.io/api/windows,linux,osx,node,grunt

### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


### Linux ###
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### grunt ###
# Grunt usually compiles files inside this directory
dist/

# Grunt usually preprocesses files such as coffeescript, compass... inside the .tmp directory
.tmp/


### Cordova ###
# The hooks directory is deprecated
hooks/**
platforms/**
plugins/**


### Project ###
# This directory will be built from typescript
www/**
src/typings/tsd/**
src/modules/config/registration-info.json
94 changes: 94 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
module.exports = function(grunt) {
var webpack = require("webpack");
var webpackConfig = require('./webpack.config.js');

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('./package.json'),
clean: {
prebuild: {
src: ['./www/**/*']
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: './src/themes',
src: ['./**/assets/**'],
dest: './www/themes'
},
{
src: './src/index.html',
dest: './www/index.html'
}
]
}
},
webpack: {
options: webpackConfig,
build: {
plugins: webpackConfig.plugins.concat(
new webpack.DefinePlugin({
'process.env': {
// This has effect on the react lib size
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin()
)
},
'build-dev': {
devtool: 'sourcemap',
debug: true
}
},
less: {
build: {
options: {
paths: ["./src"],
plugins: [
new (require('less-plugin-autoprefix'))({browsers: ["last 2 versions"]}),
new (require('less-plugin-clean-css'))()
],
modifyVars: {
// themesPath: '"themes"'
}
},
files: [
{
expand: true,
cwd: './src/themes',
src: ['./*.less'],
dest: './www/themes',
ext: '.css'
}
]
},
'build-dev': {
options: {
paths: ["./src"],
sourceMap: true
},
files: [
{
expand: true,
cwd: './src/themes',
src: ['./*.less'],
dest: './www/themes',
ext: '.css'
}
]
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-webpack');

grunt.registerTask('build', ['clean:prebuild', 'webpack:build', 'less:build', 'copy:build']);
grunt.registerTask('build-dev', ['clean:prebuild', 'webpack:build-dev', 'less:build-dev', 'copy:build']);
};
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Pocket Combine #

Pocket Combine is a small Android app using the SWCombine.com Web Service.
35 changes: 35 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version='0.1.0' encoding='utf-8'?>
<widget id="com.swcombine.pocketcombine"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Pocket Combine</name>
<description>
A small Android app using the SWCombine.com Web Service.
</description>
<author email="[email protected]" href="https://github.com/b0r3as">
b0r3as
</author>
<content src="index.html" />

<plugin name="cordova-plugin-whitelist" spec="1" />

<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

<hook type="before_build" src="src/cordova-hooks/app-before-build.js" />

<platform name="android">
<allow-intent href="market:*" />
</platform>

<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "pocket-combine",
"version": "0.1.0",
"description": "",
"author": "b0r3as <[email protected]>",
"private": true,
"license": "WTFPL",
"repository": {
"type": "git",
"url": "https://github.com/boreas/pocket-combine"
},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.3.13",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"base64-loader": "^1.0.0",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.7.0",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-less": "^1.1.0",
"grunt-webpack": "^1.0.11",
"less-plugin-autoprefix": "^1.5.1",
"less-plugin-clean-css": "^1.5.1",
"lodash": "^3.10.1",
"raw-loader": "^0.5.1",
"ts-loader": "^0.7.2",
"typescript": "^1.7.3",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
}
}
9 changes: 9 additions & 0 deletions src/app/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference path="../libs/libs.d.ts" />
/// <reference path="../modules/modules.d.ts" />
/// <reference path="../typings/typings.d.ts" />

declare module app {
}

// for requiring templates
declare function require(id: string): string;
Empty file added src/app/app.less
Empty file.
37 changes: 37 additions & 0 deletions src/app/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {Test} from './main/main';
import {can} from 'libs';
import {cordova} from 'libs';
import {$} from 'libs';
import config from 'config';

module PocketCombineApp {
"use strict";

export module Application {
export function initialize(): void {
document.addEventListener('deviceready', onDeviceReady, false);
}

function onDeviceReady(): void {
// Handle the Cordova pause and resume events
document.addEventListener('pause', onPause, false);
document.addEventListener('resume', onResume, false);

// TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.
console.log(require('./main/test.stache'), new Test(), cordova.version, config.registrationInfo);
console.log($('body'), can.VERSION);
}

function onPause(): void {
// TODO: This application has been suspended. Save application state here.
}

function onResume(): void {
// TODO: This application has been reactivated. Restore application state here.
}
}

window.onload = function (): void {
Application.initialize();
}
}
4 changes: 4 additions & 0 deletions src/app/main/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export class Test {
public myTest: number;
}
3 changes: 3 additions & 0 deletions src/app/main/test.stache
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
Test
</div>
Loading

0 comments on commit 041eb89

Please sign in to comment.