Skip to content

Commit

Permalink
⚙️ chore: Migrate to rslib (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrosenbauer authored Nov 15, 2024
1 parent 1b944d3 commit b8e1a03
Show file tree
Hide file tree
Showing 6 changed files with 695 additions and 1,311 deletions.
10 changes: 0 additions & 10 deletions .swcrc

This file was deleted.

2 changes: 2 additions & 0 deletions examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import fs from 'node:fs/promises';
import path from 'node:path';

const __dirname = path.dirname(new URL(import.meta.url).pathname);

import exampleBasic from './lib/basic';
import exampleCode from './lib/code';
import exampleTable from './lib/table';
Expand Down
39 changes: 18 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
"name": "@joggr/tempo",
"version": "0.10.0",
"description": "Library used to programmatically build markdown documents, with a heavy tilt toward GitHub Flavored Markdown (GFM).",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/umd/index.js",
"types": "./dist/types/index.d.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"README.md",
"package.json",
"dist/**/*"
"dist"
],
"scripts": {
"test": "vitest --coverage",
"build": "yarn build:esm && yarn build:umd && yarn build:types",
"build:esm": "swc ./src -d ./dist/esm --strip-leading-paths --delete-dir-on-start -C module.type=es6",
"build:umd": "swc ./src -d ./dist/umd --strip-leading-paths --delete-dir-on-start -C module.type=umd",
"build:types": "tsc --emitDeclarationOnly --outDir ./dist/types",
"generate:examples": "ts-node examples/index.ts",
"build": "rslib build",
"dev": "rslib build --watch",
"generate:examples": "tsx examples/index.ts",
"analyze": "biome check",
"analyze:ci": "biome ci --diagnostic-level=error",
"analyze:types": "tsc --noEmit",
Expand All @@ -40,14 +37,14 @@
},
"homepage": "https://github.com/joggrdocs/tempo#readme",
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.7.24",
"@types/node": "^22.5.4",
"@vitest/coverage-istanbul": "^2.0.5",
"@biomejs/biome": "^1.9.4",
"@rslib/core": "^0.0.18",
"@types/node": "^22.9.0",
"@vitest/coverage-istanbul": "^2.1.5",
"tsx": "^4.19.2",
"type-fest": "^4.26.1",
"typescript": "^5.6.2",
"vitest": "^2.0.5"
"typescript": "^5.6.3",
"vitest": "^2.1.5"
},
"packageManager": "yarn@4.4.1"
}
15 changes: 15 additions & 0 deletions rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from '@rslib/core';

export default defineConfig({
lib: [
{
format: 'esm',
syntax: 'es2021',
dts: true,
},
{
format: 'cjs',
syntax: 'es2021',
},
],
});
25 changes: 9 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
{
"compilerOptions": {
"incremental": true,
"module": "commonjs",
"lib": ["ES2021"],
"module": "ESNext",
"noEmit": true,
"strict": true,
"target": "ES2022",
"strictNullChecks": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"sourceMap": true,
"declaration": true,
"removeComments": false,
"lib": ["ES2022"],
"isolatedModules": true,
"resolveJsonModule": true,
"moduleResolution": "bundler",
"useDefineForClassFields": true,
"allowImportingTsExtensions": true,
"outDir": "./dist",
"baseUrl": "."
},
"typeRoots": ["node_modules/@types", "types"],
"include": ["types/**/*", "src/**/*"],
"include": ["src/**/*"],
"exclude": ["node_modules/**/*", "**/__tests__/**/*", "action.js"]
}
Loading

0 comments on commit b8e1a03

Please sign in to comment.