Skip to content

Commit

Permalink
chore: use Rslib for bootstrapping (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 authored Aug 15, 2024
1 parent d8e6876 commit 9adf980
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 1,550 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@changesets/cli": "^2.27.7",
"@modern-js/module-tools": "^2.55.0",
"@types/fs-extra": "^11.0.4",
"@types/node": "~18.19.39",
"check-dependency-version-consistency": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/bin/rslib.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { logger, prepareCli, runCli } from '../dist/index.js';
import { logger, prepareCli, runCli } from '../dist/main.js';

async function main() {
prepareCli();
Expand Down
65 changes: 0 additions & 65 deletions packages/core/modern.config.ts

This file was deleted.

10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
"exports": {
".": {
"types": "./dist-types/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"default": "./dist/main.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"main": "./dist/main.js",
"types": "./dist-types/index.d.ts",
"bin": {
"rslib": "./bin/rslib.js"
Expand All @@ -33,8 +32,8 @@
"compiled"
],
"scripts": {
"build": "modern build",
"dev": "modern build --watch",
"build": "rslib build",
"dev": "rslib build --watch",
"prebundle": "prebundle"
},
"dependencies": {
Expand All @@ -50,6 +49,7 @@
"memfs": "^4.11.1",
"picocolors": "1.0.1",
"prebundle": "1.1.0",
"rslib": "npm:@rslib/[email protected]",
"rslog": "^1.2.2",
"typescript": "^5.5.4"
},
Expand Down
32 changes: 32 additions & 0 deletions packages/core/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { defineConfig } from 'rslib';

export default defineConfig({
lib: [
{
format: 'esm',
output: {
syntax: ['node 16'],
},
dts: {
bundle: false,
distPath: './dist-types',
},
},
],
source: {
define: {
RSLIB_VERSION: JSON.stringify(require('./package.json').version),
},
entry: {
main: './src/index.ts',
},
},
output: {
target: 'node',
externals: {
picocolors: '../compiled/picocolors/index.js',
'fast-glob': '../compiled/fast-glob/index.js',
commander: '../compiled/commander/index.js',
},
},
});
38 changes: 0 additions & 38 deletions packages/plugin-dts/modern.config.ts

This file was deleted.

10 changes: 5 additions & 5 deletions packages/plugin-dts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"default": "./dist/index.js"
}
},
"main": "./dist/index.cjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "modern build",
"dev": "modern build --watch"
"build": "rslib build",
"dev": "rslib build --watch"
},
"dependencies": {
"fast-glob": "^3.3.2",
Expand All @@ -37,6 +36,7 @@
"@microsoft/api-extractor": "^7.47.5",
"@rsbuild/core": "1.0.1-beta.11",
"@rslib/tsconfig": "workspace:*",
"rslib": "npm:@rslib/[email protected]",
"typescript": "^5.5.4"
},
"peerDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/plugin-dts/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from 'rslib';

export default defineConfig({
lib: [
{
format: 'esm',
bundle: false,
output: {
syntax: ['node 16'],
},
dts: {
bundle: false,
},
},
],
source: {
entry: {
main: ['./src/**'],
},
},
output: {
target: 'node',
},
});
Loading

0 comments on commit 9adf980

Please sign in to comment.