@dolittle npm package naming consitency
woksin opened this issue · comments
We're getting all sorts of problems with npm because we don't have consistent naming in our packages.json files
┆Issue is synchronized with this Asana task
Yarn tolerates it, but npm doesn't
Can you point to an example of inconsistency ?
For example, in eCommerce we have packages.json files like this:
{
"name": "Shop",
"version": "1.0.0",
"description": "",
"main": "karma.conf.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"run": "./run.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"dolittle.javascript.build": "https://github.com/dolittle/JavaScript.Build.git",
"dolittle.javascript.build.aurelia": "https://github.com/dolittle-interaction/JavaScript.Build.Aurelia.git",
"dolittle.styles": "https://github.com/dolittle/dolittle.styles.git#2.9.4"
},
"dependencies": {
"@dolittle/commands": "^1.0.10",
"@dolittle/core": "^1.0.4",
"@dolittle/queries": "^1.0.12",
"aurelia-http-client": "^1.2.1",
"dotenv": "^6.1.0"
}
}
Notice the devDependencies here, the name "dolittle.javascript.build" and "dolittle.javascript.build.aurelia" doesn't match up with the names defined in their package.json files. For example the aurelia build one is called "@dolittle/build.aurelia" in it's package.json.
When doing
$ yarn install
everything seemingly works, it doesn't care about the name of the package, it just installs the dependency as the name given in its own package.json file 'dolittle.javascript.build'
However, for
$ npm install
it seems like it gets confused with the mismatch in the naming, so it doesn't install the packages, and none of its dependencies. Changing the name of the package from "dolittle.javascript.build" to what it's defined as in that package's package.json file, "@dolittle/build" fixes the problem for npm
I see that "dolittle.styles" doesn't have the @ prefixed like our other packages : https://github.com/dolittle-interaction/Dolittle.styles/blob/master/package.json
So should all of our npm-packages be prefixed with @ then? If so, this also has to be reflected into the Samples and in the boilerplates
Seems like this is fixed? (dolittle/styles => @dolittle/styles cc @Virrum )
YEs @woksin