-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some post install messaging, scaffolding, and small QoL tweaks …
…to logging
- Loading branch information
1 parent
4b7faae
commit 21f4974
Showing
10 changed files
with
118 additions
and
37 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "vitreum", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "Web app build system using Browserify and React", | ||
"main": "lib/index.js", | ||
"repository": { | ||
|
@@ -13,7 +13,8 @@ | |
"setup_test_proj": "cd ../vitreum_test && npm init -y && node ../vitreum/scripts/install_proj_libs.js && npm link vitreum", | ||
"setup": "npm link && node scripts/install_peer_libs.js && npm run setup_test_proj", | ||
"test": "pico-check", | ||
"test:dev": "pico-check -w -b" | ||
"test:dev": "pico-check -w -b", | ||
"postinstall": "node utils/postinstall.js" | ||
}, | ||
"author": "Scott Tolksdorf <[email protected]> (https://github.com/stolksdorf)", | ||
"license": "MIT", | ||
|
@@ -23,7 +24,7 @@ | |
"homepage": "https://github.com/stolksdorf/vitreum", | ||
"dependencies": { | ||
"browserify": "^16.5.0", | ||
"fs-extra": "^9.0.0", | ||
"fs-extra": "^9.0.1", | ||
"livereload": "^0.9.1", | ||
"nodemon": "^2.0.2", | ||
"source-map-support": "^0.5.16", | ||
|
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 was deleted.
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
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,8 @@ | ||
const chalk = require('./chalk.js'); | ||
const pckg = require('../package.json'); | ||
const peerDeps = Object.keys(pckg.peerDependencies).join(' '); | ||
|
||
console.log(chalk.green('\nBe sure to install the needed peer dependencies:')); | ||
console.log(chalk.cyan(`npm install ${peerDeps}`)); | ||
|
||
console.log(`\nUse ${chalk.cyan(`node node_modules/vitreum/utils/scaffold.js`)} to quickly setup your project.`) |
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,75 @@ | ||
// Populates a project file with a vitreum setup | ||
|
||
|
||
|
||
|
||
//Create client.jsx /less | ||
//create scripts folder | ||
//bundle.script | ||
//build.script | ||
//simple.server.js | ||
|
||
//server | ||
//server.js + renderpage | ||
|
||
// add npm run scripts to package.json | ||
|
||
// console out the npm installs you need | ||
|
||
|
||
// | ||
|
||
|
||
const fse = require('fs-extra'); | ||
|
||
const root = process.cwd(); | ||
|
||
|
||
fse.outputFileSync(`${root}/src/main.jsx`, `require('./main.less'); | ||
const React = require('react'); | ||
const { Title } = require('vitreum/headtags'); | ||
function Main({ ...props }){ | ||
return <div className='Main'> | ||
<Title>Main Page</Title> | ||
<section> | ||
<div>Main Ready</div> | ||
</section> | ||
</div> | ||
}; | ||
module.exports = Main;`); | ||
console.log(`Created: ${root}/src/main.jsx`); | ||
|
||
fse.outputFileSync(`${root}/src/main.less`, `.Main { | ||
font-family: Roboto; | ||
}`); | ||
console.log(`Created: ${root}/src/main.jsx`); | ||
|
||
|
||
|
||
|
||
|
||
const bundleRecipe = fse.readFileSync(`${__dirname}/../recipes/embed.recipe.js`, 'utf8').replace(/\.\.\/\.\.\/vitreum/g, 'vitreum'); | ||
fse.outputFileSync(`${root}/scripts/bundle.script.js`, bundleRecipe); | ||
console.log(`Created: ${root}/scripts/bundle.script.js`); | ||
|
||
|
||
const buildRecipe = fse.readFileSync(`${__dirname}/../recipes/ssr.recipe.js`, 'utf8').replace(/\.\.\/\.\.\/vitreum/g, 'vitreum'); | ||
fse.outputFileSync(`${root}/scripts/build.script.js`, buildRecipe); | ||
console.log(`Created: ${root}/scripts/build.script.js`); | ||
|
||
|
||
fse.copySync(`${__dirname}/../recipes/server/server.js`, `${root}/server/server.js` ) | ||
console.log(`Created: ${root}/server/server.js`); | ||
|
||
|
||
const pckg = require(`${root}/package.json`); | ||
pckg.scripts.build = 'node scripts/bundle.script.js'; | ||
pckg.scripts.dev = 'node scripts/bundle.script.js --dev'; | ||
fse.outputJsonSync(`${root}/package.json`, pckg, {spaces : 2}); | ||
console.log('Updated package.json scripts'); | ||
|
||
|
||
require('./postinstall.js') |