Skip to content

Commit 27aa98a

Browse files
committed
chore: make icons builds from source and remove ts-node entry point to make ESM compatible
1 parent ce5eb91 commit 27aa98a

File tree

15 files changed

+57
-27
lines changed

15 files changed

+57
-27
lines changed

.circleci/src/pipeline/@pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ jobs:
17841784
source ./scripts/ensure-node.sh
17851785
yarn lerna run types
17861786
- sanitize-verify-and-store-mocha-results:
1787-
expectedResultCount: 10
1787+
expectedResultCount: 9
17881788

17891789
verify-release-readiness:
17901790
<<: *defaults

guides/esm-migration.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
4646
- [ ] packages/example
4747
- [ ] packages/extension
4848
- [ ] packages/frontend-shared **PARTIAL** - entry point is JS
49-
- [ ] packages/https-proxy - higher priority
5049
- [x] packages/electron ✅ **COMPLETED**
51-
- [ ] packages/https-proxy **PARTIAL** - entry point is JS
50+
- [ ] packages/https-proxy - higher priority
5251
- [x] packages/icons ✅ **COMPLETED**
5352
- [x] packages/launcher ✅ **COMPLETED**
5453
- [x] packages/launchpad ✅ **COMPLETED**
@@ -98,7 +97,6 @@ When migrating some of these projects away from the `ts-node` entry [see `@packa
9897
- [ ] packages/extension
9998
- [ ] packages/https-proxy
10099
- [x] packages/electron ✅ **COMPLETED**
101-
- [ ] packages/https-proxy
102100
- [ ] packages/icons
103101
- [ ] packages/launcher
104102
- [ ] packages/net-stubbing

packages/icons/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/dist
2+
index.js
23
**/*.d.ts
34
**/package-lock.json
45
**/tsconfig.json

packages/icons/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/dist
2+
index.js
3+
index.d.ts

packages/icons/index.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/icons/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/icons/src/icons.ts renamed to packages/icons/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path'
22

3-
const dist = [__dirname, '..', 'dist']
3+
const dist = [__dirname, 'dist']
44

55
function distPath (...args: string[]) {
66
return path.join.apply(path, dist.concat([...args]))

packages/icons/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
"private": true,
66
"main": "index.js",
77
"scripts": {
8-
"build": "tsx ./scripts/build.ts && tsx ./scripts/ico.ts",
9-
"check-ts": "tsc --noEmit && yarn -s tslint",
8+
"build": "yarn build-assets && yarn build:cjs && yarn build:esm",
9+
"build-assets": "tsx ./scripts/build.ts && tsx ./scripts/ico.ts",
10+
"build-prod": "yarn build",
11+
"build:cjs": "tsc -p tsconfig.cjs.json",
12+
"build:esm": "tsc -p tsconfig.esm.json",
13+
"check-ts": "tsc -p tsconfig.cjs.json --noEmit && yarn -s tslint -p tsconfig.cjs.json",
1014
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
1115
"test": "yarn test-unit",
1216
"test-unit": "vitest run",
@@ -17,14 +21,15 @@
1721
"@types/to-ico": "^1.1.1",
1822
"fs-extra": "9.1.0",
1923
"to-ico": "^1.1.5",
20-
"tsx": "^4.19.3",
24+
"tsx": "^4.20.5",
2125
"vitest": "^3.2.4"
2226
},
2327
"files": [
2428
"dist",
2529
"index.js",
2630
"index.d.ts"
2731
],
32+
"types": "index.d.ts",
2833
"license": "MIT",
2934
"nx": {}
3035
}

packages/icons/test/icons.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'vitest'
2-
import * as icons from '../src/icons'
2+
import * as icons from '../index'
33

44
const cwd = process.cwd()
55

packages/icons/tsconfig.base.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"include": [
3+
"index.ts"
4+
],
5+
"compilerOptions": {
6+
"allowJs": false,
7+
"noImplicitAny": true,
8+
"noUncheckedIndexedAccess": true,
9+
"skipLibCheck": true,
10+
"esModuleInterop": true,
11+
"declaration": true
12+
}
13+
}

0 commit comments

Comments
 (0)