Skip to content

Commit 7f8a136

Browse files
committed
license, public/ folder generation, readme changes
1 parent f2be071 commit 7f8a136

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

LICENSE

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2019 Grady O'Connell
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
# singlefile
2+
13
This project is working, but it is unfinished.
24

3-
This script allows you to create node "toy" apps, where you create and run your app
4-
with client, server, and template code embedded in one file. You can expand across files if you want,
5-
but the main purpose is to have your core web app code condensed for the sake of simplicity.
5+
This script allows you to create single-file web apps, where you create and run your app
6+
with client, server, and template code embedded in just one file. This is great for small
7+
projects and demos.
68

79
Look at the examples/ folder to see how it can be used.
810

9-
I have plans to make this very flexible, such as having it work with different languages, stacks, base configurations.
11+
I have plans to make this very flexible, such as having it work with different languages, stacks, and base configurations.
1012

1113
Scripts support a shebang line, so you'll be able to simply execute the file and have all the necessary
1214
temporary files generated when you run it.
1315

14-
This repo is not a package yet, but will be in the future.
16+
## Features
17+
18+
[x] Basic functionality (see basic example)
19+
[ ] Add browserify to grunt steps to get client-side require()
20+
[ ] Allow setting path for custom compilers somehow (must be // or # comment on first/second line)
21+
[ ] Selectable base for minimal boilerplate
22+
[ ] Expand default express base (SSL, etc.)
23+
[ ] Support other CSS alternatives
24+
[ ] React support and example
25+
[ ] Different view engines in addition to pug (could even make it detectable)
26+
[ ] Live reloading when script file is modified
27+
[ ] Generated folder paths inside of views and public (grunt nodemon)
28+
[ ] Show npm, yarn, and grunt output if -v (verbose)
29+
[ ] Native app bases
1530

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "singlefile",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "run.js",
6+
"author": "Grady O'Connell",
7+
"dependencies": {
8+
}
9+
}

singlefile.ls

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ script = require(jsname)
3030

3131
run_npm = (script,cb)->
3232
if script.npm
33+
# TODO: add singlefile dependencies to package?
3334
fs.writeFile path.join(scriptdir, 'package.json'), JSON.stringify(script.npm), (err)->
3435
if err
3536
return cb err
@@ -41,6 +42,7 @@ run_npm = (script,cb)->
4142

4243
run_yarn = (script,cb)->
4344
if script.yarn
45+
# TODO: add singlefile dependencies to package?
4446
fs.writeFile path.join(scriptdir, 'package.json'), JSON.stringify(script.yarn), (err)->
4547
if err
4648
return cb err
@@ -100,6 +102,12 @@ try
100102
for template, content of script.views
101103
fs.writeFileSync path.join(scriptdir,'views',template), content
102104

105+
# generate static/public dir
106+
try
107+
fs.mkdirSync path.join(scriptdir,'public')
108+
for staticfile, content of script.public
109+
fs.writeFileSync path.join(scriptdir,'public', staticfile), content
110+
103111
app = express()
104112
app.set 'view engine', 'pug'
105113
app.set 'views', scriptdir + '/views/'

0 commit comments

Comments
 (0)