Skip to content

feat: add package.json exports #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@
"name": "typescript-transform-paths",
"version": "3.4.11",
"description": "Transforms module resolution paths using TypeScript path mapping and/or custom paths",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"main": "./dist/index.js",
"types": "types/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./register": "./register.js",
"./nx-transformer": "./nx-transformer.js"
},
"files": [
"dist",
"types",
"README.md",
"CHANGELOG.md",
"register.js",
"nx-transformer.js"
],
"scripts": {
"compile": "tsc",
"build": "yarn clean && yarn compile",
Expand Down Expand Up @@ -42,14 +59,6 @@
"Daniel Perez",
"Ron S. (https://twitter.com/Ron)"
],
"files": [
"dist",
"types",
"README.md",
"CHANGELOG.md",
"register.js",
"nx-transformer.js"
],
"devDependencies": {
"@eslint/js": "^9.8.0",
"@tsconfig/node18": "^18.2.4",
Expand Down
11 changes: 7 additions & 4 deletions test/tests/nx.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { execSync } from "node:child_process";
import { readFileSync, rmSync } from "node:fs";
import path from "node:path";

import ts from "typescript";

import { nxTransformerPlugin } from "typescript-transform-paths";
import path from "path";
import * as transformerModule from "../../dist/transformer";

import { projectsPaths } from "../config";
import { execSync } from "child_process";
import { readFileSync, rmSync } from "fs";
import * as transformerModule from "typescript-transform-paths/dist/transformer";

/* ****************************************************************************************************************** *
* Tests
Expand Down
8 changes: 5 additions & 3 deletions test/tests/register.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { register } from "typescript-transform-paths";
import { PluginConfig } from "ts-patch";
import * as tsNode from "ts-node";
import * as transformerModule from "typescript-transform-paths/dist/transformer";
import { REGISTER_INSTANCE } from "ts-node";
import { PluginConfig } from "ts-patch";
import { CustomTransformers, PluginImport, Program } from "typescript";

import { register } from "typescript-transform-paths";
import * as transformerModule from "../../dist/transformer";

import { ModuleNotFoundError } from "../utils";

/* ****************************************************************************************************************** *
Expand Down