Release 2.0.4: NextJS + Typescript
Changelog
-
NextJS + Typescript (#132)
-
integrate newer version of @jam3/detect (2.0.5) and removed
src/utils/detect
After working with NextJS, @jam3/detect (1.0.0) was a bit troublesome due to NextJS build options; so had to adapt window type check. The @jam3/detect (2.0.0) now has a built-in window type check gracefully. Doing sosrc/utils/detect
is removed. As a result,detect
can be imported from the node module now and selectively imported as it needs.
import detect from '@jam3/detect';
import { os, browser, device } from '@jam3/detect';
- Absolute imports and Module path aliases (#69)
Now both relative import and absolute import with a prefix@
alias are available when importing local modules. Absolute importing would be a favourable feature when digging too many depths of folders.
// relative import
import ComponentName from '../../../components/ComponentName/ComponentName';
// absolute import
import ComponentName from '@/components/ComponentName/ComponentName';
- Improve Template scripts (#140)
Previously the template script was able to provide a single page/component creation per command and only a single depth. The newer version you can create a multiple page(s)/component(s) with a single command by just listing their name. In addition to that, the script will be able to create children page(s)/component(s) by adding a slash between names.
// create page(s)
npm run page [page-name 1] [page-name 2] ...
// create sub-page(s)
npm run page [parent page-name]/[child page-name]
// create api routes
npm run api [api-name 1] [api-name 2]
// create component(s)
npm run component [component-name 1] [component-name 2] ...
// create sub-component(s)
npm run component [parent component-name]/[child component-name]
- Enable NextJS Debugging reference