Skip to content

Commit

Permalink
chore: init builder and loader
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Nov 24, 2023
1 parent 58e93c4 commit f6f79e7
Show file tree
Hide file tree
Showing 16 changed files with 240 additions and 86 deletions.
7 changes: 7 additions & 0 deletions packages/builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @epubook/builder

[![version](https://img.shields.io/npm/v/@epubook/builder?color=rgb%2850%2C203%2C86%29&label=@epubook/builder)](https://www.npmjs.com/package/@epubook/builder) [![CI](https://github.com/yjl9903/epubook/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/epubook/actions/workflows/ci.yml)

## License

MIT License © 2023 [XLor](https://github.com/yjl9903)
14 changes: 14 additions & 0 deletions packages/builder/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineBuildConfig } from 'unbuild';

import { UnbuildPreset } from './src/unbuild';

export default defineBuildConfig({
entries: ['src/index'],
declaration: true,
clean: true,
externals: ['unbuild', 'rollup'],
rollup: {
emitCJS: true
},
preset: UnbuildPreset({ inject: false })
});
55 changes: 55 additions & 0 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@epubook/builder",
"version": "0.0.11",
"description": "",
"keywords": [
"ebook",
"epub",
"epub-generator",
"epubook"
],
"homepage": "https://github.com/yjl9903/epubook#readme",
"bugs": {
"url": "https://github.com/yjl9903/epubook/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/yjl9903/epubook.git"
},
"license": "MIT",
"author": "XLor",
"sideEffects": false,
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"format": "prettier --write src/**/*.{ts,tsx} test/**/*.{ts,tsx}",
"test": "vitest",
"test:ci": "vitest --run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"defu": "^6.1.3",
"fast-xml-parser": "^4.3.2",
"fflate": "^0.8.1",
"pathe": "^1.1.1"
},
"devDependencies": {
"rollup": "^4.5.2",
"vitest": "^0.34.6"
},
"engines": {
"node": ">=v18.16.0"
}
}
1 change: 1 addition & 0 deletions packages/builder/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const one = 1;
7 changes: 7 additions & 0 deletions packages/builder/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from 'vitest';

describe('hello', () => {
it('should work', () => {
expect('Hello').toEqual('Hello');
});
});
4 changes: 4 additions & 0 deletions packages/builder/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["./src/**/*"]
}
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @epubook/core

[![version](https://img.shields.io/npm/v/@epubook/core?color=rgb%2850%2C203%2C86%29&label=@epubook/core)](https://www.npmjs.com/package/@epubook/theme-core) [![CI](https://github.com/yjl9903/epubook/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/epubook/actions/workflows/ci.yml)
[![version](https://img.shields.io/npm/v/@epubook/core?color=rgb%2850%2C203%2C86%29&label=@epubook/core)](https://www.npmjs.com/package/@epubook/core) [![CI](https://github.com/yjl9903/epubook/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/epubook/actions/workflows/ci.yml)

The fundamental module of [epubook](https://github.com/yjl9903/epubook). It provides low-level API for generating EPUB books.

Expand Down
2 changes: 2 additions & 0 deletions packages/epubook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@epubook/builder": "workspace:*",
"@epubook/core": "workspace:*",
"@epubook/loader": "workspace:*",
"@epubook/theme-default": "workspace:*"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions packages/loader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @epubook/loader

[![version](https://img.shields.io/npm/v/@epubook/loader?color=rgb%2850%2C203%2C86%29&label=@epubook/loader)](https://www.npmjs.com/package/@epubook/loader) [![CI](https://github.com/yjl9903/epubook/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/epubook/actions/workflows/ci.yml)

## License

MIT License © 2023 [XLor](https://github.com/yjl9903)
14 changes: 14 additions & 0 deletions packages/loader/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineBuildConfig } from 'unbuild';

import { UnbuildPreset } from './src/unbuild';

export default defineBuildConfig({
entries: ['src/index'],
declaration: true,
clean: true,
externals: ['unbuild', 'rollup'],
rollup: {
emitCJS: true
},
preset: UnbuildPreset({ inject: false })
});
55 changes: 55 additions & 0 deletions packages/loader/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@epubook/loader",
"version": "0.0.11",
"description": "",
"keywords": [
"ebook",
"epub",
"epub-generator",
"epubook"
],
"homepage": "https://github.com/yjl9903/epubook#readme",
"bugs": {
"url": "https://github.com/yjl9903/epubook/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/yjl9903/epubook.git"
},
"license": "MIT",
"author": "XLor",
"sideEffects": false,
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"format": "prettier --write src/**/*.{ts,tsx} test/**/*.{ts,tsx}",
"test": "vitest",
"test:ci": "vitest --run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"defu": "^6.1.3",
"fast-xml-parser": "^4.3.2",
"fflate": "^0.8.1",
"pathe": "^1.1.1"
},
"devDependencies": {
"rollup": "^4.5.2",
"vitest": "^0.34.6"
},
"engines": {
"node": ">=v18.16.0"
}
}
1 change: 1 addition & 0 deletions packages/loader/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const one = 1;
7 changes: 7 additions & 0 deletions packages/loader/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from 'vitest';

describe('hello', () => {
it('should work', () => {
expect('Hello').toEqual('Hello');
});
});
4 changes: 4 additions & 0 deletions packages/loader/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["./src/**/*"]
}
5 changes: 3 additions & 2 deletions packages/theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@epubook/core": "workspace:*"
"@epubook/core": "workspace:*",
"@epubook/builder": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.10.0"
Expand All @@ -56,4 +57,4 @@
],
"images": []
}
}
}

0 comments on commit f6f79e7

Please sign in to comment.