Skip to content

Commit

Permalink
feat: Add extension to relative exports in declaration files (#29)
Browse files Browse the repository at this point in the history
* Add extension to relative imports/exports

* Update react integration

* Update other integrations
  • Loading branch information
lachlancollins authored Jan 26, 2024
1 parent 9d2ae1b commit 82f782a
Show file tree
Hide file tree
Showing 18 changed files with 312 additions and 21 deletions.
23 changes: 22 additions & 1 deletion integrations/react/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
{
"name": "react-integration",
"version": "0.0.0",
"private": true,
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"scripts": {
"test:build": "vite build && vitest"
"test:build": "vite build && vitest && publint --strict && attw --pack"
},
"dependencies": {
"@tanstack/query-core": "^5.17.19",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
8 changes: 8 additions & 0 deletions integrations/react/snap/cjs/index.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const queryCore = require("@tanstack/query-core");
const useClient = require("./use-client.cjs");
const nested = require("./nested/nested.cjs");
exports.Component = useClient.Component;
exports.test = nested.test;
Object.keys(queryCore).forEach((k) => {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
Object.defineProperty(exports, k, {
enumerable: true,
get: () => queryCore[k]
});
});
//# sourceMappingURL=index.cjs.map
2 changes: 1 addition & 1 deletion integrations/react/snap/cjs/index.cjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions integrations/react/snap/cjs/index.d.cts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './use-client';
export * from './nested/nested';
export * from '@tanstack/query-core';
export * from './use-client.cjs';
export * from './nested/nested.cjs';
5 changes: 3 additions & 2 deletions integrations/react/snap/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './use-client';
export * from './nested/nested';
export * from '@tanstack/query-core';
export * from './use-client.js';
export * from './nested/nested.js';
1 change: 1 addition & 0 deletions integrations/react/snap/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integrations/react/snap/esm/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integrations/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from '@tanstack/query-core'
export * from './use-client'
export * from './nested/nested'
22 changes: 21 additions & 1 deletion integrations/solid/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
{
"name": "solid-integration",
"version": "0.0.0",
"private": true,
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"scripts": {
"test:build": "vite build && vitest"
"test:build": "vite build && vitest && publint --strict && attw --pack"
},
"dependencies": {
"solid-js": "^1.8.11"
Expand Down
2 changes: 1 addition & 1 deletion integrations/solid/snap/cjs/index.d.cts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as App } from './App';
export { default as App } from './App.cjs';
2 changes: 1 addition & 1 deletion integrations/solid/snap/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as App } from './App';
export { default as App } from './App.js';
22 changes: 21 additions & 1 deletion integrations/vanilla/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
{
"name": "vanilla-integration",
"version": "0.0.0",
"private": true,
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"scripts": {
"test:build": "vite build && vitest"
"test:build": "vite build && vitest && publint --strict && attw --pack"
},
"devDependencies": {
"@tanstack/config": "<1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integrations/vanilla/snap/cjs/index.d.cts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './utils';
export * from './utils.cjs';
2 changes: 1 addition & 1 deletion integrations/vanilla/snap/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './utils';
export * from './utils.js';
22 changes: 21 additions & 1 deletion integrations/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
{
"name": "vue-integration",
"version": "0.0.0",
"private": true,
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"scripts": {
"test:build": "vite build && vitest"
"test:build": "vite build && vitest && publint --strict"
},
"dependencies": {
"vue": "^3.4.15"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"vite-plugin-externalize-deps": "^0.8.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.13.6",
"@types/current-git-branch": "^1.1.6",
"@types/eslint": "^8.56.2",
"@types/git-log-parser": "^1.2.3",
Expand Down
Loading

0 comments on commit 82f782a

Please sign in to comment.