-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to packages unresolvable by no-extraneous-dependencies (#1997)
* added main field to packages that lack it * added changeset * added custom script for verifying packages have main, added main to 9 packages * updated error message for script to check for main field * added changeset * fixed private problem, changed file name * added ignore for packages with violations, included in lint check * Update scripts/check_package_json.ts Co-authored-by: Kamil Sobol <sobol.k.r@gmail.com> --------- Co-authored-by: Vieltojarvi <lvielto@amazon.com> Co-authored-by: Kamil Sobol <sobol.k.r@gmail.com>
- Loading branch information
1 parent
fe6c23d
commit e648e8e
Showing
21 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
'@aws-amplify/deployed-backend-client': patch | ||
'@aws-amplify/backend-deployer': patch | ||
'@aws-amplify/backend-function': patch | ||
'@aws-amplify/schema-generator': patch | ||
'@aws-amplify/backend-storage': patch | ||
'@aws-amplify/model-generator': patch | ||
'@aws-amplify/auth-construct': patch | ||
'@aws-amplify/backend-secret': patch | ||
'create-amplify': patch | ||
'@aws-amplify/form-generator': patch | ||
'@aws-amplify/client-config': patch | ||
'@aws-amplify/backend-auth': patch | ||
'@aws-amplify/backend-data': patch | ||
'@aws-amplify/backend': patch | ||
'@aws-amplify/sandbox': patch | ||
'ampx': patch | ||
'@aws-amplify/backend-cli': patch | ||
--- | ||
|
||
added main field to package.json so these packages are resolvable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
'@aws-amplify/deployed-backend-client': patch | ||
'@aws-amplify/backend-deployer': patch | ||
'@aws-amplify/schema-generator': patch | ||
'@aws-amplify/model-generator': patch | ||
'@aws-amplify/backend-secret': patch | ||
'@aws-amplify/form-generator': patch | ||
'@aws-amplify/client-config': patch | ||
'@aws-amplify/sandbox': patch | ||
--- | ||
|
||
added main field to packages known to lack one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { glob } from 'glob'; | ||
import { readPackageJson } from './components/package-json/package_json.js'; | ||
|
||
const packagePaths = await glob('./packages/*'); | ||
|
||
// Excluding packages that violate 'import/no-extraneous-dependencies' rule until they're fixed. | ||
const tempExclude: string[] = [ | ||
'@aws-amplify/plugin-types', | ||
'@aws-amplify/cli-core', | ||
]; | ||
const errors: string[] = []; | ||
for (const packagePath of packagePaths) { | ||
const { | ||
main, | ||
name, | ||
private: privatePackage, | ||
} = await readPackageJson(packagePath); | ||
if (privatePackage || tempExclude.includes(name)) { | ||
continue; | ||
} | ||
if (!main) { | ||
errors.push( | ||
`Expected package ${name} to have field main, but main is missing.` | ||
); | ||
} | ||
} | ||
if (errors.length > 0) { | ||
const errorMessagePrefix = | ||
'Packages were found to be missing main fields.\nAdd main field to package.json of the following packages:'; | ||
throw new Error(`${errorMessagePrefix}\n ${errors.join('\n ')}`); | ||
} |