Giter Club home page Giter Club logo

noderize's Introduction

Noderize

Noderize lets you create Node apps in less than 30 seconds.

Documentation

It aims to get out of your way and not require any configuration until you need it, while supporting loads of features.

yarn create noderize <path>

or

npx create-noderize <path>

Visit our documentation for more information!

Inspired by create-react-app

Build Status

noderize's People

Contributors

ab320012 avatar chocolateboy avatar cretezy avatar sc0ttwad3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noderize's Issues

clean script is generating a ReferenceError: options is not defined

Does the clean script need to import options.js as well? It looks like it uses options.distDirectory and running it is giving a reference error, now:

λ yarn clean
yarn run v1.5.1
$ noderize-scripts clean
[INFO] Cleaning...
[ERROR] Error deleting files.
ReferenceError: options is not defined
    at Object._callee$ (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:1938:66)
    at tryCatch (c:\projects\typescript\second-noderize\node_modules\regenerator-runtime\runtime.js:62:40)
    at Generator.invoke [as _invoke] (c:\projects\typescript\second-noderize\node_modules\regenerator-runtime\runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (c:\projects\typescript\second-noderize\node_modules\regenerator-runtime\runtime.js:114:21)
    at step (c:\projects\typescript\second-noderize\node_modules\@babel\runtime\helpers\asyncToGenerator.js:12:30)
    at _next (c:\projects\typescript\second-noderize\node_modules\@babel\runtime\helpers\asyncToGenerator.js:27:9)
    at c:\projects\typescript\second-noderize\node_modules\@babel\runtime\helpers\asyncToGenerator.js:34:7
    at new Promise (<anonymous>)
    at new F (c:\projects\typescript\second-noderize\node_modules\core-js\library\modules\_export.js:35:28)
    at Object.<anonymous> (c:\projects\typescript\second-noderize\node_modules\@babel\runtime\helpers\asyncToGenerator.js:7:12)
    at Object.clean (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:1959:17)
    at Object.<anonymous> (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:1337:19)
    at __webpack_require__ (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:31:30)
    at Object.<anonymous> (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:1294:18)
    at __webpack_require__ (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:31:30)
    at module.exports (c:\projects\typescript\second-noderize\node_modules\@noderize\scripts\dist\index.js:74:18)
Done in 1.53s.

[Issue] Preserve Class names at runtime

Version: 0.7.1
I'm not familiar with webpack, but it seems that in v0.7.1 webpack minifys the scripts and removes the Classes name property.

In v0.7.0:

Class Foo{}
console.log(Foo.name); // output = "Foo"

In v0.7.1:

Class Foo{}
console.log(Foo.name); // output = "t"

typescript class at runtime

format script generating UnhandledPromiseRejectionWarning

New application created

c:\projects\typescript
λ yarn create noderize noderize-first
λ cd noderize-first\
λ yarn build

then running the format script yarn format is generating a warning. Looks like it's in @noderize\scripts\dist\index.js

c:\projects\typescript\noderize-first
λ yarn run format
yarn run v1.5.1
$ noderize-scripts format
[INFO] Formatting...
(node:43464) UnhandledPromiseRejectionWarning: ReferenceError: getOptions is not defined
    at Object._callee$ (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:1865:13)
    at tryCatch (c:\projects\typescript\noderize-first\node_modules\regenerator-runtime\runtime.js:62:40)
    at Generator.invoke [as _invoke] (c:\projects\typescript\noderize-first\node_modules\regenerator-runtime\runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (c:\projects\typescript\noderize-first\node_modules\regenerator-runtime\runtime.js:114:21)
    at step (c:\projects\typescript\noderize-first\node_modules\@babel\runtime\helpers\asyncToGenerator.js:12:30)
    at _next (c:\projects\typescript\noderize-first\node_modules\@babel\runtime\helpers\asyncToGenerator.js:27:9)
    at c:\projects\typescript\noderize-first\node_modules\@babel\runtime\helpers\asyncToGenerator.js:34:7
    at new Promise (<anonymous>)
    at new F (c:\projects\typescript\noderize-first\node_modules\core-js\library\modules\_export.js:35:28)
    at Object.<anonymous> (c:\projects\typescript\noderize-first\node_modules\@babel\runtime\helpers\asyncToGenerator.js:7:12)
    at Object.format (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:1893:17)
    at Object.<anonymous> (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:1337:19)
    at __webpack_require__ (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:31:30)
    at Object.<anonymous> (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:1294:18)
    at __webpack_require__ (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:31:30)
    at module.exports (c:\projects\typescript\noderize-first\node_modules\@noderize\scripts\dist\index.js:74:18)
(node:43464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:43464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 1.87s.

Other scripts are fine, and app runs correctly. Great Project, BTW!

New Logo

Hello designers!

We're looking for a new logo for Noderize.

The current one was someone meant as a placeholder. I made it in about 2 minutes in Inkscape, and I think Noderize deserves a better logo.

I like the current basic concept/idea of the logo, however anything is probably better at this point. Feel free to post any of your creations in this issue's comment 😄

running test with --ci

Hey thanks for the project 👍

Found a case when running on circle ci, where my tests fail but the process still exits with success code 0

I'm running yarn test --ci

Anyone else encountered this?

Error: Can not find jest

Hi, just try running npm run test and found this error:
Error: Cannot find module '/home/user/Documents/dev/test9/node_modules/@noderize/scripts/node_modules/.bin/jest'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

format and test scripts generate SyntaxErrors

Seems reproducible with any new noderize app create, even after successful build/watch, initially running...

yarn format generates a SyntaxError via @noderize\scripts\node_modules\.bin\prettier and args handling?
yarn test generates a SyntaxError via @noderize\scripts\node_modules\.bin\jest and args handling?

λ yarn format
yarn run v1.5.1
$ noderize-scripts format
[INFO] Formatting...
c:\projects\typescript\first-noderize\node_modules\@noderize\scripts\node_modules\.bin\prettier:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (module.js:613:28)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
[WARN] Done formatting!
Done in 1.67s.
λ yarn test
yarn run v1.5.1
$ noderize-scripts test
[INFO] Testing...
The system cannot find the path specified.
c:\projects\typescript\first-noderize\node_modules\@noderize\scripts\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (module.js:613:28)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
Done in 1.75s.

Typescript errors

OS: Ubuntu 18.04.
Node: v10.1.0
Using latest Noderizer

I get the following when i try to "npm run watch"

✔ success start › Exited gracefully!
ERROR in /home/benjamin/Development/NodeTs/NoderizerTest/node_modules/@types/node/index.d.ts(6208,55):
TS2304: Cannot find name 'Map'.
ERROR in /home/benjamin/Development/NodeTs/NoderizerTest/node_modules/@types/node/index.d.ts(6215,55):
TS2304: Cannot find name 'Set'.
ERROR in /home/benjamin/Development/NodeTs/NoderizerTest/node_modules/@types/node/index.d.ts(6219,64):
TS2304: Cannot find name 'Symbol'.
ERROR in /home/benjamin/Development/NodeTs/NoderizerTest/node_modules/@types/node/index.d.ts(6225,59):
TS2304: Cannot find name 'WeakMap'.
ERROR in /home/benjamin/Development/NodeTs/NoderizerTest/node_modules/@types/node/index.d.ts(6226,59):
TS2304: Cannot find name 'WeakSet'.
Version: typescript 2.8.3
Time: 4100ms

As i read about it it means i need to change the ES20** Version to ES 2015 or higher.
Can't really do that though without manipulating the main package afaik.

Add dotenv

I think dotenv should be shipped by default.

Yay or nah?

Get Started

Hi, I just followed your get started and have some issues.

$ yarn watch
yarn run v1.7.0
$ noderize-scripts watch
● start watch › Watching...

ℹ info watch › Building...

Hash: be7c613fd893f4d1b89b
Time: 781ms
Built at: 2018-05-24 15:20:19
Asset Size Chunks Chunk Names
index.js 2.17 KiB 0 index.js

  • 1 hidden asset
    Entrypoint index.js = index.js index.js.map

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in ./src/index.js
Module build failed: Error: [BABEL] /Apps/test2/src/index.js: The new decorators proposal is not supported yet. You must pass the "legacy": true option to @babel/plugin-proposal-decorators (While processing: "/Apps/test2/node_modules/@babel/plugin-proposal-decorators/lib/index.js")
at _default (/Apps/test2/node_modules/@babel/plugin-proposal-decorators/lib/index.js:44:11)
at /Apps/test2/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Apps/test2/node_modules/@babel/core/lib/config/full.js:163:14)
at cachedFunction (/Apps/test2/node_modules/@babel/core/lib/config/caching.js:42:19)
at loadPluginDescriptor (/Apps/test2/node_modules/@babel/core/lib/config/full.js:198:28)
at config.plugins.map.descriptor (/Apps/test2/node_modules/@babel/core/lib/config/full.js:64:16)
at Array.map ()
at recurseDescriptors (/Apps/test2/node_modules/@babel/core/lib/config/full.js:63:38)
at loadFullConfig (/Apps/test2/node_modules/@babel/core/lib/config/full.js:106:6)
at process.nextTick (/Apps/test2/node_modules/@babel/core/lib/transform.js:28:33)
@ multi ./src/index.js

● start start › Starting...

✖ error start › Start file does not exists.

Env test

Hello!
Thanks for create noderize. I really appreciated.

I just followed here:
https://noderize.js.org/docs/configuration-noderize.html#env

and typed:

$> yarn build --env test

UnhandledPromiseRejectionWarning: WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
configuration.mode should be one of these:
"development" | "production" | "none"
Enable production optimizations or development hints.

Am I missing something or we don't have test available?


My package.json

"noderize": {
		"env": {
			"test": {
				"debug": true
			},
			"production": {
				"sourcemap": false,
				"minify": true
			}
		}

Thanks

Cannot start.. :/

Hi!

Testing this out, but finding:

 ▲ ~/projects/Sandbox nvm use v9.11.1                                                                                                                                                                                                                       
Now using node v9.11.1 (npm v5.6.0)

 ▲ ~/projects/Sandbox npm i -g create-noderize
npm ERR! path USER/.nvm/versions/node/v9.11.1/lib/node_modules/create-noderize/dist/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'USER/.nvm/versions/node/v9.11.1/lib/node_modules/create-noderize/dist/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     USER/.npm/_logs/2018-05-17T19_17_25_498Z-debug.log

 △ ~/projects/Sandbox npx create-noderize ./test
npm ERR! path USER/.npm/_npx/52252/lib/node_modules/create-noderize/dist/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'USER/.npm/_npx/52252/lib/node_modules/create-noderize/dist/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     USER/.npm/_logs/2018-05-17T19_17_42_276Z-debug.log
Install for create-noderize@latest failed with code 254

NPM log:

581 verbose linkBins [email protected]
582 verbose linkBins [ { 'create-noderize': 'dist/index.js' },
582 verbose linkBins   'USER/.npm/_npx/52252/bin',
582 verbose linkBins   true ]
583 verbose linkMans [email protected]
584 verbose unlock done using USER/.npm/_locks/staging-eb87221c15db1e00.lock for USER/.npm/_npx/52252/lib/node_modules/.staging
585 verbose stack Error: ENOENT: no such file or directory, chmod 'USER/.npm/_npx/52252/lib/node_modules/create-noderize/dist/index.js'
586 verbose cwd USER/projects/Sandbox
587 verbose Darwin 16.7.0
588 verbose argv "USER/.nvm/versions/node/v9.11.1/bin/node" "USER/.nvm/versions/node/v9.11.1/lib/node_modules/npm/bin/npm-cli.js" "install" "create-noderize@latest" "--global" "--prefix" "USER/.npm/_npx/52252" "--loglevel" "error" "--json"
589 verbose node v9.11.1
590 verbose npm  v5.6.0
591 error path USER/.npm/_npx/52252/lib/node_modules/create-noderize/dist/index.js
592 error code ENOENT
593 error errno -2
594 error syscall chmod
595 error enoent ENOENT: no such file or directory, chmod 'USER/.npm/_npx/52252/lib/node_modules/create-noderize/dist/index.js'
596 error enoent This is related to npm not being able to find a file.
597 verbose exit [ -2, true ]

Tests fail with Babel plugin error

What version of Noderize and Node are you using?

Node v9.4.0
Noderize v0.5.0

What operating system are you using? Are you using any special setup?

macOS High Sierra

What did you do?

I created a new project with npx create-noderize and set "languages": "typescript" within the noderize config field in my package.json. I then created a test file under /src and ran npm run test, which gives me the following error:

The new decorators proposal is not supported yet. You must pass the `"legacy": true` 
option to @babel/plugin-proposal-decorators  (While processing: "/node_modules/
@babel/plugin-proposal-decorators/lib/index.js")

I also tried adding a babel config within the noderize config in package.json, setting the "legacy": true option for @babel/plugin-proposal-decorators as the error instructed, but that didn't have any effect.

What did you expect to see?

No errors

What did you see instead?

image

Move start command to runtime

The move command will be moved into the runtime package.

The start command currently runs a built version, with sourcemap (which is broken AFAIK). This makes the scripts package required on say Heroku, where scripts are only really needed to build.

This will make deployments fastest too.

Google Cloud Ignore Bug

Probably have to add !dist/index.js in the .gcloudignore for the Google Cloud Functions page.

Kill child processes on restart

When running in watch mode with an express app every time the server restarts it says there is already something being served on port x.

Which I assume means the previous process hasn't been completely killed yet? Anyone else encountered this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.