Skip to content
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

fix: use tsc-multi #10

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Expand Up @@ -84,7 +84,3 @@ crashlytics-build.properties

/lib
/module
/mjs
/esm
/cjs
/dts
55 changes: 11 additions & 44 deletions package.json
@@ -1,11 +1,10 @@
{
"name": "check-ends-with-period",
"version": "2.0.1",
"version": "2.0.2",
"description": "Check the text is ends with period mark.",
"keywords": [
"text",
"natural-language",
"nlp"
"natural-language"
],
"homepage": "https://github.com/azu/check-ends-with-period",
"bugs": {
Expand All @@ -18,48 +17,26 @@
"license": "MIT",
"author": "azu",
"type": "module",
"main": "lib/check-ends-with-period.cjs",
"module": "module/check-ends-with-period.js",
"types": "lib/check-ends-with-period.d.ts",
"exports": {
"./package.json": "./package.json",
"./*": {
"node": {
"import": "./mjs/*.mjs",
"require": "./cjs/*.cjs"
}
},
".": {
"types": "./dts/index.d.ts",
"browser": {
"module": "./esm/index.js",
"import": "./esm/index.js",
"default": "./lib/index.js"
},
"node": {
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
},
"default": "./lib/index.js"
"require": "./lib/check-ends-with-period.cjs",
"import": "./module/check-ends-with-period.js"
}
},
"main": "./cjs/index.cjs",
"module": "./esm/index.js",
"types": "./dts/index.d.ts",
"directories": {
"test": "test"
},
"files": [
"bin/",
"cjs/**/*.{cjs,mjs,map}",
"dts/**/*.d.ts",
"esm/**/*.{js,map}",
"lib/",
"lib/**/*.{js,map}",
"mjs/**/*.{mjs,map}",
"module/",
"src/",
"src/**/*.{ts,tsx,json}"
"src/"
],
"scripts": {
"build": "packemon build --addExports --declaration",
"build": "tsc -p . && tsc-multi",
"prepublishOnly": "npm run build",
"test": "mocha \"test/**/*.{js,ts}\"",
"watch": "tsc -p . --watch"
Expand All @@ -71,18 +48,8 @@
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.42",
"mocha": "^10.0.0",
"packemon": "^2.4.0",
"ts-node": "^10.8.1",
"tsc-multi": "^0.6.1",
"typescript": "^4.7.3"
},
"packemon": [
{
"format": "esm",
"platform": "browser"
},
{
"format": "cjs",
"platform": "node"
}
]
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion test/check-ends-with-period-test.ts
@@ -1,5 +1,5 @@
import assert from "node:assert";
import { checkEndsWithPeriod } from "../src/index.js";
import { checkEndsWithPeriod } from "../src/check-ends-with-period.js";
describe("check-ends-with-period", () => {
context("when period is end", () => {
it("should return valid:true result", () => {
Expand Down
4 changes: 4 additions & 0 deletions tsc-multi.json
@@ -0,0 +1,4 @@
{
"targets": [{ "extname": ".cjs" }],
"projects": ["tsconfig.cjs.json"]
}
8 changes: 8 additions & 0 deletions tsconfig.cjs.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"module": "CommonJS",
"moduleResolution": "Node"
},
}