Skip to content

Commit 32fd916

Browse files
committed
Remove
1 parent fce170a commit 32fd916

File tree

7 files changed

+50
-46
lines changed

7 files changed

+50
-46
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react'
1+
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33
import './index.css'
44
import App from './App'
55

66
const root = createRoot(document.getElementById('root')!)
77
root.render(
8-
<React.StrictMode>
8+
<StrictMode>
99
<App />
10-
</React.StrictMode>,
10+
</StrictMode>,
1111
)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react'
1+
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33
import './index.css'
44
import App from './App'
55

66
const root = createRoot(document.getElementById('root')!)
77
root.render(
8-
<React.StrictMode>
8+
<StrictMode>
99
<App />
10-
</React.StrictMode>,
10+
</StrictMode>,
1111
)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react'
1+
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33
import './index.css'
44
import App from './App'
55

66
const root = createRoot(document.getElementById('root')!)
77
root.render(
8-
<React.StrictMode>
8+
<StrictMode>
99
<App />
10-
</React.StrictMode>,
10+
</StrictMode>,
1111
)

packages/core/DEVELOPERS.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
# @jbrowse/core Developer Guide
22

3+
## Package Design
4+
5+
This package has **no main entry point**. It is designed exclusively for subpath
6+
imports:
7+
8+
```typescript
9+
// Correct usage
10+
import PluginManager from '@jbrowse/core/PluginManager'
11+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
12+
13+
// This will error - no default export
14+
import '@jbrowse/core' // ERR_PACKAGE_PATH_NOT_EXPORTED
15+
```
16+
317
## package.json Structure
418
5-
This package uses a dual-mode configuration to support both monorepo development and
6-
external consumers.
19+
This package uses a dual-mode configuration to support both monorepo development
20+
and external consumers.
721
822
### Exports Field
923
10-
The `exports` field defines subpath imports like `@jbrowse/core/PluginManager`. During
11-
development, these point to source TypeScript files:
24+
The `exports` field defines subpath imports like `@jbrowse/core/PluginManager`.
25+
During development, these point to source TypeScript files:
1226
1327
```json
1428
"exports": {
@@ -19,8 +33,8 @@ development, these point to source TypeScript files:
1933

2034
### publishConfig
2135

22-
When the package is published to npm, the `publishConfig` section overrides the exports
23-
to point to compiled output:
36+
When the package is published to npm, the `publishConfig` section overrides the
37+
exports to point to compiled output:
2438

2539
```json
2640
"publishConfig": {
@@ -35,9 +49,10 @@ to point to compiled output:
3549

3650
### typesVersions (for moduleResolution "node" consumers)
3751

38-
The `exports` field is only supported by TypeScript with `moduleResolution` set to
39-
`bundler`, `node16`, or `nodenext`. For consumers using the legacy `moduleResolution: "node"`,
40-
we include a `typesVersions` field in `publishConfig`:
52+
The `exports` field is only supported by TypeScript with `moduleResolution` set
53+
to `bundler`, `node16`, or `nodenext`. For consumers using the legacy
54+
`moduleResolution: "node"`, we include a `typesVersions` field in
55+
`publishConfig`:
4156

4257
```json
4358
"publishConfig": {
@@ -49,8 +64,8 @@ we include a `typesVersions` field in `publishConfig`:
4964
}
5065
```
5166

52-
This tells TypeScript where to find type declarations for subpath imports even when
53-
the `exports` field is not being read.
67+
This tells TypeScript where to find type declarations for subpath imports even
68+
when the `exports` field is not being read.
5469

5570
## Generating Exports
5671

@@ -61,13 +76,13 @@ auto-generated by scanning the codebase for `@jbrowse/core/*` imports:
6176
pnpm generate:exports
6277
```
6378

64-
This script (`scripts/generateExports.mjs`) finds all imports of `@jbrowse/core/*`
65-
across the monorepo and generates the appropriate mappings.
79+
This script (`scripts/generateExports.mjs`) finds all imports of
80+
`@jbrowse/core/*` across the monorepo and generates the appropriate mappings.
6681

6782
## Module Resolution Summary
6883

69-
| Consumer Environment | How it resolves `@jbrowse/core/PluginManager` |
70-
|---------------------|-----------------------------------------------|
71-
| Monorepo (bundler mode) | Uses `exports` field pointing to `src/*.ts` |
72-
| External (bundler/node16/nodenext) | Uses `publishConfig.exports` pointing to `esm/*.js` |
73-
| External (node mode) | Uses `typesVersions` for types, `exports` for runtime |
84+
| Consumer Environment | How it resolves `@jbrowse/core/PluginManager` |
85+
| ---------------------------------- | ----------------------------------------------------- |
86+
| Monorepo (bundler mode) | Uses `exports` field pointing to `src/*.ts` |
87+
| External (bundler/node16/nodenext) | Uses `publishConfig.exports` pointing to `esm/*.js` |
88+
| External (node mode) | Uses `typesVersions` for types, `exports` for runtime |

packages/core/package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
"directory": "packages/core"
2020
},
2121
"author": "JBrowse Team",
22-
"main": "dist/index.js",
23-
"types": "dist/index.d.ts",
2422
"exports": {
25-
".": "./src/index.ts",
2623
"./BaseFeatureWidget": "./src/BaseFeatureWidget/index.ts",
2724
"./BaseFeatureWidget/BaseFeatureDetail": "./src/BaseFeatureWidget/BaseFeatureDetail/index.tsx",
2825
"./BaseFeatureWidget/BaseFeatureDetail/Attributes": "./src/BaseFeatureWidget/BaseFeatureDetail/Attributes.tsx",
@@ -191,13 +188,7 @@
191188
},
192189
"publishConfig": {
193190
"access": "public",
194-
"main": "esm/index.js",
195-
"types": "esm/index.d.ts",
196191
"exports": {
197-
".": {
198-
"types": "./esm/index.d.ts",
199-
"import": "./esm/index.js"
200-
},
201192
"./BaseFeatureWidget": {
202193
"types": "./esm/BaseFeatureWidget/index.d.ts",
203194
"import": "./esm/BaseFeatureWidget/index.js"
@@ -967,6 +958,9 @@
967958
],
968959
"ReExports/list": [
969960
"esm/ReExports/list.d.ts"
961+
],
962+
"util/fileHandleStore": [
963+
"esm/util/fileHandleStore.d.ts"
970964
]
971965
}
972966
}

packages/core/scripts/generateExports.mjs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,12 @@ console.log(`Found ${imports.length} unique @jbrowse/core import paths`)
9898

9999
// Generate dev exports (pointing to src)
100100
// Using simple string format since import/require point to same .ts file
101-
const devExports = {
102-
'.': './src/index.ts',
103-
}
101+
// Note: No "." entry - this package is designed for subpath imports only
102+
const devExports = {}
104103

105104
// Generate publish exports (pointing to esm)
106-
const publishExports = {
107-
'.': {
108-
types: './esm/index.d.ts',
109-
import: './esm/index.js',
110-
},
111-
}
105+
// Note: No "." entry - this package is designed for subpath imports only
106+
const publishExports = {}
112107

113108
// Generate typesVersions for moduleResolution "node" consumers
114109
// This allows TypeScript to resolve subpath imports even without exports field support

products/jbrowse-cli/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function wrapText(text: string, width: number, indent: string) {
198198
}
199199
}
200200
}
201-
return lines.join('\n' + indent)
201+
return lines.join(`\n${indent}`)
202202
}
203203

204204
export function printHelp({

0 commit comments

Comments
 (0)