Skip to content

Commit

Permalink
chore(repo): ensure license file exists for all published packages (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Mar 10, 2022
1 parent 23494a0 commit 94687e9
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 22 deletions.
6 changes: 5 additions & 1 deletion packages/angular/project.json
Expand Up @@ -50,7 +50,11 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-nx-plugin/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-nx-workspace/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/detox/project.json
Expand Up @@ -58,7 +58,7 @@
"ignore": ["**/tsconfig*.json"],
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/devkit/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-nx/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/express/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/js/project.json
Expand Up @@ -52,7 +52,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/linter/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/nest/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/next/project.json
Expand Up @@ -50,7 +50,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/node/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/nx-plugin/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/project.json
Expand Up @@ -37,7 +37,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/project.json
Expand Up @@ -63,6 +63,11 @@
"input": "packages/react-native",
"glob": "**/*.d.ts",
"output": "/"
},
{
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react/project.json
Expand Up @@ -55,7 +55,7 @@
"ignore": ["**/jest.config.js"],
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/project.json
Expand Up @@ -55,7 +55,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/tao/project.json
Expand Up @@ -45,7 +45,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/web/project.json
Expand Up @@ -50,7 +50,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/project.json
Expand Up @@ -53,7 +53,7 @@
"glob": "**/*.d.ts",
"output": "/"
},
"LICENSE"
{ "input": "", "glob": "LICENSE", "output": "/" }
]
},
"outputs": ["{options.outputPath}"]
Expand Down
7 changes: 7 additions & 0 deletions scripts/nx-release.js
Expand Up @@ -79,6 +79,13 @@ function updatePackageJsonFiles(parsedVersion, isLocal) {
if (isLocal) {
pkgFiles = pkgFiles.filter((f) => f !== 'package.json');
}
for (const pkgFile of pkgFiles) {
const pkgDir = path.dirname(pkgFile);
const licensePath = path.join(pkgDir, 'LICENSE');
if (!fs.existsSync(licensePath)) {
throw new Error('Missing License: ' + licensePath);
}
}
pkgFiles.forEach((p) => {
const content = JSON.parse(fs.readFileSync(p).toString());
content.version = parsedVersion.version;
Expand Down

0 comments on commit 94687e9

Please sign in to comment.