Skip to content

Commit 7ea6325

Browse files
Merge pull request #1 from VoloshchenkoAl/develop
Merge develop into master
2 parents 19d5e00 + f87e6a2 commit 7ea6325

File tree

8 files changed

+112
-64
lines changed

8 files changed

+112
-64
lines changed

.github/workflows/npm-publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish npm package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
needs: check
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm publish
17+
env:
18+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

License.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The MIT License
2+
3+
Copyright 2020 Aleksandr Voloshchenko, contributors
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Create TS Web App
2+
3+
Command line tool to help you create web app with TypeScript support
4+
5+
## Quick Overview
6+
7+
```sh
8+
npx create-ts-web-app my-app
9+
cd my-app
10+
npm start
11+
```
12+
13+
Then open your browser with url `http://localhost:8080/` to see your app
14+
15+
For production build use command `npm run build`

bin/index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,24 @@ let projectName;
1212
program
1313
.version(packageJson.version)
1414
.arguments('<project-directory>')
15-
.action(name => {
15+
.action((name) => {
1616
projectName = name;
1717
})
1818
.parse(process.arg);
1919

2020
createApp({ name: projectName });
2121

22-
2322
function createApp({ name }) {
2423
console.log('Installing...');
2524

2625
const root = path.resolve(name);
2726
const templateDirPath = path.resolve(__dirname, '../', 'template');
2827
fs.ensureDirSync(root);
2928
fs.copySync(templateDirPath, root);
30-
fs.writeFileSync(
31-
path.join(root, 'package.json'),
32-
updatePackageJson()
33-
);
29+
fs.writeFileSync(path.join(root, 'package.json'), updatePackageJson());
3430
install({ cwd: root });
31+
32+
console.log('Done');
3533
}
3634

3735
function updatePackageJson() {
@@ -43,4 +41,4 @@ function updatePackageJson() {
4341

4442
function install({ cwd }) {
4543
spawnSync('npm', ['install'], { cwd });
46-
}
44+
}

package.json

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
{
2-
"name": "create-ts-web-app",
3-
"version": "0.0.1",
4-
"description": "Create base template for ts web app",
5-
"license": "MIT",
6-
"bin": {
7-
"create-ts-web-app": "./bin/index.js"
8-
},
9-
"author": "Aleksandr Voloshchenko <[email protected]>",
10-
"dependencies": {
11-
"commander": "^5.0.0",
12-
"fs-extra": "^9.0.0"
13-
}
2+
"name": "create-ts-web-app",
3+
"version": "0.0.2",
4+
"description": "Create web app with typescript support",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/VoloshchenkoAl/create-ts-web-app.git"
8+
},
9+
"license": "MIT",
10+
"bin": {
11+
"create-ts-web-app": "./bin/index.js"
12+
},
13+
"author": "Aleksandr Voloshchenko <[email protected]>",
14+
"dependencies": {
15+
"commander": "^5.0.0",
16+
"fs-extra": "^9.0.0"
17+
},
18+
"files": [
19+
"bin",
20+
"template"
21+
],
22+
"bugs": {
23+
"url": "https://github.com/VoloshchenkoAl/create-ts-web-app/issues"
24+
},
25+
"keywords": [
26+
"typescript",
27+
"create-web-app"
28+
]
1429
}

template/package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "create-ts-web-app",
3-
"version": "1.0.0",
4-
"description": "",
5-
"private": true,
6-
"scripts": {
7-
"build": "webpack --config webpack.prod.config.js",
8-
"start": "webpack-dev-server --open"
9-
},
10-
"keywords": [],
11-
"author": "",
12-
"license": "ISC",
13-
"devDependencies": {
14-
"clean-webpack-plugin": "^3.0.0",
15-
"css-loader": "^3.5.2",
16-
"html-webpack-plugin": "^4.2.0",
17-
"mini-css-extract-plugin": "^0.9.0",
18-
"sass": "^1.26.3",
19-
"sass-loader": "^8.0.2",
20-
"style-loader": "^1.1.3",
21-
"ts-loader": "^7.0.0",
22-
"typescript": "^3.8.3",
23-
"webpack": "^4.42.1",
24-
"webpack-cli": "^3.3.11",
25-
"webpack-dev-server": "^3.10.3"
26-
}
2+
"name": "create-ts-web-app",
3+
"version": "1.0.0",
4+
"description": "",
5+
"private": true,
6+
"scripts": {
7+
"build": "webpack --config webpack.prod.config.js",
8+
"start": "webpack-dev-server --open"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"clean-webpack-plugin": "^3.0.0",
15+
"css-loader": "^3.6.0",
16+
"html-webpack-plugin": "^4.5.0",
17+
"mini-css-extract-plugin": "^1.0.0",
18+
"sass": "^1.27.0",
19+
"sass-loader": "^8.0.2",
20+
"style-loader": "^1.3.0",
21+
"ts-loader": "^8.0.5",
22+
"typescript": "^4.0.3",
23+
"webpack": "^4.44.2",
24+
"webpack-cli": "^3.3.12",
25+
"webpack-dev-server": "^3.11.0"
26+
}
2727
}

template/webpack.config.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,22 @@ module.exports = {
1818
},
1919
{
2020
test: /\.s[ac]ss$/,
21-
use: [
22-
'style-loader',
23-
'css-loader',
24-
'sass-loader',
25-
]
26-
}
27-
]
21+
use: ['style-loader', 'css-loader', 'sass-loader'],
22+
},
23+
],
2824
},
2925
devServer: {
3026
contentBase: path.join(__dirname, 'src'),
3127
hot: true,
28+
port: 8080,
3229
},
3330
resolve: {
3431
extensions: ['.ts', '.js', '.json'],
35-
modules: ['node_modules']
32+
modules: ['node_modules'],
3633
},
3734
plugins: [
3835
new HtmlWebpackPlugin({
39-
template: path.join(__dirname, 'public', 'index.html')
36+
template: path.join(__dirname, 'public', 'index.html'),
4037
}),
41-
]
38+
],
4239
};

template/webpack.prod.config.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,21 @@ module.exports = {
1919
},
2020
{
2121
test: /\.s[ac]ss$/,
22-
use: [
23-
MiniCssExtractPlugin.loader,
24-
'css-loader',
25-
'sass-loader',
26-
]
27-
}
28-
]
22+
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
23+
},
24+
],
2925
},
3026
resolve: {
3127
extensions: ['.ts', '.js', '.json'],
32-
modules: ['node_modules']
28+
modules: ['node_modules'],
3329
},
3430
plugins: [
3531
new CleanWebpackPlugin(),
3632
new MiniCssExtractPlugin({
3733
filename: '[name].[hash].css',
3834
}),
3935
new HtmlWebpackPlugin({
40-
template: path.join(__dirname, 'public', 'index.html')
36+
template: path.join(__dirname, 'public', 'index.html'),
4137
}),
42-
]
38+
],
4339
};

0 commit comments

Comments
 (0)