mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
first commit
This commit is contained in:
commit
90b5badec8
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
test.db
|
||||
*.log
|
||||
.cache
|
||||
|
||||
/dist
|
||||
/temp
|
||||
|
||||
# ignore everything in 'app' folder what had been generated from 'src' folder
|
||||
/app/app.js
|
||||
/app/background.js
|
||||
/app/**/*.map
|
10
.sassrc.js
Normal file
10
.sassrc.js
Normal file
@ -0,0 +1,10 @@
|
||||
const path = require('path')
|
||||
|
||||
const CWD = process.cwd()
|
||||
|
||||
module.exports = {
|
||||
"includePaths": [
|
||||
path.resolve(CWD, 'node_modules'),
|
||||
path.resolve(CWD, 'client/scss')
|
||||
]
|
||||
}
|
13
index.html
Normal file
13
index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class='container wrapper'>
|
||||
</div>
|
||||
<script src="js/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
32
index.js
Normal file
32
index.js
Normal file
@ -0,0 +1,32 @@
|
||||
require('./scss/main.scss');
|
||||
window.$ = require('jquery');
|
||||
|
||||
const common = require('frappe-core/frappe/common');
|
||||
const Database = require('frappe-core/frappe/backends/rest_client').Database
|
||||
|
||||
window.frappe = require('frappe-core');
|
||||
const listview = require('frappe-core/frappe/view/list.js');
|
||||
|
||||
async function start() {
|
||||
frappe.init();
|
||||
common.init_libs(frappe);
|
||||
|
||||
frappe.db = await new Database({
|
||||
server: 'localhost:8000',
|
||||
fetch: window.fetch.bind()
|
||||
});
|
||||
|
||||
const todo = require('frappe-core/frappe/models/doctype/todo/todo.js');
|
||||
frappe.init_controller('todo', todo);
|
||||
|
||||
frappe.init_view({container: $('.container')});
|
||||
}
|
||||
|
||||
start().then(() => {
|
||||
let todo_list = new listview.ListView({
|
||||
doctype: 'ToDo',
|
||||
parent: frappe.main
|
||||
});
|
||||
todo_list.render();
|
||||
})
|
||||
|
12032
js/bundle.js
Normal file
12032
js/bundle.js
Normal file
File diff suppressed because one or more lines are too long
23
package.json
Normal file
23
package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "frappe-todo",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.18.2",
|
||||
"express": "^4.16.2",
|
||||
"node-fetch": "^1.7.3",
|
||||
"sqlite3": "^3.1.13",
|
||||
"walk": "^2.3.9",
|
||||
"autoprefixer": "^7.2.4",
|
||||
"bootstrap": "4.0.0-alpha.6",
|
||||
"css-loader": "^0.28.8",
|
||||
"node-sass": "^4.7.2",
|
||||
"postcss-loader": "^2.0.10",
|
||||
"precss": "^2.0.0",
|
||||
"sass-loader": "^6.0.6",
|
||||
"style-loader": "^0.19.1",
|
||||
"webpack": "^3.10.0",
|
||||
"webpack-dev-server": "^2.9.7"
|
||||
}
|
||||
}
|
27
scss/main.scss
Normal file
27
scss/main.scss
Normal file
@ -0,0 +1,27 @@
|
||||
$gray-000: #fafbfc !default;
|
||||
$gray-100: #f6f8fa !default;
|
||||
$gray-200: #e1e4e8 !default;
|
||||
$gray-300: #d1d5da !default;
|
||||
$gray-400: #959da5 !default;
|
||||
$gray-500: #6a737d !default;
|
||||
$gray-600: #586069 !default;
|
||||
$gray-700: #444d56 !default;
|
||||
$gray-800: #2f363d !default;
|
||||
$gray-900: #24292e !default; // body font color
|
||||
|
||||
@import "node_modules/bootstrap/scss/bootstrap";
|
||||
|
||||
html {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
margin-top: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 4fr;
|
||||
grid-auto-rows: minmax(500px, auto);
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-color: $gray-100;
|
||||
}
|
10
server.js
Normal file
10
server.js
Normal file
@ -0,0 +1,10 @@
|
||||
const server = require('frappe-core/frappe/server');
|
||||
const frappe = require('frappe-core');
|
||||
const express = require('express');
|
||||
|
||||
server.start({
|
||||
backend: 'sqllite',
|
||||
connection_params: {db_path: 'test.db'}
|
||||
}).then(() => {
|
||||
frappe.app.use(express.static('./'));
|
||||
});
|
44
webpack.config.js
Normal file
44
webpack.config.js
Normal file
@ -0,0 +1,44 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './index.js',
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname),
|
||||
compress: true,
|
||||
port: 9000,
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
output: {
|
||||
filename: './js/bundle.js',
|
||||
publicPath: '/'
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
{
|
||||
loader: "style-loader" // creates style nodes from JS strings
|
||||
},
|
||||
{
|
||||
loader: "css-loader" // translates CSS into CommonJS
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader', // Run post css actions
|
||||
options: {
|
||||
plugins: function () { // post css plugins, can be exported to postcss.config.js
|
||||
return [
|
||||
require('precss'),
|
||||
require('autoprefixer')
|
||||
];
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "sass-loader", // compiles Sass to CSS
|
||||
options: {
|
||||
includePaths: ["node_modules", "./frappe/client/scss"]
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user