Skip to content

Commit

Permalink
0.19.5
Browse files Browse the repository at this point in the history
- Fix for Node 15 / npm 7 regression. Config auditor and deprecation checker will no longer run as postinstall scripts to compensate for INIT_CWD being removed from npm. These checks will be run exclusively on application first run instead (or any time the public folder is removed). (Closes rooseveltframework#975)
- Various dependencies updated.
  • Loading branch information
kethinov committed Nov 13, 2020
1 parent e038629 commit f9accac
Show file tree
Hide file tree
Showing 6 changed files with 599 additions and 272 deletions.
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.19.5

- Fix for Node 15 / npm 7 regression. Config auditor and deprecation checker will no longer run as postinstall scripts to compensate for INIT_CWD being removed from npm. These checks will be run exclusively on application first run instead (or any time the public folder is removed). (Closes https://github.com/rooseveltframework/roosevelt/issues/975)
- Various dependencies updated.

## 0.19.4

- Fixed bug that caused Roosevelt to not listen to `NODE_ENV`.
Expand Down
6 changes: 1 addition & 5 deletions lib/scripts/configAuditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ function configAudit (appDir) {
let errors
let processEnv
if (!appDir) {
if (process.env.INIT_CWD === process.cwd()) {
processEnv = process.env.INIT_CWD
} else if (fs.existsSync(path.join(process.cwd(), 'node_modules')) === false) {
if (fs.existsSync(path.join(process.cwd(), 'node_modules')) === false) {
processEnv = process.cwd()
} else if (fs.existsSync(path.join(process.env.INIT_CWD, 'node_modules')) === true) {
processEnv = process.env.INIT_CWD
} else {
processEnv = undefined
}
Expand Down
14 changes: 11 additions & 3 deletions lib/scripts/deprecationCheck.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
(function () {
module.exports = function (appDir) {
const Logger = require('roosevelt-logger')
const logger = new Logger()
const path = require('path')
const fs = require('fs')

try {
const { dependencies } = require(path.join(process.env.INIT_CWD, 'package.json'))
if (!appDir) {
if (fs.existsSync(path.join(process.cwd(), 'node_modules')) === false) {
appDir = process.cwd()
} else {
return
}
}
const { dependencies } = require(path.join(appDir, 'package.json'))

if (dependencies['roosevelt-less']) {
logger.warn('Deprecated module roosevelt-less detected. The functionality it offered is now provided direcly by the less module. See https://github.com/rooseveltframework/roosevelt#configure-your-app-with-parameters for information on how to update your configuration.'.bold.red)
Expand All @@ -22,4 +30,4 @@
logger.warn('Deprecated module roosevelt-uglify detected. The functionality it offered is now provided by Roosevelt via webpack. See https://github.com/rooseveltframework/roosevelt#configure-your-app-with-parameters for information on how to update your configuration.'.bold.red)
}
} catch {}
})()
}
Loading

0 comments on commit f9accac

Please sign in to comment.