From a7ab1e8724b2d8b0b1b6c2cdb815596f351599d2 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 --- text/0000-template.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 text/0000-template.md diff --git a/text/0000-template.md b/text/0000-template.md new file mode 100644 index 00000000000..9a948f8e85c --- /dev/null +++ b/text/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 5de6b14865045d01a915e3aa9e86c5af0b8ac338 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 --- text/0000-template.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/text/0000-template.md b/text/0000-template.md index 9a948f8e85c..786effa21ec 100644 --- a/text/0000-template.md +++ b/text/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 07659f4d0d2a87769030fc9a5bf4387fe1d2512a 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 --- text/0000-template.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/text/0000-template.md b/text/0000-template.md index 786effa21ec..33e8aabd5e6 100644 --- a/text/0000-template.md +++ b/text/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 890188909b003218dac1ef9d0f1b23b474ebf372 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 --- text/0000-template.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/text/0000-template.md b/text/0000-template.md index 33e8aabd5e6..f4a0542b439 100644 --- a/text/0000-template.md +++ b/text/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 1376c318f0f21298457f88d2ea1514d4a8abbf20 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 --- text/0000-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-template.md b/text/0000-template.md index f4a0542b439..7d44ba6fa06 100644 --- a/text/0000-template.md +++ b/text/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 15a846bdaed3382162ab339c5b39468e3fe3bf09 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 --- text/0000-template.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/text/0000-template.md b/text/0000-template.md index 7d44ba6fa06..a450086e046 100644 --- a/text/0000-template.md +++ b/text/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 d8fb1589f2f7f7cad893a5f5ce9a577be15cc7f8 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 --- text/0000-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-template.md b/text/0000-template.md index a450086e046..7ad5863daa6 100644 --- a/text/0000-template.md +++ b/text/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 00e49907bb0855b6ac8e192b089d76c9fe38d283 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 --- text/0000-template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/text/0000-template.md b/text/0000-template.md index 7ad5863daa6..16a0363e846 100644 --- a/text/0000-template.md +++ b/text/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 142cb560469c1a4f34d32f475806632ca69de704 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 --- text/{0000-template.md => 0000-addons-optionalDependencies.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename text/{0000-template.md => 0000-addons-optionalDependencies.md} (100%) diff --git a/text/0000-template.md b/text/0000-addons-optionalDependencies.md similarity index 100% rename from text/0000-template.md rename to text/0000-addons-optionalDependencies.md From 67963254d55d5c9ad9b3167a235320f94e1da0b1 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 --- text/0000-addons-optionalDependencies.md | 33 +++++------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/text/0000-addons-optionalDependencies.md b/text/0000-addons-optionalDependencies.md index 16a0363e846..a237c03ba46 100644 --- a/text/0000-addons-optionalDependencies.md +++ b/text/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.