-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cc86898
Showing
31 changed files
with
859 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Jelmer Cormont | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Create Typescene Web App | ||
|
||
Create front end applications with the Typescene framework, using the command line (CLI). | ||
|
||
## Getting Started | ||
|
||
You'll need to have NodeJS installed on your computer, but you do **not** need to install anything else. | ||
|
||
To create a new app in a folder named `my-webapp`, run the following command in the Terminal (Mac) or Command Prompt (Windows): | ||
|
||
```bash | ||
npx create-typescene-webapp my-webapp | ||
``` | ||
|
||
This will create a folder *inside* the current folder, copy source files, and install packages using NPM. | ||
|
||
After installation, run the following commands to start a development server and open your default browser: | ||
|
||
```bash | ||
cd my-webapp | ||
npm run start | ||
``` | ||
|
||
## Options | ||
|
||
You may use the following command line arguments to configure the installation. | ||
|
||
| Argument | Effect | | ||
|-----------------|-------------| | ||
| `--js` | Use JS (ES6) only, instead of TypeScript | | ||
| `--git` | Initialize a Git repository | | ||
| `--bundler=`... | Use a specific bundler (either `webpack` or `parcel`) | | ||
| `--overwrite` | Force overwrite existing files | | ||
|
||
## Reach Out! | ||
|
||
Find us on [Twitter](https://twitter.com/typescene) for the latest news, and please consider giving us a ⭐️ star on [GitHub](https://github.com/typescene/typescene)! | ||
|
||
## Support | ||
|
||
Support Typescene on [Patreon](https://www.patreon.com/typescene) for financial contributions. | ||
|
||
For contributions in the form of bug fixes and changes, feel free to use [Pull Requests](https://github.com/typescene/typescene/pulls) or send us a DM on Twitter to discuss how best to approach your issue. | ||
|
||
## License | ||
|
||
The Typescene source code is licensed under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
require("../dist/index.js") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "create-typescene-app", | ||
"version": "1.0.0", | ||
"description": "Generator for apps using the Typescene framework", | ||
"author": "Jelmer Cormont", | ||
"license": "MIT", | ||
"keywords": [ | ||
"typescene", | ||
"generator", | ||
"cli" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/typescene/create-typescene-webapp.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/typescene/create-typescene-webapp/issues" | ||
}, | ||
"homepage": "http://typescene.dev/", | ||
"main": "./dist/index.js", | ||
"bin": "bin/create-typescene-webapp", | ||
"files": [ | ||
"bin", | ||
"index.js" | ||
], | ||
"scripts": { | ||
"clean": "rimraf dist", | ||
"prepublishOnly": "npm run build", | ||
"prebuild": "npm run clean", | ||
"build": "tsc -p src" | ||
}, | ||
"dependencies": { | ||
"chalk": "^2.4.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^12.6.6", | ||
"typescript": "^3.5.3", | ||
"rimraf": "^2.6.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as path from "path"; | ||
|
||
const hasFlag = (...str: string[]) => | ||
str.some(flag => process.argv.some(s => s === flag)); | ||
|
||
const getOption = (name: string) => | ||
(process.argv.find(s => s.startsWith(name + "=")) || "") | ||
.replace(/^.*\=/, ""); | ||
|
||
const folder = process.argv.slice(2).find(s => s[0] !== "-") || ""; | ||
const fullFolder = folder && path.resolve(folder); | ||
const name = folder && path.basename(fullFolder); | ||
|
||
const config = { | ||
/** Project name */ | ||
name, | ||
|
||
/** Folder name */ | ||
folder, | ||
|
||
/** Absolute folder name */ | ||
fullFolder, | ||
|
||
/** Force overwrite */ | ||
overwrite: hasFlag("--overwrite"), | ||
|
||
/** Git init? */ | ||
git: hasFlag("-g", "--git"), | ||
|
||
/** Use TypeScript? */ | ||
ts: !hasFlag("-j", "--js"), | ||
|
||
/** Bundler (defaults to webpack) */ | ||
bundler: (getOption("--bundler") || getOption("-b") || | ||
"webpack").toLowerCase() | ||
} | ||
|
||
export default config; |
Oops, something went wrong.