Skip to content

Commit

Permalink
[feature] remove cli-ts & update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
oychao committed Feb 26, 2019
1 parent 1a34f4d commit 4e1131b
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 193 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ index.js
package-lock.json
rollup.config.js
yarn*
templates
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"files": [
"LICENSE.md",
"README.md",
"bin/",
"templates/"
"bin/"
],
"devDependencies": {
"babel-eslint": "^8.2.6",
Expand Down
57 changes: 25 additions & 32 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
import shebang from 'rollup-plugin-shebang';
import json from 'rollup-plugin-json';

export default [
{
input: './index.js',
output: [
{
file: 'bin/bundle.js',
format: 'cjs'
}
],
plugins: [
shebang({
shebang: '#!/usr/bin/env node'
}),
json({
preferConst: true,
indent: ' '
})
],
external: [
'fs',
'path',
'chalk',
'commander',
'mkdirp',
'ora',
'promise-jsonfile',
'readline-sync',
'shelljs'
]
}
];
export default [{
input: './index.js',
output: [{
banner: '#!/usr/bin/env node',
file: 'bin/bundle.js',
format: 'cjs'
}],
plugins: [
json({
preferConst: true,
indent: ' '
})
],
external: [
'fs',
'path',
'chalk',
'commander',
'mkdirp',
'ora',
'promise-jsonfile',
'readline-sync',
'shelljs'
]
}];
18 changes: 0 additions & 18 deletions templates/cli-ts/.babelrc

This file was deleted.

4 changes: 0 additions & 4 deletions templates/cli-ts/.travis.yml

This file was deleted.

11 changes: 0 additions & 11 deletions templates/cli-ts/npmignore

This file was deleted.

58 changes: 0 additions & 58 deletions templates/cli-ts/pkg.json

This file was deleted.

33 changes: 0 additions & 33 deletions templates/cli-ts/rollup.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions templates/cli-ts/src/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions templates/cli-ts/src/main.ts

This file was deleted.

11 changes: 0 additions & 11 deletions templates/cli-ts/tsconfig.json

This file was deleted.

7 changes: 3 additions & 4 deletions templates/cli/pkg.json → templates/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cli-demo",
"version": "1.0.0",
"main": "./bin/bundle.js",
"main": "./bin/index.js",
"author": {
"name": "your name",
"email": "your@email.com"
Expand All @@ -13,7 +13,7 @@
"files": ["LICENSE.md", "README.md", "bin/"],
"preferGlobal": true,
"bin": {
"helloworld": "./bin/bundle.js"
"helloworld": "./bin/index.js"
},
"watch": {
"build": {
Expand Down Expand Up @@ -59,10 +59,9 @@
"mocha": "^6.0.0",
"mocha-sinon": "^2.1.0",
"npm-watch": "^0.6.0",
"rollup": "^1.2.2",
"rollup": "^1.3.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-shebang": "^0.1.5",
"sinon": "^7.2.4"
},
"dependencies": {
Expand Down
19 changes: 7 additions & 12 deletions templates/cli/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import babel from 'rollup-plugin-babel';
import shebang from 'rollup-plugin-shebang';
import json from 'rollup-plugin-json';

export default {
export default [{
input: './index.js',
output: [
{
file: 'bin/bundle.js',
format: 'cjs'
}
],
output: [{
banner: '#!/usr/bin/env node',
file: 'bin/bundle.js',
format: 'cjs'
}],
plugins: [
babel({
exclude: 'node_modules/**',
externalHelpers: true,
plugins: ['@babel/external-helpers']
}),
shebang({
shebang: '#!/usr/bin/env node'
}),
json({
preferConst: true,
indent: ' '
Expand All @@ -34,4 +29,4 @@ export default {
'promise-jsonfile',
'shelljs'
]
};
}];
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4e1131b

Please sign in to comment.