Skip to content

Commit 7363e14

Browse files
authored
feat: migrate @carbon/themes to TypeScript (#22166)
* feat: migrate @carbon/themes to TypeScript * build: update typescript-config-carbon
1 parent fdd6ce7 commit 7363e14

39 files changed

Lines changed: 301 additions & 194 deletions

packages/themes/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"version": "11.74.0",
55
"license": "Apache-2.0",
66
"main": "lib/index.js",
7+
"types": "lib/index.d.ts",
78
"module": "es/index.js",
89
"sass": "index.scss",
910
"repository": {
@@ -28,7 +29,8 @@
2829
"scripts": {
2930
"ci-check": "carbon-cli check \"scss/**/*.scss\" -i \"**/generated/**\" -i \"**/compat/**\"",
3031
"clean": "rimraf es lib umd scss/generated scss/compat/generated",
31-
"build": "yarn clean && carbon-cli bundle src/index.js --name CarbonThemes && babel-node --presets '@babel/preset-env' tasks/build.js && carbon-cli check \"scss/*.scss\"",
32+
"build:types": "tsc -p tsconfig.types.json",
33+
"build": "yarn clean && carbon-cli bundle src/index.ts --name CarbonThemes && babel-node --extensions '.js,.ts' --presets '@babel/preset-env,@babel/preset-typescript' tasks/build.js && yarn build:types && carbon-cli check \"scss/*.scss\"",
3234
"postinstall": "ibmtelemetry --config=telemetry.yml"
3335
},
3436
"dependencies": {
@@ -45,11 +47,14 @@
4547
"@carbon/cli-reporter": "^10.8.0",
4648
"@carbon/scss-generator": "^10.20.0",
4749
"@carbon/test-utils": "^10.41.0",
50+
"@types/color": "^4.2.1",
4851
"change-case-all": "^2.1.0",
4952
"core-js": "^3.16.0",
5053
"fs-extra": "^11.0.0",
5154
"js-yaml": "^4.1.0",
52-
"rimraf": "^6.0.1"
55+
"rimraf": "^6.0.1",
56+
"typescript": "^5.7.3",
57+
"typescript-config-carbon": "workspace:^0.10.0"
5358
},
5459
"sideEffects": false
5560
}

packages/themes/src/component-tokens/button/index.js renamed to packages/themes/src/component-tokens/button/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2022
2+
* Copyright IBM Corp. 2022, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/button/tokens.js renamed to packages/themes/src/component-tokens/button/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2022
2+
* Copyright IBM Corp. 2022, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/content-switcher/index.js renamed to packages/themes/src/component-tokens/content-switcher/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2025
2+
* Copyright IBM Corp. 2025, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/content-switcher/tokens.js renamed to packages/themes/src/component-tokens/content-switcher/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2025
2+
* Copyright IBM Corp. 2025, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/notification/index.js renamed to packages/themes/src/component-tokens/notification/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2022
2+
* Copyright IBM Corp. 2022, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/notification/tokens.js renamed to packages/themes/src/component-tokens/notification/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2022, 2024
2+
* Copyright IBM Corp. 2022, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/status/index.js renamed to packages/themes/src/component-tokens/status/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2025
2+
* Copyright IBM Corp. 2025, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/status/tokens.js renamed to packages/themes/src/component-tokens/status/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2025
2+
* Copyright IBM Corp. 2025, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

packages/themes/src/component-tokens/tag/index.js renamed to packages/themes/src/component-tokens/tag/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2022
2+
* Copyright IBM Corp. 2022, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.

0 commit comments

Comments
 (0)