Skip to content

Commit b38d0b1

Browse files
committed
Add Project
0 parents  commit b38d0b1

163 files changed

Lines changed: 18061 additions & 0 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# CRUD Framework7
2+
Aplikasi CRUD Sederhana Berbasis Mobile yang menggunakan Framework7 berguna untuk teman - teman yang baru belajar mobile menggunakan Framework7
3+
4+
# Usage
5+
* Install Node.js
6+
* Buka direktori Zodiak Weton di Command Prompt
7+
* Ketik npm start
8+
* Otomatis terbuka localhost:8080
9+
10+
## Framework7 CLI Options
11+
12+
Framework7 app created with following options:
13+
14+
```
15+
{
16+
"cwd": "C:\\Users\\pavilion\\Documents\\ProjectSourceTree\\Kurema",
17+
"type": [
18+
"web",
19+
"cordova"
20+
],
21+
"name": "Kurema",
22+
"framework": "core",
23+
"template": "tabs",
24+
"bundler": "webpack",
25+
"cssPreProcessor": "stylus",
26+
"theming": {
27+
"customColor": false,
28+
"color": "#007aff",
29+
"darkTheme": false,
30+
"iconFonts": true,
31+
"fillBars": false
32+
},
33+
"customBuild": false,
34+
"webpack": {
35+
"developmentSourceMap": true,
36+
"productionSourceMap": true,
37+
"hashAssets": false,
38+
"preserveAssetsPaths": false,
39+
"inlineAssets": true
40+
},
41+
"pkg": "io.framework7.myapp",
42+
"cordova": {
43+
"folder": "cordova",
44+
"platforms": [
45+
"ios",
46+
"android"
47+
],
48+
"plugins": [
49+
"cordova-plugin-statusbar",
50+
"cordova-plugin-keyboard",
51+
"cordova-plugin-splashscreen"
52+
]
53+
}
54+
}
55+
```
56+
57+
## NPM Scripts
58+
59+
* 🔥 `start` - run development server
60+
* 🔧 `dev` - run development server
61+
* 🔧 `build-dev` - build web app using development mode (faster build without minification and optimization)
62+
* 🔧 `build-prod` - build web app for production
63+
* 📱 `build-dev-cordova` - build cordova app using development mode (faster build without minification and optimization)
64+
* 📱 `build-prod-cordova` - build cordova app
65+
* 📱 `build-dev-cordova-ios` - build cordova iOS app using development mode (faster build without minification and optimization)
66+
* 📱 `build-prod-cordova-ios` - build cordova iOS app
67+
* 📱 `build-dev-cordova-android` - build cordova Android app using development mode (faster build without minification and optimization)
68+
* 📱 `build-prod-cordova-android` - build cordova Android app
69+
70+
## WebPack
71+
72+
There is a webpack bundler setup. It compiles and bundles all "front-end" resources. You should work only with files located in `/src` folder. Webpack config located in `build/webpack.config.js`.
73+
74+
Webpack has specific way of handling static assets (CSS files, images, audios). You can learn more about correct way of doing things on [official webpack documentation](https://webpack.js.org/guides/asset-management/).
75+
## Cordova
76+
77+
Cordova project located in `cordova` folder. You shouldn't modify content of `cordova/www` folder. Its content will be correctly generated when you call `npm run cordova-build-prod`.
78+
79+
80+
81+
## Assets
82+
83+
Assets (icons, splash screens) source images located in `assets-src` folder. To generate your own icons and splash screen images, you will need to replace all assets in this directory with your own images (pay attention to image size and format), and run the following command in the project directory:
84+
85+
```
86+
framework7 assets
87+
```
88+
89+
Or launch UI where you will be able to change icons and splash screens:
90+
91+
```
92+
framework7 assets --ui
93+
```
94+
95+
## Documentation & Resources
96+
97+
* [Framework7 Core Documentation](https://framework7.io/docs/)
98+
99+
100+
101+
* [Framework7 Icons Reference](https://framework7.io/icons/)
102+
* [Community Forum](https://forum.framework7.io)
103+
104+
## Support Framework7
105+
106+
Love Framework7? Support project by donating or pledging on patreon:
107+
https://patreon.com/vladimirkharlampidi
108+
109+
## License
110+
MIT License 2020, Rizki Karianata.
111+
112+
The data may not be used for commercial purposes.

assets-src/apple-touch-icon.png

14.6 KB
Loading
26.7 KB
Loading

assets-src/cordova-ios-icon.png

51.6 KB
Loading
47.2 KB
Loading

assets-src/web-icon.png

26.7 KB
Loading

babel.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', {
4+
modules: false,
5+
}],
6+
],
7+
plugins: [
8+
'@babel/plugin-transform-runtime',
9+
'@babel/plugin-syntax-dynamic-import',
10+
],
11+
};

build/build.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const webpack = require('webpack');
2+
const ora = require('ora');
3+
const rm = require('rimraf');
4+
const chalk = require('chalk');
5+
const config = require('./webpack.config.js');
6+
7+
const env = process.env.NODE_ENV || 'development';
8+
const target = process.env.TARGET || 'web';
9+
const isCordova = target === 'cordova'
10+
11+
const spinner = ora(env === 'production' ? 'building for production...' : 'building development version...');
12+
spinner.start();
13+
14+
rm(isCordova ? './cordova/www' : './www/', (removeErr) => {
15+
if (removeErr) throw removeErr;
16+
17+
webpack(config, (err, stats) => {
18+
if (err) throw err;
19+
spinner.stop();
20+
21+
process.stdout.write(`${stats.toString({
22+
colors: true,
23+
modules: false,
24+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
25+
chunks: false,
26+
chunkModules: false,
27+
})}\n\n`);
28+
29+
if (stats.hasErrors()) {
30+
console.log(chalk.red('Build failed with errors.\n'));
31+
process.exit(1);
32+
}
33+
34+
console.log(chalk.cyan('Build complete.\n'));
35+
});
36+
});

build/webpack.config.js

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
const webpack = require('webpack');
2+
const CopyWebpackPlugin = require('copy-webpack-plugin');
3+
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
5+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6+
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin');
7+
const TerserPlugin = require('terser-webpack-plugin');
8+
9+
10+
const path = require('path');
11+
12+
function resolvePath(dir) {
13+
return path.join(__dirname, '..', dir);
14+
}
15+
16+
const env = process.env.NODE_ENV || 'development';
17+
const target = process.env.TARGET || 'web';
18+
const isCordova = target === 'cordova';
19+
20+
21+
module.exports = {
22+
mode: env,
23+
entry: {
24+
app: './src/js/app.js',
25+
},
26+
output: {
27+
path: resolvePath(isCordova ? 'cordova/www' : 'www'),
28+
filename: 'js/[name].js',
29+
chunkFilename: 'js/[name].js',
30+
publicPath: '',
31+
hotUpdateChunkFilename: 'hot/hot-update.js',
32+
hotUpdateMainFilename: 'hot/hot-update.json',
33+
},
34+
resolve: {
35+
extensions: ['.js', '.json'],
36+
alias: {
37+
38+
'@': resolvePath('src'),
39+
},
40+
41+
},
42+
devtool: env === 'production' ? 'source-map' : 'eval',
43+
devServer: {
44+
hot: true,
45+
open: true,
46+
compress: true,
47+
contentBase: '/www/',
48+
disableHostCheck: true,
49+
historyApiFallback: true,
50+
watchOptions: {
51+
poll: 1000,
52+
},
53+
},
54+
optimization: {
55+
minimizer: [new TerserPlugin({
56+
sourceMap: true,
57+
})],
58+
},
59+
module: {
60+
rules: [
61+
{
62+
test: /\.(mjs|js|jsx)$/,
63+
use: 'babel-loader',
64+
include: [
65+
resolvePath('src'),
66+
resolvePath('node_modules/framework7'),
67+
68+
69+
70+
resolvePath('node_modules/template7'),
71+
resolvePath('node_modules/dom7'),
72+
resolvePath('node_modules/ssr-window'),
73+
],
74+
},
75+
{
76+
test: /\.f7.html$/,
77+
use: [
78+
'babel-loader',
79+
{
80+
loader: 'framework7-component-loader',
81+
options: {
82+
helpersPath: './src/template7-helpers-list.js',
83+
},
84+
},
85+
],
86+
},
87+
88+
89+
{
90+
test: /\.css$/,
91+
use: [
92+
(env === 'development' ? 'style-loader' : {
93+
loader: MiniCssExtractPlugin.loader,
94+
options: {
95+
publicPath: '../'
96+
}
97+
}),
98+
'css-loader',
99+
'postcss-loader',
100+
],
101+
},
102+
{
103+
test: /\.styl(us)?$/,
104+
use: [
105+
(env === 'development' ? 'style-loader' : {
106+
loader: MiniCssExtractPlugin.loader,
107+
options: {
108+
publicPath: '../'
109+
}
110+
}),
111+
'css-loader',
112+
'postcss-loader',
113+
'stylus-loader',
114+
],
115+
},
116+
{
117+
test: /\.less$/,
118+
use: [
119+
(env === 'development' ? 'style-loader' : {
120+
loader: MiniCssExtractPlugin.loader,
121+
options: {
122+
publicPath: '../'
123+
}
124+
}),
125+
'css-loader',
126+
'postcss-loader',
127+
'less-loader',
128+
],
129+
},
130+
{
131+
test: /\.(sa|sc)ss$/,
132+
use: [
133+
(env === 'development' ? 'style-loader' : {
134+
loader: MiniCssExtractPlugin.loader,
135+
options: {
136+
publicPath: '../'
137+
}
138+
}),
139+
'css-loader',
140+
'postcss-loader',
141+
'sass-loader',
142+
],
143+
},
144+
{
145+
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
146+
loader: 'url-loader',
147+
options: {
148+
limit: 10000,
149+
name: 'images/[name].[ext]',
150+
151+
},
152+
},
153+
{
154+
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac|m4a)(\?.*)?$/,
155+
loader: 'url-loader',
156+
options: {
157+
limit: 10000,
158+
name: 'media/[name].[ext]',
159+
160+
},
161+
},
162+
{
163+
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
164+
loader: 'url-loader',
165+
options: {
166+
limit: 10000,
167+
name: 'fonts/[name].[ext]',
168+
169+
},
170+
},
171+
],
172+
},
173+
plugins: [
174+
new webpack.DefinePlugin({
175+
'process.env.NODE_ENV': JSON.stringify(env),
176+
'process.env.TARGET': JSON.stringify(target),
177+
}),
178+
179+
...(env === 'production' ? [
180+
new OptimizeCSSPlugin({
181+
cssProcessorOptions: {
182+
safe: true,
183+
map: { inline: false },
184+
},
185+
}),
186+
new webpack.optimize.ModuleConcatenationPlugin(),
187+
] : [
188+
// Development only plugins
189+
new webpack.HotModuleReplacementPlugin(),
190+
new webpack.NamedModulesPlugin(),
191+
]),
192+
new HtmlWebpackPlugin({
193+
filename: './index.html',
194+
template: './src/index.html',
195+
inject: true,
196+
minify: env === 'production' ? {
197+
collapseWhitespace: true,
198+
removeComments: true,
199+
removeRedundantAttributes: false,
200+
removeScriptTypeAttributes: true,
201+
removeStyleLinkTypeAttributes: true,
202+
useShortDoctype: true
203+
} : false,
204+
}),
205+
new MiniCssExtractPlugin({
206+
filename: 'css/[name].css',
207+
}),
208+
new CopyWebpackPlugin({
209+
patterns: [
210+
{
211+
noErrorOnMissing: true,
212+
from: resolvePath('src/static'),
213+
to: resolvePath(isCordova ? 'cordova/www/static' : 'www/static'),
214+
},
215+
216+
],
217+
}),
218+
219+
220+
],
221+
};

0 commit comments

Comments
 (0)