Skip to content

Commit

Permalink
Merge pull request #1178 from kethinov/0.20.0
Browse files Browse the repository at this point in the history
0.20.0
  • Loading branch information
kethinov authored Jul 21, 2022
2 parents 17ce0b8 + 604b948 commit f91a138
Show file tree
Hide file tree
Showing 32 changed files with 151 additions and 136 deletions.
14 changes: 7 additions & 7 deletions .vscode/roosevelt.code-snippets
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
Expand All @@ -22,7 +22,7 @@
"body": [
"it('$1', function (done) {",
"\tgenerateTestApp({",
"\t\tgenerateFolderStructure: true,",
"\t\tmakeBuildArtifacts: true,",
"\t\tappDir: appDir,",
"\t\t$3",
"\t}, options)",
Expand All @@ -49,4 +49,4 @@
"body": "testApp.stdout.on('data', (results) => {$1})",
"description": "stdout event scaffold for roosevelt test suite"
}
}
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- Put your changes here...

## 0.20.0

- Renamed `generateFolderStructure` to `makeBuildArtifacts`.
- Removed `checkDependencies`.

## 0.19.14

- Fixed bug that required admin permissions to start an app in Windows.
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# How to contribute to Roosevelt

## Manual testing

- Create a Roosevelt sample app using generator-roosevelt or mkroosevelt.
- Link your sample app's dependency to your local clone of Roosevelt in your sample app's package.json dependency list.

## Before opening a pull request

- Be sure all tests pass: `npm t`.
- Ensure 100% code coverage and write new tests if necessary: `npm run coverage`.
- Add your changes to `CHANGELOG.md`.
- If the changes are breaking, add a new documentation history entry to the bottom of the README.

## Release process

Expand All @@ -17,3 +23,4 @@ If you are a maintainer of Roosevelt, please follow the following release proced
- Open and merge a pull request with those changes.
- Tag the merge commit as the a new release version number.
- Publish commit to npm.
- Publish new generator-roosevelt and mkroosevelt versions too if necessary.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ To do that:

```javascript
require('roosevelt')({
'generateFolderStructure': true
'makeBuildArtifacts': true
}).startServer()
```

- Then `node app.js`. If the `generateFolderStructure` parameter is set to true like the above code example, an entire Roosevelt app with bare minimum viability will be created and the server will be started. See below for more information about parameter configuration.
- Then `node app.js`. If the `makeBuildArtifacts` parameter is set to true like the above code example, an entire Roosevelt app with bare minimum viability will be created and the server will be started. See below for more information about parameter configuration.

## Available npm scripts

Expand Down Expand Up @@ -222,7 +222,7 @@ const schema = {
}
}
require('roosevelt')({
'generateFolderStructure': true
'makeBuildArtifacts': true
}, schema).startServer()
```

Expand Down Expand Up @@ -325,7 +325,7 @@ Resolves to:

- Default: *[Boolean]* `true`.

- `generateFolderStructure`: When enabled Roosevelt will generate user specified directories (e.g. MVC parameters and statics parameters).
- `makeBuildArtifacts`: When enabled Roosevelt will generate user specified directories (e.g. MVC parameters and statics parameters).

- Default: *[Boolean]* `false`.

Expand Down Expand Up @@ -1235,6 +1235,7 @@ Note: When a custom preprocessor is defined in this way it will override the sel
# Documentation for previous versions of Roosevelt
- *[0.19.x](https://github.com/rooseveltframework/roosevelt/blob/aa10ea86f986f624bef56aa2f02ade5b6c551e13/README.md)*
- *[0.18.x](https://github.com/rooseveltframework/roosevelt/blob/3bdd5146b468c4c6ccfa0b76b0f94f19f0b4fa19/README.md)*
- *[0.17.x](https://github.com/rooseveltframework/roosevelt/blob/18eae61db07704e5cbf02cbb4e0a998f7e34fa2c/README.md)*
- *[0.16.x](https://github.com/rooseveltframework/roosevelt/blob/b33046c0281084a2dc0cde26dc38c2a538484c57/README.md)*
Expand Down
2 changes: 1 addition & 1 deletion lib/defaults/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"port": 43711,
"mode": "production",
"enableCLIFlags": true,
"generateFolderStructure": false,
"makeBuildArtifacts": false,
"localhostOnly": false,
"logging": {
"methods": {
Expand Down
4 changes: 3 additions & 1 deletion lib/generateSymlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = app => {
fsr.ensureDirSync(params.staticsRoot)

// process symlinks
if (params.generateFolderStructure) {
if (params.makeBuildArtifacts) {
for (const symlink of params.symlinks) {
// append appDir to each path that is relative
const source = path.isAbsolute(symlink.source) ? symlink.source : path.join(app.get('appDir'), symlink.source)
Expand All @@ -35,5 +35,7 @@ module.exports = app => {
logger.error(`Symlink source "${source}" does not exist. Skipping symlink creation.`)
}
}
} else {
logger.log('💡', `${appName} will not generate build artifacts like symlinks, compiled/bundled CSS/JS files, etc because the makeBuildArtifacts parameter is set to false. See Roosevelt API docs for more information about the makeBuildArtifacts parameter.`)
}
}
2 changes: 1 addition & 1 deletion lib/jsBundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = (app, callback) => {
const promises = []

// use existence of bundles array members to determine if bundler is enabled
if (!params.js.webpack.bundles.length || !params.generateFolderStructure) {
if (!params.js.webpack.bundles.length || !params.makeBuildArtifacts) {
callback()
return
}
Expand Down
4 changes: 2 additions & 2 deletions lib/preprocessCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = (app, callback) => {
let versionCode = '/* do not edit; generated automatically by Roosevelt */ '
const gitignoreFiles = gitignoreScanner(path.join(app.get('appDir'), '.gitignore'))

// skip compiling if feature is disabled or generateFolderStructure is false
if (params.css.compiler === 'none' || params.css.compiler === null || !params.css.compiler.enable || !params.generateFolderStructure) {
// skip compiling if feature is disabled or makeBuildArtifacts is false
if (params.css.compiler === 'none' || params.css.compiler === null || !params.css.compiler.enable || !params.makeBuildArtifacts) {
callback()
return
}
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/configAuditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function configAudit (appDir) {
case 'favicon':
checkTypes(userParam, key, ['null', 'string'])
break
case 'generateFolderStructure':
case 'makeBuildArtifacts':
checkTypes(userParam, key, ['boolean'])
break
case 'https': {
Expand Down
4 changes: 2 additions & 2 deletions lib/sourceParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ module.exports = (params, app, appSchema) => {
enableCLIFlags: {
default: defaults.enableCLIFlags
},
generateFolderStructure: {
default: defaults.generateFolderStructure
makeBuildArtifacts: {
default: defaults.makeBuildArtifacts
},
localhostOnly: {
default: defaults.localhostOnly
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/fsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FSR {
this.generate = true

if (app) {
this.generate = app.get('params').generateFolderStructure
this.generate = app.get('params').makeBuildArtifacts
this.logger = app.get('logger')
this.appName = app.get('appName')
} else {
Expand Down
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/rooseveltframework/roosevelt/graphs/contributors"
}
],
"version": "0.19.14",
"version": "0.20.0",
"files": [
"defaultErrorPages",
"lib",
Expand Down
4 changes: 2 additions & 2 deletions roosevelt.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ module.exports = (params, schema) => {
function startupCallback (proto, port) {
return async function () {
function finalMessages () {
logger.info('🎧', `${appName} ${proto.trim()} server listening on port ${port} (${appEnv} mode)`.bold)
logger.info('🎧', `${appName} ${proto} server listening on port ${port} (${appEnv} mode) ➡️ ${proto.toLowerCase()}://localhost:${port}`.bold)
if (params.localhostOnly) {
logger.warn(`${appName} will only respond to requests coming from localhost. If you wish to override this behavior and have it respond to requests coming from outside of localhost, then set "localhostOnly" to false. See the Roosevelt documentation for more information: https://github.com/rooseveltframework/roosevelt`)
}
Expand All @@ -408,7 +408,7 @@ module.exports = (params, schema) => {

// spin up the reload server
await reloadServer.startWebSocketServer()
logger.log('🎧', `Frontend reload ${proto} server is listening on port ${proto === 'HTTP' ? config.port : config.httpsPort}`.bold)
logger.log('🎧', `${appName} frontend reload ${proto} server is listening on port ${proto === 'HTTP' ? config.port : config.httpsPort}`)
finalMessages()
} catch (e) {
logger.error(e)
Expand Down
2 changes: 1 addition & 1 deletion test/bodyParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('body-parser', () => {
before(done => {
// spin up the roosevelt app
roosevelt({
generateFolderStructure: false,
makeBuildArtifacts: false,
port: 40000,
logging: {
methods: {
Expand Down
2 changes: 1 addition & 1 deletion test/configAuditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('config auditor', () => {
method: 'initServer',
config: {
mode: 'development',
generateFolderStructure: false
makeBuildArtifacts: false
}
})

Expand Down
2 changes: 1 addition & 1 deletion test/cssCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('css preprocessors', () => {
enable: false
},
appDir,
generateFolderStructure: true
makeBuildArtifacts: true
}
const file1 = `
body {
Expand Down
Loading

0 comments on commit f91a138

Please sign in to comment.