Skip to content

Commit 2a4ff55

Browse files
authored
chore(icons): generate icons in subprojects (#5341)
- Icon generation still happens in core for compile time type checks. - Each extension has the same icons available anyways. - Validate that the icon sections in subprojects match whats in core/. - Prevents hand modifying subproject icon sections which will bypass type checks.
1 parent 6caee22 commit 2a4ff55

File tree

7 files changed

+665
-20
lines changed

7 files changed

+665
-20
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ You can also use these NPM tasks (see `npm run` for the full list):
132132
133133
1. Declare a global unhandledRejection handler.
134134
```ts
135-
process.on('unhandledRejection', e => {
135+
process.on('unhandledRejection', (e) => {
136136
getLogger('channel').error(
137137
localize(
138138
'AWS.channel.aws.toolkit.activation.error',
@@ -549,7 +549,7 @@ For extensions to contribute their own codicons, VSCode requires a font file as
549549
As a simple example, let's say I wanted to add a new icon for CloudWatch log streams. I would do the following:
550550

551551
1. Place the icon in `resources/icons/aws/cloudwatch`. I'l name the icon `log-stream.svg`.
552-
1. Use `npm run generatePackage` to update `package.json`. Commit this change with the new icon.
552+
1. Use `npm run generateIcons` to update `package.json`. Commit this change with the new icon.
553553
1. You can now use the icon in the Toolkit:
554554

555555
```ts

docs/icons.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Icons
22

3-
All icons that are used in the Toolkit can be found in `resources/icons`.
3+
All icons that are used in the extensions can be found in `resources/icons`.
44

5-
A [build script](../../scripts/build/generateIcons.ts) generates Toolkit artifacts:
5+
A [build script](../scripts/generateIcons.ts) generates extension artifacts in [core/](../packages/core/):
66

77
- `resources/icons/cloud9/generated`
88
- `resources/fonts/aws-toolkit-icons.woff`
99
- `resources/css/icons.css`
10-
- `contributes.icons` in [package.json](../../package.json)
10+
- `contributes.icons` in [amazonq package.json](../packages/amazonq/package.json) and [toolkit package.json](../packages/toolkit/package.json)
1111

12-
This script should be ran using `npm run generatePackage` after making updates. Any changes made to `package.json` should be committed with the relevant icons.
12+
This script should be ran using `npm run generateIcons` after making updates. Any changes made to `package.json` should be committed with the relevant icons. Type checking in `core/` relies on the entries in `core/package.json`. However, the individual extensions require entries in their `package.json`s as well. Currently, resources (including icons) are shared between `core/` and the individual extensions. If `contributes.icons` in each of the extensions does not match the entry in `core/`, then CI will fail.
13+
14+
To sync the icons to the individual extensions, run `npm run copyFiles && npm run generateIcons` for each extension.
1315

1416
## Fonts
1517

packages/amazonq/package.json

Lines changed: 276 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"browser": "./dist/src/extensionWeb",
4747
"scripts": {
4848
"vscode:prepublish": "npm run clean && npm run buildScripts && webpack --mode production",
49-
"buildScripts": "npm run generateNonCodeFiles && npm run copyFiles && npm run generateSettings && npm run syncPackageJson && tsc -p ./ --noEmit",
49+
"buildScripts": "npm run generateNonCodeFiles && npm run copyFiles && npm run generateIcons && npm run generateSettings && npm run syncPackageJson && tsc -p ./ --noEmit",
5050
"generateNonCodeFiles": "ts-node ../../scripts/generateNonCodeFiles.ts",
5151
"copyFiles": "ts-node ./scripts/build/copyFiles.ts",
5252
"syncPackageJson": "ts-node ./scripts/build/syncPackageJson.ts",
@@ -64,6 +64,7 @@
6464
"serve": "webpack serve --config-name mainServe --mode development",
6565
"newChange": "ts-node ../../scripts/newChange.ts",
6666
"createRelease": "ts-node ../../scripts/createRelease.ts",
67+
"generateIcons": "ts-node ../../scripts/generateIcons.ts",
6768
"generateSettings": "ts-node ../../scripts/generateSettings.ts"
6869
},
6970
"dependencies": {
@@ -641,61 +642,327 @@
641642
"fontCharacter": "\\f1ac"
642643
}
643644
},
644-
"aws-amazonq-transform-landing-page-icon": {
645+
"aws-amazonq-transform-arrow-dark": {
645646
"description": "AWS Contributed Icon",
646647
"default": {
647648
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
648649
"fontCharacter": "\\f1ad"
649650
}
650651
},
651-
"aws-codewhisperer-icon-black": {
652+
"aws-amazonq-transform-arrow-light": {
653+
"description": "AWS Contributed Icon",
654+
"default": {
655+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
656+
"fontCharacter": "\\f1ae"
657+
}
658+
},
659+
"aws-amazonq-transform-default-dark": {
660+
"description": "AWS Contributed Icon",
661+
"default": {
662+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
663+
"fontCharacter": "\\f1af"
664+
}
665+
},
666+
"aws-amazonq-transform-default-light": {
667+
"description": "AWS Contributed Icon",
668+
"default": {
669+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
670+
"fontCharacter": "\\f1b0"
671+
}
672+
},
673+
"aws-amazonq-transform-dependencies-dark": {
674+
"description": "AWS Contributed Icon",
675+
"default": {
676+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
677+
"fontCharacter": "\\f1b1"
678+
}
679+
},
680+
"aws-amazonq-transform-dependencies-light": {
681+
"description": "AWS Contributed Icon",
682+
"default": {
683+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
684+
"fontCharacter": "\\f1b2"
685+
}
686+
},
687+
"aws-amazonq-transform-file-dark": {
688+
"description": "AWS Contributed Icon",
689+
"default": {
690+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
691+
"fontCharacter": "\\f1b3"
692+
}
693+
},
694+
"aws-amazonq-transform-file-light": {
695+
"description": "AWS Contributed Icon",
696+
"default": {
697+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
698+
"fontCharacter": "\\f1b4"
699+
}
700+
},
701+
"aws-amazonq-transform-logo": {
652702
"description": "AWS Contributed Icon",
653703
"default": {
654704
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
655705
"fontCharacter": "\\f1b5"
656706
}
657707
},
658-
"aws-codewhisperer-icon-white": {
708+
"aws-amazonq-transform-step-into-dark": {
659709
"description": "AWS Contributed Icon",
660710
"default": {
661711
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
662712
"fontCharacter": "\\f1b6"
663713
}
664714
},
665-
"aws-codewhisperer-learn": {
715+
"aws-amazonq-transform-step-into-light": {
666716
"description": "AWS Contributed Icon",
667717
"default": {
668718
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
669719
"fontCharacter": "\\f1b7"
670720
}
671721
},
672-
"aws-generic-attach-file": {
722+
"aws-amazonq-transform-variables-dark": {
723+
"description": "AWS Contributed Icon",
724+
"default": {
725+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
726+
"fontCharacter": "\\f1b8"
727+
}
728+
},
729+
"aws-amazonq-transform-variables-light": {
730+
"description": "AWS Contributed Icon",
731+
"default": {
732+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
733+
"fontCharacter": "\\f1b9"
734+
}
735+
},
736+
"aws-applicationcomposer-icon": {
737+
"description": "AWS Contributed Icon",
738+
"default": {
739+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
740+
"fontCharacter": "\\f1ba"
741+
}
742+
},
743+
"aws-applicationcomposer-icon-dark": {
744+
"description": "AWS Contributed Icon",
745+
"default": {
746+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
747+
"fontCharacter": "\\f1bb"
748+
}
749+
},
750+
"aws-apprunner-service": {
673751
"description": "AWS Contributed Icon",
674752
"default": {
675753
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
676754
"fontCharacter": "\\f1bc"
677755
}
678756
},
679-
"aws-mynah-MynahIconBlack": {
757+
"aws-cdk-logo": {
758+
"description": "AWS Contributed Icon",
759+
"default": {
760+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
761+
"fontCharacter": "\\f1bd"
762+
}
763+
},
764+
"aws-cloudformation-stack": {
765+
"description": "AWS Contributed Icon",
766+
"default": {
767+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
768+
"fontCharacter": "\\f1be"
769+
}
770+
},
771+
"aws-cloudwatch-log-group": {
772+
"description": "AWS Contributed Icon",
773+
"default": {
774+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
775+
"fontCharacter": "\\f1bf"
776+
}
777+
},
778+
"aws-codecatalyst-logo": {
779+
"description": "AWS Contributed Icon",
780+
"default": {
781+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
782+
"fontCharacter": "\\f1c0"
783+
}
784+
},
785+
"aws-codewhisperer-icon-black": {
680786
"description": "AWS Contributed Icon",
681787
"default": {
682788
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
683789
"fontCharacter": "\\f1c1"
684790
}
685791
},
686-
"aws-mynah-MynahIconWhite": {
792+
"aws-codewhisperer-icon-white": {
687793
"description": "AWS Contributed Icon",
688794
"default": {
689795
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
690796
"fontCharacter": "\\f1c2"
691797
}
692798
},
693-
"aws-mynah-logo": {
799+
"aws-codewhisperer-learn": {
694800
"description": "AWS Contributed Icon",
695801
"default": {
696802
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
697803
"fontCharacter": "\\f1c3"
698804
}
805+
},
806+
"aws-ecr-registry": {
807+
"description": "AWS Contributed Icon",
808+
"default": {
809+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
810+
"fontCharacter": "\\f1c4"
811+
}
812+
},
813+
"aws-ecs-cluster": {
814+
"description": "AWS Contributed Icon",
815+
"default": {
816+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
817+
"fontCharacter": "\\f1c5"
818+
}
819+
},
820+
"aws-ecs-container": {
821+
"description": "AWS Contributed Icon",
822+
"default": {
823+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
824+
"fontCharacter": "\\f1c6"
825+
}
826+
},
827+
"aws-ecs-service": {
828+
"description": "AWS Contributed Icon",
829+
"default": {
830+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
831+
"fontCharacter": "\\f1c7"
832+
}
833+
},
834+
"aws-generic-attach-file": {
835+
"description": "AWS Contributed Icon",
836+
"default": {
837+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
838+
"fontCharacter": "\\f1c8"
839+
}
840+
},
841+
"aws-iot-certificate": {
842+
"description": "AWS Contributed Icon",
843+
"default": {
844+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
845+
"fontCharacter": "\\f1c9"
846+
}
847+
},
848+
"aws-iot-policy": {
849+
"description": "AWS Contributed Icon",
850+
"default": {
851+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
852+
"fontCharacter": "\\f1ca"
853+
}
854+
},
855+
"aws-iot-thing": {
856+
"description": "AWS Contributed Icon",
857+
"default": {
858+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
859+
"fontCharacter": "\\f1cb"
860+
}
861+
},
862+
"aws-lambda-function": {
863+
"description": "AWS Contributed Icon",
864+
"default": {
865+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
866+
"fontCharacter": "\\f1cc"
867+
}
868+
},
869+
"aws-mynah-MynahIconBlack": {
870+
"description": "AWS Contributed Icon",
871+
"default": {
872+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
873+
"fontCharacter": "\\f1cd"
874+
}
875+
},
876+
"aws-mynah-MynahIconWhite": {
877+
"description": "AWS Contributed Icon",
878+
"default": {
879+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
880+
"fontCharacter": "\\f1ce"
881+
}
882+
},
883+
"aws-mynah-logo": {
884+
"description": "AWS Contributed Icon",
885+
"default": {
886+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
887+
"fontCharacter": "\\f1cf"
888+
}
889+
},
890+
"aws-redshift-cluster": {
891+
"description": "AWS Contributed Icon",
892+
"default": {
893+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
894+
"fontCharacter": "\\f1d0"
895+
}
896+
},
897+
"aws-redshift-cluster-connected": {
898+
"description": "AWS Contributed Icon",
899+
"default": {
900+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
901+
"fontCharacter": "\\f1d1"
902+
}
903+
},
904+
"aws-redshift-database": {
905+
"description": "AWS Contributed Icon",
906+
"default": {
907+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
908+
"fontCharacter": "\\f1d2"
909+
}
910+
},
911+
"aws-redshift-redshift-cluster-connected": {
912+
"description": "AWS Contributed Icon",
913+
"default": {
914+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
915+
"fontCharacter": "\\f1d3"
916+
}
917+
},
918+
"aws-redshift-schema": {
919+
"description": "AWS Contributed Icon",
920+
"default": {
921+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
922+
"fontCharacter": "\\f1d4"
923+
}
924+
},
925+
"aws-redshift-table": {
926+
"description": "AWS Contributed Icon",
927+
"default": {
928+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
929+
"fontCharacter": "\\f1d5"
930+
}
931+
},
932+
"aws-s3-bucket": {
933+
"description": "AWS Contributed Icon",
934+
"default": {
935+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
936+
"fontCharacter": "\\f1d6"
937+
}
938+
},
939+
"aws-s3-create-bucket": {
940+
"description": "AWS Contributed Icon",
941+
"default": {
942+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
943+
"fontCharacter": "\\f1d7"
944+
}
945+
},
946+
"aws-schemas-registry": {
947+
"description": "AWS Contributed Icon",
948+
"default": {
949+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
950+
"fontCharacter": "\\f1d8"
951+
}
952+
},
953+
"aws-schemas-schema": {
954+
"description": "AWS Contributed Icon",
955+
"default": {
956+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
957+
"fontCharacter": "\\f1d9"
958+
}
959+
},
960+
"aws-stepfunctions-preview": {
961+
"description": "AWS Contributed Icon",
962+
"default": {
963+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
964+
"fontCharacter": "\\f1da"
965+
}
699966
}
700967
},
701968
"walkthroughs": [

0 commit comments

Comments
 (0)