Skip to content

Commit ac6e7af

Browse files
authored
Add typescript source files as default exports and fix build order (#4024)
* add typescript default exports and clean up build ordering * docs(changeset): Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
1 parent 0d6e9c1 commit ac6e7af

File tree

92 files changed

+386
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+386
-200
lines changed

.changeset/long-ideas-flow.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
'@uifabricshared/foundation-composable': patch
3+
'@fluentui-react-native/experimental-appearance-additions': patch
4+
'@uifabricshared/theming-react-native': patch
5+
'@uifabricshared/foundation-settings': patch
6+
'@fluentui-react-native/experimental-activity-indicator': patch
7+
'@fluentui-react-native/experimental-native-font-metrics': patch
8+
'@uifabricshared/foundation-compose': patch
9+
'@fluentui-react-native/experimental-native-date-picker': patch
10+
'@uifabricshared/foundation-tokens': patch
11+
'@fluentui-react-native/eslint-config-rules': patch
12+
'@fluentui-react-native/themed-stylesheet': patch
13+
'@uifabricshared/themed-settings': patch
14+
'@fluentui-react-native/contextual-menu': patch
15+
'@uifabricshared/theme-registry': patch
16+
'@fluentui-react-native/vibrancy-view': patch
17+
'@fluentui-react-native/immutable-merge': patch
18+
'@fluentui-react-native/focus-trap-zone': patch
19+
'@fluentui-react-native/notification': patch
20+
'@uifabricshared/theming-ramp': patch
21+
'@fluentui-react-native/experimental-menu-button': patch
22+
'@fluentui-react-native/interactive-hooks': patch
23+
'@fluentui-react-native/persona-coin': patch
24+
'@fluentui-react-native/menu-button': patch
25+
'@fluentui-react-native/radio-group': patch
26+
'@fluentui-react-native/experimental-checkbox': patch
27+
'@fluentui-react-native/dropdown': patch
28+
'@fluentui-react-native/experimental-expander': patch
29+
'@fluentui-react-native/overflow': patch
30+
'@fluentui-react-native/composition': patch
31+
'@fluentui-react-native/merge-props': patch
32+
'@fluentui-react-native/use-styling': patch
33+
'@fluentui-react-native/android-theme': patch
34+
'@fluentui-react-native/default-theme': patch
35+
'@fluentui-react-native/theming-utils': patch
36+
'@fluentui-react-native/focus-zone': patch
37+
'@fluentui-react-native/pressable': patch
38+
'@fluentui-react-native/separator': patch
39+
'@fluentui-react-native/popover': patch
40+
'@fluentui-react-native/experimental-shimmer': patch
41+
'@fluentui-react-native/spinner': patch
42+
'@fluentui-react-native/tooltip': patch
43+
'@fluentui-react-native/memo-cache': patch
44+
'@fluentui-react-native/use-tokens': patch
45+
'@fluentui-react-native/theme-tokens': patch
46+
'@fluentui-react-native/checkbox': patch
47+
'@fluentui-react-native/jest-config': patch
48+
'@fluentui-react-native/experimental-avatar': patch
49+
'@fluentui-react-native/drawer': patch
50+
'@fluentui-react-native/experimental-shadow': patch
51+
'@fluentui-react-native/framework': patch
52+
'@fluentui-react-native/use-slots': patch
53+
'@fluentui-react-native/apple-theme': patch
54+
'@fluentui-react-native/theme-types': patch
55+
'@fluentui-react-native/win32-theme': patch
56+
'@fluentui-react-native/callout': patch
57+
'@fluentui-react-native/divider': patch
58+
'@fluentui-react-native/persona': patch
59+
'@fluentui-react-native/tablist': patch
60+
'@fluentui-react-native/kit-config': patch
61+
'@fluentui-react-native/experimental-stack': patch
62+
'@fluentui-react-native/use-slot': patch
63+
'@fluentui-react-native/avatar': patch
64+
'@fluentui-react-native/button': patch
65+
'@fluentui-react-native/switch': patch
66+
'@fluentui-react-native/badge': patch
67+
'@fluentui-react-native/input': patch
68+
'@fluentui-react-native/stack': patch
69+
'@fluentui-react-native/chip': patch
70+
'@fluentui-react-native/icon': patch
71+
'@fluentui-react-native/link': patch
72+
'@fluentui-react-native/menu': patch
73+
'@fluentui-react-native/text': patch
74+
'@fluentui-react-native/theme': patch
75+
'@fluentui-react-native/framework-base': patch
76+
'@fluentui/react-native': patch
77+
'@fluentui-react-native/adapters': patch
78+
'@fluentui-react-native/styling-utils': patch
79+
'@fluentui-react-native/tokens': patch
80+
'@fluentui-react-native/codemods': patch
81+
'@fluentui-react-native/scripts': patch
82+
---
83+
84+
Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering

apps/E2E/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
".": {
2020
"types": "./lib/index.d.ts",
2121
"import": "./lib/index.js",
22-
"require": "./lib-commonjs/index.js"
22+
"require": "./lib-commonjs/index.js",
23+
"default": "./src/index.ts"
2324
}
2425
},
2526
"scripts": {
2627
"build": "fluentui-scripts build",
2728
"build-cjs": "tsgo --outDir lib-commonjs",
28-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
29+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2930
"e2eprep:android": "cross-env APPIUM_HOME=.appium yarn exec appium driver install uiautomator2",
3031
"e2eprep:ios": "cross-env APPIUM_HOME=.appium yarn exec appium driver install xcuitest",
3132
"e2eprep:macos": "cross-env APPIUM_HOME=.appium yarn exec appium driver install mac2",

apps/fluent-tester/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
".": {
1818
"types": "./lib/index.d.ts",
1919
"import": "./lib/index.js",
20-
"require": "./lib-commonjs/index.js"
20+
"require": "./lib-commonjs/index.js",
21+
"default": "./src/index.ts"
2122
}
2223
},
2324
"scripts": {
2425
"android": "rnx-cli run --platform android",
2526
"build": "fluentui-scripts build",
2627
"build-cjs": "tsgo --outDir lib-commonjs",
27-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
28+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2829
"bundle": "rnx-cli bundle --dev false",
2930
"bundle:android": "rnx-cli bundle --dev false --platform android",
3031
"bundle:ios": "rnx-cli bundle --dev false --platform ios",

apps/tester-core/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
".": {
1818
"types": "./lib/index.d.ts",
1919
"import": "./lib/index.js",
20-
"require": "./lib-commonjs/index.js"
20+
"require": "./lib-commonjs/index.js",
21+
"default": "./src/index.ts"
2122
}
2223
},
2324
"scripts": {
2425
"build": "fluentui-scripts build",
2526
"build-cjs": "tsgo --outDir lib-commonjs",
26-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
27+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2728
"clean": "fluentui-scripts clean",
2829
"depcheck": "fluentui-scripts depcheck",
2930
"lint": "fluentui-scripts eslint",

apps/win32-81/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
".": {
1515
"types": "./lib/index.d.ts",
1616
"import": "./lib/index.js",
17-
"require": "./lib-commonjs/index.js"
17+
"require": "./lib-commonjs/index.js",
18+
"default": "./src/index.ts"
1819
}
1920
},
2021
"scripts": {
2122
"build": "fluentui-scripts build",
2223
"build-cjs": "tsgo --outDir lib-commonjs",
23-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
24+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2425
"bundle": "rnx-cli bundle --dev false",
2526
"bundle-dev": "rnx-cli bundle",
2627
"clean": "fluentui-scripts clean",

apps/win32/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
".": {
1515
"types": "./lib/index.d.ts",
1616
"import": "./lib/index.js",
17-
"require": "./lib-commonjs/index.js"
17+
"require": "./lib-commonjs/index.js",
18+
"default": "./src/index.ts"
1819
}
1920
},
2021
"scripts": {
2122
"build": "fluentui-scripts build",
2223
"build-cjs": "tsgo --outDir lib-commonjs",
23-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
24+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2425
"bundle": "rnx-cli bundle --dev false",
2526
"bundle-dev": "rnx-cli bundle",
2627
"clean": "fluentui-scripts clean",

lage.config.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ const config = {
33
npmClient: 'yarn',
44
pipeline: {
55
'build-cjs': {
6-
dependsOn: ['^build-cjs'],
6+
// cjs builds need to wait for the esm builds to produce the type definitions
7+
dependsOn: ['^build-core', '^build-cjs'],
78
inputs: ['*', 'src/**/*', 'assets/**/*'],
89
outputs: ['lib-commonjs/**/*'],
910
},
10-
'build-esm': {
11-
dependsOn: ['^build-esm'],
11+
'build-core': {
12+
// the core build does esm builds (which produce type definitions used by both cjs and esm builds)
13+
// this also handles noEmit packages which should be run in sequence with other packages
14+
dependsOn: ['^build-core'],
1215
inputs: ['*', 'src/**/*', 'assets/**/*'],
1316
outputs: ['lib/**/*'],
1417
},
15-
'build-dual': {
16-
dependsOn: ['build-cjs', 'build-esm'],
18+
'build-all': {
19+
dependsOn: ['build-core', 'build-cjs'],
1720
inputs: ['*', 'src/**/*', 'assets/**/*'],
1821
outputs: ['lib/**/*', 'lib-commonjs/**/*'],
1922
},
20-
buildci: ['build-dual', 'test', 'lint', 'lint-package'],
23+
buildci: ['build-all', 'test', 'lint', 'lint-package'],
2124
bundle: {
2225
inputs: ['**/*', '!node_modules/**/*', '!dist/**/*', '!lib/**/*', '!lib-commonjs/**/*'],
2326
outputs: ['dist/**/*'],
@@ -39,7 +42,7 @@ const config = {
3942
},
4043
'pr-check': ['buildci', 'lint-package', 'lint-lockfile', 'format:check'],
4144
test: {
42-
dependsOn: ['build-dual'],
45+
dependsOn: ['build-all'],
4346
inputs: [],
4447
outputs: [],
4548
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"scripts"
1515
],
1616
"scripts": {
17-
"build": "lage build-dual",
17+
"build": "lage build-all",
1818
"buildci": "lage buildci",
1919
"clean-all": "node ./scripts/src/preinstall/clean-all.js",
2020
"docs": "yarn workspace fluent-rn-website start",

packages/codemods/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
".": {
2121
"types": "./lib/index.d.ts",
2222
"import": "./lib/index.js",
23-
"require": "./lib-commonjs/index.js"
23+
"require": "./lib-commonjs/index.js",
24+
"default": "./src/index.ts"
2425
}
2526
},
2627
"scripts": {
2728
"build": "fluentui-scripts build",
2829
"build-cjs": "tsgo --outDir lib-commonjs",
29-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
30+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
3031
"clean": "fluentui-scripts clean",
3132
"depcheck": "fluentui-scripts depcheck",
3233
"lint": "fluentui-scripts eslint",

packages/components/Avatar/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
".": {
1818
"types": "./lib/index.d.ts",
1919
"import": "./lib/index.js",
20-
"require": "./lib-commonjs/index.js"
20+
"require": "./lib-commonjs/index.js",
21+
"default": "./src/index.ts"
2122
}
2223
},
2324
"scripts": {
2425
"build": "fluentui-scripts build",
2526
"build-cjs": "tsgo --outDir lib-commonjs",
26-
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
27+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
2728
"clean": "fluentui-scripts clean",
2829
"depcheck": "fluentui-scripts depcheck",
2930
"lint": "fluentui-scripts eslint",

0 commit comments

Comments
 (0)