mirror of
https://github.com/frappe/books.git
synced 2024-12-22 19:09:01 +00:00
init webpack and client with primercss
This commit is contained in:
parent
d8551b9909
commit
17c65bd894
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ node_modules
|
||||
Thumbs.db
|
||||
test.db
|
||||
*.log
|
||||
.cache
|
||||
|
||||
/dist
|
||||
/temp
|
||||
|
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')
|
||||
]
|
||||
}
|
19
frappe/client/index.html
Normal file
19
frappe/client/index.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!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-md">
|
||||
<nav class="menu" aria-label="Person settings">
|
||||
<a class="menu-item selected" href="#url" aria-current="page">Account</a>
|
||||
<a class="menu-item" href="#url">Profile</a>
|
||||
<a class="menu-item" href="#url">Emails</a>
|
||||
<a class="menu-item" href="#url">Notifications</a>
|
||||
</nav>
|
||||
</div>
|
||||
<script src="js/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
1
frappe/client/index.js
Normal file
1
frappe/client/index.js
Normal file
@ -0,0 +1 @@
|
||||
require('./scss/main.scss');
|
667
frappe/client/js/bundle.js
Normal file
667
frappe/client/js/bundle.js
Normal file
File diff suppressed because one or more lines are too long
5
frappe/client/scss/main.scss
Normal file
5
frappe/client/scss/main.scss
Normal file
@ -0,0 +1,5 @@
|
||||
@import "primer/index.scss";
|
||||
|
||||
.container {
|
||||
margin-top: 20px;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
const path = require('path');
|
||||
const bodyParser = require('body-parser');
|
||||
const express = require('express');
|
||||
|
||||
module.exports = {
|
||||
async init() {
|
||||
@ -49,6 +50,7 @@ module.exports = {
|
||||
init_middleware() {
|
||||
this.app.use(bodyParser.json());
|
||||
this.app.use(bodyParser.urlencoded({ extended: true }));
|
||||
this.app.use(express.static('frappe/client'));
|
||||
},
|
||||
|
||||
async start(port=8000) {
|
||||
|
307
package-lock.json
generated
307
package-lock.json
generated
@ -3444,6 +3444,308 @@
|
||||
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
|
||||
"integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks="
|
||||
},
|
||||
"primer": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/primer/-/primer-10.2.0.tgz",
|
||||
"integrity": "sha1-HJ8H6dF2fFfDZKzHHfL6fkiUXSI=",
|
||||
"requires": {
|
||||
"primer-alerts": "1.5.4",
|
||||
"primer-avatars": "1.5.1",
|
||||
"primer-base": "1.6.2",
|
||||
"primer-blankslate": "1.4.4",
|
||||
"primer-box": "2.5.4",
|
||||
"primer-branch-name": "1.0.2",
|
||||
"primer-breadcrumb": "1.5.0",
|
||||
"primer-buttons": "2.5.2",
|
||||
"primer-core": "6.6.1",
|
||||
"primer-forms": "2.0.2",
|
||||
"primer-labels": "1.5.4",
|
||||
"primer-layout": "1.4.4",
|
||||
"primer-markdown": "3.7.4",
|
||||
"primer-marketing": "6.1.0",
|
||||
"primer-marketing-buttons": "1.0.3",
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-marketing-type": "1.4.4",
|
||||
"primer-marketing-utilities": "1.6.0",
|
||||
"primer-navigation": "1.5.2",
|
||||
"primer-page-headers": "1.4.4",
|
||||
"primer-page-sections": "1.4.4",
|
||||
"primer-popover": "0.0.5",
|
||||
"primer-product": "5.6.1",
|
||||
"primer-subhead": "1.0.2",
|
||||
"primer-support": "4.5.1",
|
||||
"primer-table-object": "1.4.4",
|
||||
"primer-tables": "1.4.4",
|
||||
"primer-tooltips": "1.5.1",
|
||||
"primer-truncate": "1.4.4",
|
||||
"primer-utilities": "4.8.4"
|
||||
}
|
||||
},
|
||||
"primer-alerts": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-alerts/-/primer-alerts-1.5.4.tgz",
|
||||
"integrity": "sha1-sR3RPkiZAX10hkfzh+xUSuYo5aE=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-avatars": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/primer-avatars/-/primer-avatars-1.5.1.tgz",
|
||||
"integrity": "sha1-pu0Oh2+BVjzeJ1LVgabT3kYykXk=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-base": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-base/-/primer-base-1.6.2.tgz",
|
||||
"integrity": "sha1-v2tAxi59NVrF9jwzkyEztJID9Qw=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-blankslate": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-blankslate/-/primer-blankslate-1.4.4.tgz",
|
||||
"integrity": "sha1-jDyJrXKwEb07VNABKq54yOUk3PI=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-box": {
|
||||
"version": "2.5.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-box/-/primer-box-2.5.4.tgz",
|
||||
"integrity": "sha1-UNv8pyf3Yqvqx9Z4Ac/JkDjX/sQ=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-branch-name": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-branch-name/-/primer-branch-name-1.0.2.tgz",
|
||||
"integrity": "sha1-hW1hyLyfJDiq//T23qNK7fZ/7aQ=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-breadcrumb": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/primer-breadcrumb/-/primer-breadcrumb-1.5.0.tgz",
|
||||
"integrity": "sha1-z+eMQpHwUDHX87fa2SFi6FcW12w=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-buttons": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-buttons/-/primer-buttons-2.5.2.tgz",
|
||||
"integrity": "sha1-nUzV3YjUFEm1B/BcvgIIoN3ym7k=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-core": {
|
||||
"version": "6.6.1",
|
||||
"resolved": "https://registry.npmjs.org/primer-core/-/primer-core-6.6.1.tgz",
|
||||
"integrity": "sha1-dqlGSOFg7aN5EU/m9UDdl0mw1gQ=",
|
||||
"requires": {
|
||||
"primer-base": "1.6.2",
|
||||
"primer-box": "2.5.4",
|
||||
"primer-breadcrumb": "1.5.0",
|
||||
"primer-buttons": "2.5.2",
|
||||
"primer-forms": "2.0.2",
|
||||
"primer-layout": "1.4.4",
|
||||
"primer-navigation": "1.5.2",
|
||||
"primer-support": "4.5.1",
|
||||
"primer-table-object": "1.4.4",
|
||||
"primer-tooltips": "1.5.1",
|
||||
"primer-truncate": "1.4.4",
|
||||
"primer-utilities": "4.8.4"
|
||||
}
|
||||
},
|
||||
"primer-forms": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-forms/-/primer-forms-2.0.2.tgz",
|
||||
"integrity": "sha1-wziYVArOPXn96QY+7zllWiv/j7g=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-labels": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-labels/-/primer-labels-1.5.4.tgz",
|
||||
"integrity": "sha1-1PUF3bpo5Q6p06wlkF/oNI5VjgY=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-layout": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-layout/-/primer-layout-1.4.4.tgz",
|
||||
"integrity": "sha1-3epEMPPpTuhJtT4GJxjv6hsNESk=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-markdown": {
|
||||
"version": "3.7.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-markdown/-/primer-markdown-3.7.4.tgz",
|
||||
"integrity": "sha1-tGZvFLrVWUM00rJ5Kmuz7e8sbOc=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-marketing": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing/-/primer-marketing-6.1.0.tgz",
|
||||
"integrity": "sha1-uPWrfMI8+++f08NgK9DI4XoMtN0=",
|
||||
"requires": {
|
||||
"primer-marketing-buttons": "1.0.3",
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-marketing-type": "1.4.4",
|
||||
"primer-marketing-utilities": "1.6.0",
|
||||
"primer-page-headers": "1.4.4",
|
||||
"primer-page-sections": "1.4.4",
|
||||
"primer-support": "4.5.1",
|
||||
"primer-tables": "1.4.4"
|
||||
}
|
||||
},
|
||||
"primer-marketing-buttons": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-buttons/-/primer-marketing-buttons-1.0.3.tgz",
|
||||
"integrity": "sha1-VubCJLotrafYdxxj8TNJ7oyboug=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-marketing-support": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-support/-/primer-marketing-support-1.4.0.tgz",
|
||||
"integrity": "sha1-CB899Z7+3d0OUHV2RbpTTbMElbQ="
|
||||
},
|
||||
"primer-marketing-type": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-type/-/primer-marketing-type-1.4.4.tgz",
|
||||
"integrity": "sha1-TgGYPqziTUVMa8a3RHPd+sSnU8w=",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-marketing-utilities": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/primer-marketing-utilities/-/primer-marketing-utilities-1.6.0.tgz",
|
||||
"integrity": "sha1-pO1GaXKQ54AhwcV00HHpI+YT81k=",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-navigation": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-navigation/-/primer-navigation-1.5.2.tgz",
|
||||
"integrity": "sha1-qExQ+7ZZ8tcP21+6tFuPQrvyc+Q=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-page-headers": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-page-headers/-/primer-page-headers-1.4.4.tgz",
|
||||
"integrity": "sha1-olDnBzrmSD+nyrbeWk4fzm8UycU=",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-page-sections": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-page-sections/-/primer-page-sections-1.4.4.tgz",
|
||||
"integrity": "sha1-pGfcCPx9XrauuqtLQGhzuK4XNFw=",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-popover": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/primer-popover/-/primer-popover-0.0.5.tgz",
|
||||
"integrity": "sha1-XebWLeBnZ99edfUoHKp7ZigLAP0=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-product": {
|
||||
"version": "5.6.1",
|
||||
"resolved": "https://registry.npmjs.org/primer-product/-/primer-product-5.6.1.tgz",
|
||||
"integrity": "sha1-Uxpx3mQcGUGFhkCxwjYfEFaT9mU=",
|
||||
"requires": {
|
||||
"primer-alerts": "1.5.4",
|
||||
"primer-avatars": "1.5.1",
|
||||
"primer-blankslate": "1.4.4",
|
||||
"primer-branch-name": "1.0.2",
|
||||
"primer-labels": "1.5.4",
|
||||
"primer-markdown": "3.7.4",
|
||||
"primer-popover": "0.0.5",
|
||||
"primer-subhead": "1.0.2",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-subhead": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/primer-subhead/-/primer-subhead-1.0.2.tgz",
|
||||
"integrity": "sha1-UwMw/1FoFXnpu9y6T6+cnO3wgEs=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-support": {
|
||||
"version": "4.5.1",
|
||||
"resolved": "https://registry.npmjs.org/primer-support/-/primer-support-4.5.1.tgz",
|
||||
"integrity": "sha1-MnOm79A2ugBTlEfWm6ZpvosR32Y="
|
||||
},
|
||||
"primer-table-object": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-table-object/-/primer-table-object-1.4.4.tgz",
|
||||
"integrity": "sha1-NbCZQqfVMGuDD9V9dhkMilols3Q=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-tables": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-tables/-/primer-tables-1.4.4.tgz",
|
||||
"integrity": "sha1-W+IdzMZLt7GD/ImhIIozbZn2HdU=",
|
||||
"requires": {
|
||||
"primer-marketing-support": "1.4.0",
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-tooltips": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/primer-tooltips/-/primer-tooltips-1.5.1.tgz",
|
||||
"integrity": "sha1-nNOpODZ73n1fBhaJbyeAFq8sMh8=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-truncate": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-truncate/-/primer-truncate-1.4.4.tgz",
|
||||
"integrity": "sha1-Jc3hLDegiALuPTX80on224y3ojU=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"primer-utilities": {
|
||||
"version": "4.8.4",
|
||||
"resolved": "https://registry.npmjs.org/primer-utilities/-/primer-utilities-4.8.4.tgz",
|
||||
"integrity": "sha1-7Qqu8rNZCSBDnA5r3YjdCyCZlqc=",
|
||||
"requires": {
|
||||
"primer-support": "4.5.1"
|
||||
}
|
||||
},
|
||||
"process": {
|
||||
"version": "0.11.10",
|
||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||
@ -3969,11 +4271,6 @@
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
|
||||
"dev": true
|
||||
},
|
||||
"sql.js": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/sql.js/-/sql.js-0.4.0.tgz",
|
||||
"integrity": "sha1-I76WNVIOsP9Dp0Hn6DA5cmbohEU="
|
||||
},
|
||||
"sqlite3": {
|
||||
"version": "3.1.13",
|
||||
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-3.1.13.tgz",
|
||||
|
@ -11,7 +11,6 @@
|
||||
"body-parser": "^1.18.2",
|
||||
"express": "^4.16.2",
|
||||
"node-fetch": "^1.7.3",
|
||||
"nodemon": "^1.14.7",
|
||||
"sqlite3": "^3.1.13",
|
||||
"walk": "^2.3.9"
|
||||
},
|
||||
@ -29,8 +28,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/frappe/frappe-js#readme",
|
||||
"devDependencies": {
|
||||
"css-loader": "^0.28.7",
|
||||
"eslint": "^4.9.0",
|
||||
"mocha": "^4.0.1",
|
||||
"webpack": "^3.8.1"
|
||||
"node-sass": "^4.7.2",
|
||||
"nodemon": "^1.14.7",
|
||||
"primer": "10.2.0",
|
||||
"sass-loader": "^6.0.6",
|
||||
"style-loader": "^0.19.1",
|
||||
"webpack": "^3.10.0"
|
||||
}
|
||||
}
|
||||
|
21
webpack.config.js
Normal file
21
webpack.config.js
Normal file
@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
entry: './frappe/client/index.js',
|
||||
output: {
|
||||
filename: './frappe/client/js/bundle.js'
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.scss$/,
|
||||
use: [{
|
||||
loader: "style-loader" // creates style nodes from JS strings
|
||||
}, {
|
||||
loader: "css-loader" // translates CSS into CommonJS
|
||||
}, {
|
||||
loader: "sass-loader", // compiles Sass to CSS
|
||||
options: {
|
||||
includePaths: ["node_modules", "./frappe/client/scss"]
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user