You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/publish.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@ To install the package, run the following command:
11
11
pnpm add -D @tanstack/publish-config
12
12
```
13
13
14
-
15
14
## Usage
16
15
17
16
To use the TanStack Config programmatically, you can import the `publish` function:
@@ -42,3 +41,24 @@ publish({
42
41
> ```
43
42
>
44
43
> in your `package.json` file and use `import` instead of `require`.
44
+
45
+
## Trusted Publishing
46
+
47
+
Trusted publishing is the new npm strategy to allow publishing packages without npm tokens, using OIDC authentication. It currently requires you to set up for each package individually; however, once enabled, no further interaction is required!
48
+
49
+
### Step 1
50
+
51
+
- If the package already has a published version on npm, you can skip this step.
52
+
- If the package has never been published, you can publish a "placeholder" package to do the setup process. This CLI tool streamlines this: [setup-npm-trusted-publish](https://github.com/azu/setup-npm-trusted-publish)
53
+
54
+
### Step 2
55
+
56
+
- If you're only setting up one package, you can skip this step. Otherwise, the tools below help dramatically when setting up 5+ packages all at once.
Copy file name to clipboardExpand all lines: docs/vite.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,16 @@ id: vite
3
3
title: Vite
4
4
---
5
5
6
-
The Vite build setup is the culmination of several attempts to dual publish ESM and CJS for TanStack projects, while preserving compatibility with all Typescript module resolution options.
6
+
The Vite build setup was the result of several attempts to dual publish ESM and CJS for TanStack projects, while preserving compatibility with all Typescript module resolution options.
7
7
8
-
## Do I Need This?
8
+
## Do I need dual publishing?
9
9
10
10
ES Modules (ESM) is the standard for writing JavaScript modules. However, due to the historical dependency on CommonJS (CJS), many ecosystem tools and projects were initially incompatible with ESM. It is becoming exceedingly rare for this to be the case, and I would urge you to consider whether it is necessary to distribute CJS code at all. Sindre Sorhus has a good summary on this issue [here](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
11
11
12
+
## Do I need this package?
13
+
14
+
Many alternatives have bene created recently, with the most notable being [tsdown](https://github.com/rolldown/tsdown), built on top of `rolldown`. We will be adopting tsdown for future projects rather than continuing to use our custom Vite setup.
15
+
12
16
## Installation
13
17
14
18
To install the package, run the following command:
@@ -17,9 +21,20 @@ To install the package, run the following command:
| Vanilla |[tsdown](https://tsdown.dev/)|[tsdown](https://tsdown.dev/) or [tsc](https://www.npmjs.com/package/typescript)|
29
+
| Angular | Not required |[ng-packagr](https://www.npmjs.com/package/ng-packagr) (official tool) |
30
+
| React |[tsdown](https://tsdown.dev/)|[tsdown](https://tsdown.dev/) or [tsc](https://www.npmjs.com/package/typescript)|
31
+
| Solid | Not required |[tsc](https://www.npmjs.com/package/typescript) (preserves JSX, necessary for SSR) |
32
+
| Svelte | Not required |[@sveltejs/package](https://www.npmjs.com/package/@sveltejs/package) (official tool) |
33
+
| Vue |[tsdown](https://tsdown.dev/)|[tsdown](https://tsdown.dev/) or [tsc](https://www.npmjs.com/package/typescript)|
34
+
35
+
## Legacy Setup
21
36
22
-
The build config is quite opinionated, as it is designed to work with our internal libraries. If you follow the below instructions, it _may_ work for your library too!
37
+
The build config is opinionated, and was designed to work with our internal libraries. If you follow the below instructions, it _may_ work for your library too!
23
38
24
39
### package.json
25
40
@@ -74,15 +89,3 @@ export default mergeConfig(
74
89
}),
75
90
)
76
91
```
77
-
78
-
## Frameworks
79
-
80
-
While this config _will_ work with most frameworks with a Vite adapter, it doesn't mean you _should_ use it for all frameworks, as many have their own build tools which are optimised for their ecosystem. When a framework-specific build tool exists, this should be preferred.
0 commit comments