# Upgrade Guide
# 0.13.0
This release greatly simplifies the specific inclusion of files in the app
and wood
folders. Instead of prefixing your includes with @wood-config/file
or @app-ui/file
, you will instead prefix them with @wood/config/file
or @app/ui/file
. This may seem superficial, but it means that we only have special cases for the wood
and app
folders, instead of special cases for every folder under each of them. This greatly simplifies the require logic behind the scenes, and means that you can now specifically require any file in the wood
and app
folders, not just ones with specifically-defined aliases.
Upgrade steps:
- Update
_moduleAliases
inpackage.json
:
"_moduleAliases": {
"@app": "./app",
"@wood": "./wood"
},
- Update
moduleNameMapper
injest.config.js
:
moduleNameMapper: {
'^@app(.*)$': '<rootDir>/app/$1',
'^@wood(.*)$': '<rootDir>/wood/$1',
},
- Update
settings.import/resolver.alias-array.map
in.eslintrc.js
:
map: [
['#api', [
resolve(__dirname, 'app/api'),
resolve(__dirname, 'wood/api'),
]],
['#config', [
resolve(__dirname, 'app/config'),
resolve(__dirname, 'wood/config'),
]],
['#features', [
resolve(__dirname, 'app/features'),
resolve(__dirname, 'wood/features'),
]],
['#lib', [
resolve(__dirname, 'app/lib'),
resolve(__dirname, 'wood/lib'),
]],
['#ui', [
resolve(__dirname, 'app/ui'),
resolve(__dirname, 'wood/ui'),
]],
['@app', resolve(__dirname, 'app')],
['@wood', resolve(__dirname, 'wood')],
],
- Update
_moduleAliases
inapp/package.json
:
"_moduleAliases": {
"@app": ".",
"@wood": "../wood/"
},
- Replace all instances of
@wood-root
with@wood
. - Replace all instances of
@app-root
with@app
. - Replace all instances of
@wood-
with@wood/
. - Replace all instances of
@app-
with@app/
.
# 0.12.0
This release is a significant change in the file layout of Nodewood. If you are upgrading from < 0.12.0 and do not perform these changes, your app will not work.
This release moves all files in api/src
to api
, lib/src
to lib
, and ui/src
to ui
to better match how the rest of the framework is structured. These files were originally in separate root folders, but were all moved under the wood
folder a while back and should properly have had their src
folder removed at that time.
But as they say, the best time to plant a tree is twenty years ago, and the second-best time is now.
Upgrade steps:
- Move all code from your
app/api/src
folder to theapp/api
folder. - Move all code from your
app/lib/src
folder to theapp/lib
folder. - Move all code from your
app/ui/src
folder to theapp/ui
folder. - Update
.eslintrc.js
to remove the/src
suffix for all entries. - Update
jest.config.js
to change all instances ofsrc/$1
to$1
. - Update
package.json
to remove thesrc
suffix for all entries in_moduleAliases
. - Update
package.json
to changemain
to"app/api/api.js"
. - Update
package.json
to changescripts.dev-api-only
to"cd app/api && NODE_ENV=development nodemon --watch . --watch ../config --watch ../features --watch ../../wood -L ./api.js | npx pino-pretty"
- Update
app/package.json
to remove thesrc
suffix for all entries in_moduleAliases
. - Update
app/api/api.js
and change thestartServer
line toconst { startServer } = require('../../wood/api/api.js');
. - Update `app/
- Update any other custom code you have added that refers to
api/src
,lib/src
, orui/src
. - Update any other custom code you have added to the
api
,lib
, orui
folders that access files from other folders using relative paths (i.e. if you have a sequence of../../../
, etc).
If you experience into any issues, please contact support at hello@nodewood.com.