@sanity/tsdown-config 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.d.ts → index.d.mts} +7 -2
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +39 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +11 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
|
@@ -2,10 +2,15 @@ import { UserConfig } from "tsdown";
|
|
|
2
2
|
/**
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
|
-
interface PackageOptions extends Pick<UserConfig, "tsconfig" | "entry" | "format"> {
|
|
5
|
+
interface PackageOptions extends Pick<UserConfig, "tsconfig" | "entry" | "format"> {
|
|
6
|
+
/**
|
|
7
|
+
* @defaultValue 'neutral'
|
|
8
|
+
*/
|
|
9
|
+
platform?: UserConfig["platform"];
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* @public
|
|
8
13
|
*/
|
|
9
14
|
declare function defineConfig(options?: PackageOptions): UserConfig;
|
|
10
15
|
export { PackageOptions, defineConfig };
|
|
11
|
-
//# sourceMappingURL=index.d.
|
|
16
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;AAKA;;AAIa,UAJI,cAAA,SAAuB,IAI3B,CAJgC,UAIhC,EAAA,UAAA,GAAA,OAAA,GAAA,QAAA,CAAA,CAAA;EAJ2B;;AAUxC;aANa;;;;;iBAMG,YAAA,WAAsB,iBAAsB"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineConfig as defineConfig$1 } from "tsdown";
|
|
2
|
+
function defineConfig(options = {}) {
|
|
3
|
+
return defineConfig$1({
|
|
4
|
+
exports: {
|
|
5
|
+
enabled: "local-only",
|
|
6
|
+
devExports: !0
|
|
7
|
+
},
|
|
8
|
+
format: options.format ?? "esm",
|
|
9
|
+
hash: !1,
|
|
10
|
+
inputOptions: {
|
|
11
|
+
preserveEntrySignatures: "strict",
|
|
12
|
+
experimental: { attachDebugInfo: "none" }
|
|
13
|
+
},
|
|
14
|
+
outputOptions: { hoistTransitiveImports: !1 },
|
|
15
|
+
platform: options.platform ?? "neutral",
|
|
16
|
+
publint: !0,
|
|
17
|
+
report: { gzip: !1 },
|
|
18
|
+
tsconfig: options.tsconfig ?? "tsconfig.json",
|
|
19
|
+
minify: {
|
|
20
|
+
compress: !0,
|
|
21
|
+
codegen: !1,
|
|
22
|
+
mangle: !1
|
|
23
|
+
},
|
|
24
|
+
treeshake: {
|
|
25
|
+
annotations: !0,
|
|
26
|
+
propertyReadSideEffects: !1,
|
|
27
|
+
moduleSideEffects: [{
|
|
28
|
+
test: /\.css$/,
|
|
29
|
+
sideEffects: !0
|
|
30
|
+
}, {
|
|
31
|
+
external: !0,
|
|
32
|
+
sideEffects: !1
|
|
33
|
+
}]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export { defineConfig };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["defineTsdownConfig"],"sources":["../src/index.ts"],"sourcesContent":["import {defineConfig as defineTsdownConfig, type UserConfig} from 'tsdown'\n\n/**\n * @public\n */\nexport interface PackageOptions extends Pick<UserConfig, 'tsconfig' | 'entry' | 'format'> {\n /**\n * @defaultValue 'neutral'\n */\n platform?: UserConfig['platform']\n}\n\n/**\n * @public\n */\nexport function defineConfig(options: PackageOptions = {}): UserConfig {\n const tsconfig = options.tsconfig ?? 'tsconfig.json'\n const platform = options.platform ?? 'neutral'\n const report = {gzip: false} as const satisfies UserConfig['report']\n const publint = true\n const hash = false\n const format = options.format ?? 'esm'\n const inputOptions = {\n preserveEntrySignatures: 'strict',\n experimental: {attachDebugInfo: 'none'},\n } as const satisfies UserConfig['inputOptions']\n const outputOptions = {\n hoistTransitiveImports: false,\n } as const satisfies UserConfig['outputOptions']\n const exports = {\n enabled: 'local-only',\n // @TODO use @sanity/parse-package-json to determine if devExports should be `true` or `source`\n devExports: true,\n } as const satisfies UserConfig['exports']\n\n return defineTsdownConfig({\n exports,\n format,\n hash,\n inputOptions,\n outputOptions,\n platform,\n publint,\n report,\n tsconfig,\n minify: {compress: true, codegen: false, mangle: false},\n treeshake: {\n annotations: true,\n propertyReadSideEffects: false,\n moduleSideEffects: [\n // If the module ends with `.css` it is considered to be a side effect, even if the module is marked as no side effect,\n {test: /\\.css$/, sideEffects: true},\n // This is the equivalent of `moduleSideEffects: 'no-external'`, and included here so it works the same as before the CSS exemption were added.\n {external: true, sideEffects: false},\n ],\n },\n })\n}\n"],"mappings":";AAeA,SAAgB,aAAa,UAA0B,EAAE,EAAc;AAoBrE,QAAOA,eAAmB;EACxB,SAPc;GACd,SAAS;GAET,YAAY;GACb;EAIC,QAhBa,QAAQ,UAAU;EAiB/B,MAlBW;EAmBX,cAjBmB;GACnB,yBAAyB;GACzB,cAAc,EAAC,iBAAiB,QAAO;GACxC;EAeC,eAdoB,EACpB,wBAAwB,IACzB;EAaC,UAxBe,QAAQ,YAAY;EAyBnC,SAvBc;EAwBd,QAzBa,EAAC,MAAM,IAAM;EA0B1B,UA5Be,QAAQ,YAAY;EA6BnC,QAAQ;GAAC,UAAU;GAAM,SAAS;GAAO,QAAQ;GAAM;EACvD,WAAW;GACT,aAAa;GACb,yBAAyB;GACzB,mBAAmB,CAEjB;IAAC,MAAM;IAAU,aAAa;IAAK,EAEnC;IAAC,UAAU;IAAM,aAAa;IAAM,CACrC;GACF;EACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/tsdown-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared configuration for tsdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -27,26 +27,27 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"type": "module",
|
|
29
29
|
"exports": {
|
|
30
|
-
".": "./dist/index.
|
|
30
|
+
".": "./dist/index.mjs",
|
|
31
31
|
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
|
-
"main": "./dist/index.
|
|
34
|
-
"module": "./dist/index.
|
|
35
|
-
"types": "./dist/index.d.
|
|
33
|
+
"main": "./dist/index.mjs",
|
|
34
|
+
"module": "./dist/index.mjs",
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
36
36
|
"files": [
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"publint": "^0.3.15"
|
|
40
|
+
"publint": "^0.3.15",
|
|
41
|
+
"@sanity/parse-package-json": "^1.0.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
44
|
+
"@typescript/native-preview": "7.0.0-dev.20251201.1",
|
|
44
45
|
"tinyexec": "^1.0.2",
|
|
45
46
|
"tsdown": "^0.16.8",
|
|
46
47
|
"typescript": "5.9.3",
|
|
47
48
|
"vitest": "^4.0.14",
|
|
48
|
-
"@sanity/
|
|
49
|
-
"@sanity/
|
|
49
|
+
"@sanity/tsconfig": "^2.0.0",
|
|
50
|
+
"@sanity/pkg-utils": "^10.1.1"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"tsdown": "^0.16.8",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
63
|
"build": "tsdown",
|
|
64
|
+
"test": "vitest run",
|
|
63
65
|
"typecheck": "tsc --build"
|
|
64
66
|
}
|
|
65
67
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;AAKA;AAKA;UALiB,cAAA,SAAuB,KAAK;;;;iBAK7B,YAAA,WAAsB,iBAAsB"}
|
package/dist/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineConfig as defineConfig$1 } from "tsdown";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
function defineConfig(options = {}) {
|
|
7
|
-
return defineConfig$1({
|
|
8
|
-
tsconfig: options.tsconfig ?? "tsconfig.json",
|
|
9
|
-
platform: "neutral",
|
|
10
|
-
report: { gzip: false },
|
|
11
|
-
publint: true,
|
|
12
|
-
format: options.format ?? "esm",
|
|
13
|
-
inputOptions: { experimental: { attachDebugInfo: "none" } },
|
|
14
|
-
exports: {
|
|
15
|
-
enabled: "local-only",
|
|
16
|
-
devExports: "source"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { defineConfig };
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defineTsdownConfig"],"sources":["../src/index.ts"],"sourcesContent":["import {defineConfig as defineTsdownConfig, type UserConfig} from 'tsdown'\n\n/**\n * @public\n */\nexport interface PackageOptions extends Pick<UserConfig, 'tsconfig' | 'entry' | 'format'> {}\n\n/**\n * @public\n */\nexport function defineConfig(options: PackageOptions = {}): UserConfig {\n return defineTsdownConfig({\n tsconfig: options.tsconfig ?? 'tsconfig.json',\n platform: 'neutral',\n report: {gzip: false},\n publint: true,\n format: options.format ?? 'esm',\n inputOptions: {experimental: {attachDebugInfo: 'none'}},\n exports: {\n enabled: 'local-only',\n devExports: 'source',\n },\n })\n}\n"],"mappings":";;;;;AAUA,SAAgB,aAAa,UAA0B,EAAE,EAAc;AACrE,QAAOA,eAAmB;EACxB,UAAU,QAAQ,YAAY;EAC9B,UAAU;EACV,QAAQ,EAAC,MAAM,OAAM;EACrB,SAAS;EACT,QAAQ,QAAQ,UAAU;EAC1B,cAAc,EAAC,cAAc,EAAC,iBAAiB,QAAO,EAAC;EACvD,SAAS;GACP,SAAS;GACT,YAAY;GACb;EACF,CAAC"}
|