From 72c60aff7015e814225b6f62743e0136f9876b7d Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 13:42:08 +0530 Subject: [PATCH 01/10] Add files via upload --- active/0000-template.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 active/0000-template.md diff --git a/active/0000-template.md b/active/0000-template.md new file mode 100644 index 0000000..9a948f8 --- /dev/null +++ b/active/0000-template.md @@ -0,0 +1,16 @@ +- Start Date: 2017-4-23 + +# Summary + +It should be possible to specify addons in optionalDependencies in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. +The build need not fail asserting "missing dependency" if the dependency is specified in optionalDependencies. + +# Motivation + +For users who consume the node packages via private npm registry, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually used in production. +Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) on his device and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - 'missing dependecy') every time by everyone working on the project which is the real pain point. +So there could be an option to the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. +The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. +This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like npm install --no-optional, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests excluding the installed addons sepcifed in the blacklist to be merged with the consuming application's app tree. + +# Detailed design From fbdd59ebdc81153a51a292dfd13daee44a9f1adf Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 13:42:52 +0530 Subject: [PATCH 02/10] Update 0000-template.md --- active/0000-template.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/active/0000-template.md b/active/0000-template.md index 9a948f8..786effa 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -3,13 +3,17 @@ # Summary It should be possible to specify addons in optionalDependencies in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. + The build need not fail asserting "missing dependency" if the dependency is specified in optionalDependencies. # Motivation For users who consume the node packages via private npm registry, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually used in production. + Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) on his device and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - 'missing dependecy') every time by everyone working on the project which is the real pain point. + So there could be an option to the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. + The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like npm install --no-optional, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests excluding the installed addons sepcifed in the blacklist to be merged with the consuming application's app tree. From fe6e18c91e77e03f86c3aa63807b0224ae75b3b0 Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 16:59:45 +0530 Subject: [PATCH 03/10] Update 0000-template.md --- active/0000-template.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/active/0000-template.md b/active/0000-template.md index 786effa..33e8aab 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -2,19 +2,37 @@ # Summary -It should be possible to specify addons in optionalDependencies in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. - -The build need not fail asserting "missing dependency" if the dependency is specified in optionalDependencies. +It should be possible to specify addons in `optionalDependencies` in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. +The build need not fail asserting "missing dependency" if the dependency specified in optionalDependencies is missing/absent. # Motivation -For users who consume the node packages via private npm registry, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually used in production. +For users who consume the node packages via `private npm registry`, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually be used in production. +Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) every time by everyone working on the project which is the real pain point. +So there could be an option for the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. +The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. +This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests preventing the installed addons sepcifed in the `blacklist` array from merging with the consuming application's app tree. -Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) on his device and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - 'missing dependecy') every time by everyone working on the project which is the real pain point. +# Detailed design -So there could be an option to the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. +There could be an option in ember-cli-build.js so that the user can configure whether or not the ember-cli should lookup the optionalDependencies. -The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. -This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like npm install --no-optional, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests excluding the installed addons sepcifed in the blacklist to be merged with the consuming application's app tree. +```js +// ember-cli-build.js +module.exports = { + // ... + addons: { + optionalDependencies: { + development: true, + production: false + } + } +}; +``` +# How We Teach This -# Detailed design +The guides can mention this as a way to include addons in optionalDependencies, which the user can have a control over whether or not to include the addons specified here in the build processes(development/production). + +# Alternatives + +Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent it asserting `missing dependency` also making it available in the consuming application tree depending on the environmental needs(development/production). From ef5080a1ee3cf76bb8db6a0a7ad433ffd195c7be Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:00:32 +0530 Subject: [PATCH 04/10] Update 0000-template.md --- active/0000-template.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/active/0000-template.md b/active/0000-template.md index 33e8aab..f4a0542 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -3,13 +3,16 @@ # Summary It should be possible to specify addons in `optionalDependencies` in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. + The build need not fail asserting "missing dependency" if the dependency specified in optionalDependencies is missing/absent. # Motivation For users who consume the node packages via `private npm registry`, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually be used in production. + Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) every time by everyone working on the project which is the real pain point. So there could be an option for the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. + The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests preventing the installed addons sepcifed in the `blacklist` array from merging with the consuming application's app tree. From 1a6531759f92d14ba8afa23ff51906301d4338cc Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:01:00 +0530 Subject: [PATCH 05/10] Update 0000-template.md --- active/0000-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active/0000-template.md b/active/0000-template.md index f4a0542..7d44ba6 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -38,4 +38,4 @@ The guides can mention this as a way to include addons in optionalDependencies, # Alternatives -Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent it asserting `missing dependency` also making it available in the consuming application tree depending on the environmental needs(development/production). +Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent it asserting `missing dependency` also making it available in the consuming application tree depending on the environmental requirements.(development/production). From f96291c449c7ce7ff0bc74d05edc952b4af77b59 Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:07:27 +0530 Subject: [PATCH 06/10] Update 0000-template.md --- active/0000-template.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/active/0000-template.md b/active/0000-template.md index 7d44ba6..a450086 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -10,11 +10,13 @@ The build need not fail asserting "missing dependency" if the dependency specifi For users who consume the node packages via `private npm registry`, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually be used in production. -Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project. But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) every time by everyone working on the project which is the real pain point. +Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project for the `ember-cli` to consider it to be included in the consuming application. + +But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) every time by everyone working on the project which is the real pain point. + So there could be an option for the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. -The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional. -This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests preventing the installed addons sepcifed in the `blacklist` array from merging with the consuming application's app tree. +The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover only required for development purpose. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests preventing the installed addons sepcifed in the `blacklist` array from merging with the consuming application's app tree. # Detailed design From 7e53d77dadd08ef15596d2e32e661f002cb2ea57 Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:08:14 +0530 Subject: [PATCH 07/10] Update 0000-template.md --- active/0000-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active/0000-template.md b/active/0000-template.md index a450086..7ad5863 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -40,4 +40,4 @@ The guides can mention this as a way to include addons in optionalDependencies, # Alternatives -Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent it asserting `missing dependency` also making it available in the consuming application tree depending on the environmental requirements.(development/production). +Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent `ember-cli` asserting `missing dependency` also making it available in the consuming application tree depending on the environmental requirements.(development/production). From 760b9eecedbe75d9586fd6e0e1b6c5fb70bdc9c7 Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:13:29 +0530 Subject: [PATCH 08/10] Update 0000-template.md --- active/0000-template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/active/0000-template.md b/active/0000-template.md index 7ad5863..16a0363 100644 --- a/active/0000-template.md +++ b/active/0000-template.md @@ -10,13 +10,13 @@ The build need not fail asserting "missing dependency" if the dependency specifi For users who consume the node packages via `private npm registry`, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually be used in production. -Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but with a cost of making an entry in dependencies/devDependencies of package.json of the project for the `ember-cli` to consider it to be included in the consuming application. +Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but at a cost of making an entry in dependencies/devDependencies of package.json of the project for the `ember-cli` to consider it to be included in the consuming application. -But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) every time by everyone working on the project which is the real pain point. +But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) for every commit each one on the project makes which is the real pain point. So there could be an option for the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. -The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover only required for development purpose. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in ember-cli-build.js which suggests preventing the installed addons sepcifed in the `blacklist` array from merging with the consuming application's app tree. +The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover only required for development purpose. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in `ember-cli-build.js` which suggests preventing the installed addons sepcifed in the `blacklist` array from merging into the consuming application's app tree. # Detailed design @@ -36,7 +36,7 @@ module.exports = { ``` # How We Teach This -The guides can mention this as a way to include addons in optionalDependencies, which the user can have a control over whether or not to include the addons specified here in the build processes(development/production). +The guides can mention this as a way to include addons in optionalDependencies, which the user can have a control over whether or not to include the addons specified here in the build processes on various environments(development/production). # Alternatives From add63d83a90320be7cb53718714195ee81b758a1 Mon Sep 17 00:00:00 2001 From: Shravan Date: Sun, 23 Apr 2017 17:15:31 +0530 Subject: [PATCH 09/10] Rename 0000-template.md to 0000-addons-optionalDependencies.md --- active/{0000-template.md => 0000-addons-optionalDependencies.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename active/{0000-template.md => 0000-addons-optionalDependencies.md} (100%) diff --git a/active/0000-template.md b/active/0000-addons-optionalDependencies.md similarity index 100% rename from active/0000-template.md rename to active/0000-addons-optionalDependencies.md From 0f45f19871d890e107a852d3d0d337c2688a1e8a Mon Sep 17 00:00:00 2001 From: Sharavanaprasad Date: Fri, 30 Jun 2017 16:12:33 +0530 Subject: [PATCH 10/10] RFC for ember-cli to scan optionalDependencies --- active/0000-addons-optionalDependencies.md | 33 +++++----------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/active/0000-addons-optionalDependencies.md b/active/0000-addons-optionalDependencies.md index 16a0363..a237c03 100644 --- a/active/0000-addons-optionalDependencies.md +++ b/active/0000-addons-optionalDependencies.md @@ -2,42 +2,23 @@ # Summary -It should be possible to specify addons in `optionalDependencies` in package.json of an ember-cli project, and the ember-cli should scan optionalDependencies for addons while processing the build so that this addon tree will also be merged with the consuming application's app tree. +It should be possible to specify packages/addons in `optionalDependencies` of the `package.json` of an `ember-cli project`, and ember-cli should scan for packages/addons mentioned in optionalDependencies while processing the build so that such packages/addons could also be included into the consuming application. -The build need not fail asserting "missing dependency" if the dependency specified in optionalDependencies is missing/absent. +The build need not fail asserting "missing dependency" if any of the dependencies specified in optionalDependencies is missing/absent. # Motivation -For users who consume the node packages via `private npm registry`, it is a pain point to install the addons when some of it's nested dependencies is specified with a (https://..) repository URL rather than regular "name" : "version" format. Since the consuming npm registry is private, it might not be possible to make a hit to global npm registry overriding the proxy everytime, for the packages which will never actually be used in production. +In general, the current ember-cli build process will scan for the packages specified in the `dependencies` hash and `devDependencies hash` from the downloaded packages in the node_modules folder, discovers and then includes them into the consuming application. The build is designed to fail if any of the packages specified in these two dependencies hash is missing in the `node_modules` folder. But this procedure may not be sufficient for a variety of cases. -Somehow the developer can preinstall the package(so while running npm install, there will not be a network hit for this package since the package of the same version would already have been installed and available) under local node_modules of the project and use it for development to run tests etc., but at a cost of making an entry in dependencies/devDependencies of package.json of the project for the `ember-cli` to consider it to be included in the consuming application. - -But while taking it to production there is a manual intervention of removing this entry from package.json (otherwise the build is ought to fail, bcoz the package cannot be fetched by private registry resulting ember-cli to throw the assertion - `missing dependecy`) for every commit each one on the project makes which is the real pain point. - -So there could be an option for the developer to include the addons as optionalDependencies and convey ember-cli whether or not to lookup optionalDependencies while processing the build. - -The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover only required for development purpose. This way the developer could have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in `ember-cli-build.js` which suggests preventing the installed addons sepcifed in the `blacklist` array from merging into the consuming application's app tree. +So there could be an option for the developer to specify packages in optionalDependencies and ember-cli can lookup optionalDependencies while processing the build. The Build need not fail if there is any package specified in optionalDependencies is missing, since it is only optional and moreover may only be required for developmental purposes. This way the developer can have more control over the choice of packages he wishes to use for development and skip for production by giving appropriate commands like `npm install --no-optional`, thereby preventing the installation of packages itself rather than blacklisting in `ember-cli-build.js` which suggests preventing the installed addons sepcifed in the `blacklist` array from being included into the consuming application. # Detailed design +We can tweak ember-cli addon/package discovery process to lookup for optionalDependencies as well and if the package is missing, we can make ember-cli proceed the build without terminating. -There could be an option in ember-cli-build.js so that the user can configure whether or not the ember-cli should lookup the optionalDependencies. - -```js -// ember-cli-build.js -module.exports = { - // ... - addons: { - optionalDependencies: { - development: true, - production: false - } - } -}; -``` # How We Teach This -The guides can mention this as a way to include addons in optionalDependencies, which the user can have a control over whether or not to include the addons specified here in the build processes on various environments(development/production). +This functionality can simply be documented in ember-cli guides to teach. # Alternatives -Add a unified way for the developer to have a control over which dependencies he wants to include/exclude in the build process, to prevent `ember-cli` asserting `missing dependency` also making it available in the consuming application tree depending on the environmental requirements.(development/production). +None.