-
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.
Merge pull request #1 from Sunny-fr/feat/addTemplates
Adding Templates
- Loading branch information
Showing
16 changed files
with
353 additions
and
33 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
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
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
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
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,66 @@ | ||
const config = require('../config') | ||
const {configExistAndValid} = require('../core/management') | ||
const Generate = require('../utils/Generate') | ||
const path = require('path') | ||
const fs = require('fs') | ||
const chalk = require('chalk') | ||
const execSync = require('child_process').execSync | ||
const showSuccess = require('../messages/success') | ||
|
||
|
||
function start() { | ||
configExistAndValid({config}) | ||
.then(chimpConfig => { | ||
let packagePath = path.dirname(require.resolve('./rollup/.chimp-cfg')); | ||
|
||
|
||
console.log('') | ||
console.log('') | ||
console.log(chalk.green(' Generating Files for Rollup + Sass Template... ')) | ||
console.log('') | ||
console.log('') | ||
|
||
|
||
new Generate({ | ||
templatePath: packagePath, | ||
targetPath: process.cwd(), | ||
chimpConfig | ||
}).build().then(() => { | ||
fs.unlinkSync(process.cwd() + '/.chimp-config') | ||
fs.renameSync('.chimp-cfg', '.chimp-config') | ||
|
||
console.log('') | ||
console.log('') | ||
console.log(chalk.green(' Installing dependencies ')) | ||
console.log(chalk.green(' running npm install for you ')) | ||
console.log(chalk.green(' ')) | ||
console.log(chalk.green(' please wait... ')) | ||
console.log('') | ||
console.log('') | ||
|
||
execSync('npm install',{stdio:[0,1,2]}) | ||
|
||
console.log('') | ||
console.log('') | ||
|
||
showSuccess() | ||
|
||
console.log('') | ||
console.log('') | ||
console.log(chalk.green(' You can now run again : chimp ')) | ||
console.log(chalk.green(' and choose the option of watching or deploying ')) | ||
console.log(chalk.green(' you recipe ! ')) | ||
console.log('') | ||
console.log('') | ||
|
||
|
||
|
||
}) | ||
}) | ||
.catch(e => { | ||
console.log('Main error') | ||
console.log(e) | ||
}) | ||
} | ||
|
||
start() |
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,18 @@ | ||
.DS_Store | ||
|
||
# IDE Files | ||
#------------------------- | ||
.idea* | ||
|
||
|
||
## Sublime Text cache files | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
*.sublime-workspace | ||
*.sublime-project | ||
package-lock.json | ||
|
||
build | ||
node_modules | ||
.chimp-cfg |
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,30 @@ | ||
{ | ||
"name": "{recipe-slug}", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "chimp", | ||
"chimp:watch": "chimp watch", | ||
"chimp:deploy": "chimp deploy", | ||
"rollup:bundle": "rollup -c ./rollup.config.js", | ||
"rollup:watch": "rollup -c ./rollup.config.js -w", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@babel/core": "^7.10.0", | ||
"animate.css": "^4.1.0", | ||
"rollup": "^2.6.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.2", | ||
"rollup-plugin-sass": "^1.2.2" | ||
}, | ||
"devDependencies": { | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-postcss": "^3.1.1", | ||
"rollup-plugin-terser": "^6.1.0" | ||
} | ||
} |
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,37 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import {terser} from 'rollup-plugin-terser' | ||
|
||
export default { | ||
input: './src/main.js', | ||
|
||
output: [ | ||
{ | ||
name: 'comlib', | ||
sourcemap: false, | ||
file: './build/bundle.js', | ||
format: 'umd', | ||
globals: { react: 'React' }, | ||
}, | ||
], | ||
|
||
plugins: [ | ||
peerDepsExternal(), | ||
postcss({ | ||
output: './build/bundle.css', | ||
extract: true, | ||
modules: true, | ||
use: ['sass'], | ||
minimize: true | ||
}), | ||
babel({ exclude: 'node_modules/**' }), | ||
resolve(), | ||
commonjs(), | ||
terser() | ||
], | ||
|
||
external: ['react', 'react-dom'], | ||
}; |
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,7 @@ | ||
import styles from './style.scss' | ||
|
||
function main() { | ||
console.log('hello world') | ||
} | ||
|
||
main() |
Empty file.
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 @@ | ||
const config = require('../config') | ||
const {configExistAndValid} = require('../core/management') | ||
const Generate = require('../utils/Generate') | ||
const path = require('path') | ||
const fs = require('fs') | ||
const chalk = require('chalk') | ||
|
||
function start() { | ||
configExistAndValid({config}) | ||
.then(chimpConfig => { | ||
let packagePath = path.dirname(require.resolve('./simple/.chimp-cfg')); | ||
|
||
|
||
console.log('') | ||
console.log('') | ||
console.log(chalk.green(' Generating Files for Simple Template... ')) | ||
console.log('') | ||
console.log('') | ||
|
||
|
||
new Generate({ | ||
templatePath: packagePath, | ||
targetPath: process.cwd(), | ||
chimpConfig | ||
}).build().then(() => { | ||
fs.unlinkSync(process.cwd() + '/.chimp-config') | ||
fs.renameSync('.chimp-cfg', '.chimp-config') | ||
|
||
console.log('') | ||
console.log('') | ||
console.log(chalk.green(' --- I T \' S D O N E ---' )) | ||
console.log(chalk.green(' happy coding !')) | ||
console.log(chalk.green('')) | ||
console.log(chalk.green(' You can now run again : chimp ')) | ||
console.log(chalk.green(' and choose the option of watching or deploying ')) | ||
console.log(chalk.green(' you recipe ! ')) | ||
console.log('') | ||
console.log('') | ||
}) | ||
}) | ||
.catch(e => { | ||
console.log('Main error') | ||
console.log(e) | ||
}) | ||
} | ||
|
||
start() |
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,18 @@ | ||
.DS_Store | ||
|
||
# IDE Files | ||
#------------------------- | ||
.idea* | ||
|
||
|
||
## Sublime Text cache files | ||
*.tmlanguage.cache | ||
*.tmPreferences.cache | ||
*.stTheme.cache | ||
*.sublime-workspace | ||
*.sublime-project | ||
package-lock.json | ||
|
||
build | ||
node_modules | ||
.chimp-cfg |
Empty file.
Empty file.
Oops, something went wrong.