Skip to content

Commit

Permalink
Rename and update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
alpheustangs committed Jul 20, 2024
1 parent 56bbfff commit 4bd81fb
Show file tree
Hide file tree
Showing 30 changed files with 1,747 additions and 2,242 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ For TypeScript / JavaScript environment:

```bash
# NPM
npm install @filego/ts
npm install @filego/js

# Yarn
yarn add @filego/ts
yarn add @filego/js

# PNPM
pnpm add @filego/ts
pnpm add @filego/js
```

For Node environment:
Expand Down Expand Up @@ -44,7 +44,7 @@ await split({
});
```

For the usage of `@filego/ts`, please refer to [docs/ts.md](./docs/ts.md).
For the usage of `@filego/js`, please refer to [docs/js.md](./docs/js.md).

For the usage of `@filego/node`, please refer to [docs/node.md](./docs/node.md).

Expand Down
20 changes: 10 additions & 10 deletions docs/ts.md → docs/js.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Usage of `@filego/ts`
# Usage of `@filego/js`

This documentation provides the usage of `@filego/ts`.
This documentation provides the usage of `@filego/js`.

## Installation

Install `@filego/ts` as a dependency:
Install `@filego/js` as a dependency:

```bash
# NPM
npm install @filego/ts
npm install @filego/js

# Yarn
yarn add @filego/ts
yarn add @filego/js

# PNPM
pnpm add @filego/ts
pnpm add @filego/js
```

## Functions

`@filego/ts` provides the following functions:
`@filego/js` provides the following functions:

#### `split`

This function splits file into chunks, and the chunks can be used to check and merge later. It will return the `chunks`, `fileSize` and `totalChunks`.

```typescript
import { split } from "@filego/ts";
import { split } from "@filego/js";

const file: File | Blob | Uint8Array | string = "";

Expand All @@ -41,7 +41,7 @@ await split({
This function checks file integrity by verifying the `chunks` with `fileSize` and `totalChunks` parameters. It will return the `status` and the `error` of the check.

```typescript
import { check } from "@filego/ts";
import { check } from "@filego/js";

await check({
chunks: [], // result from split function...
Expand All @@ -55,7 +55,7 @@ await check({
This function merges the chunks by using the `chunks` parameters. It will return the `blob` and `buffer` of the merged file.

```typescript
import { merge } from "@filego/ts";
import { merge } from "@filego/js";

await merge({
chunks: [], // result from split function...
Expand Down
2 changes: 1 addition & 1 deletion examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"preview": "vite preview"
},
"dependencies": {
"@filego/ts": "workspace:^",
"@filego/js": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FileChunk, SplitResult } from "@filego/ts";
import type { FileChunk, SplitResult } from "@filego/js";

import * as React from "react";

import { split } from "@filego/ts";
import { split } from "@filego/js";

type APIResponse<Data> = {
status: "success" | "error";
Expand Down
2 changes: 1 addition & 1 deletion examples/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import react from "@vitejs/plugin-react-swc";

export default defineConfig({
optimizeDeps: {
include: ["@filego/ts"],
include: ["@filego/js"],
},
server: {
port: 3001,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"private": true,
"scripts": {
"format": "biome check --write .",
"build": "npm-run-all --sequential build:shared build:node build:ts",
"build": "npm-run-all --sequential build:shared build:node build:js",
"build:shared": "cd ./packages/shared && tsc && tsc-alias",
"build:node": "cd ./packages/node && tsc && tsc-alias",
"build:ts": "cd ./packages/ts && tsc && tsc-alias",
"test": "npm-run-all --sequential test:shared test:node test:ts",
"build:js": "cd ./packages/js && tsc && tsc-alias",
"test": "npm-run-all --sequential test:shared test:node test:js",
"test:shared": "cd ./tests/shared && pnpm run build",
"test:node": "cd ./tests/node && pnpm run test",
"test:ts": "cd ./tests/ts && pnpm run test",
"test:js": "cd ./tests/js && pnpm run test",
"node": "cd ./examples/node && pnpm run dev",
"web": "cd ./examples/web && pnpm run dev",
"": ""
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/ts/README.md → packages/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A file splitting & merging solution.
Split file from a path with `split` function.

```typescript
import { split } from "@filego/ts";
import { split } from "@filego/js";

const file: File | Blob | Uint8Array | string = "";

Expand Down
10 changes: 5 additions & 5 deletions packages/ts/package.json → packages/js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@filego/ts",
"name": "@filego/js",
"version": "0.3.1",
"description": "A file splitting & merging solution",
"keywords": [
Expand All @@ -24,17 +24,17 @@
"js",
"JavaScript"
],
"homepage": "https://github.com/alpheustangs/filego.ts",
"bugs": "https://github.com/alpheustangs/filego.ts/issues",
"homepage": "https://github.com/alpheustangs/filego.js",
"bugs": "https://github.com/alpheustangs/filego.js/issues",
"license": "MIT",
"author": "Alpheus Tang",
"files": ["dist"],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/alpheustangs/filego.ts.git",
"directory": "packages/ts"
"url": "https://github.com/alpheustangs/filego.js.git",
"directory": "packages/js"
},
"dependencies": {
"@filego/shared": "workspace:~"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type CheckOptions = _CheckOptions & {
* ## Example
*
* ```typescript
* import { check } from "@filego/ts";
* import { check } from "@filego/js";
*
* await check({
* chunks: [], // result from split function...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type MergeOptions = _MergeOptions & {
* ## Example
*
* ```typescript
* import { merge } from "@filego/ts";
* import { merge } from "@filego/js";
*
* await merge({
* chunks: [], // result from split function...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ermsg: string =
* ## Example
*
* ```typescript
* import { split } from "@filego/ts";
* import { split } from "@filego/js";
*
* const file: File | Blob | Uint8Array | string = "";
*
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions packages/ts/tsconfig.json → packages/js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES5",
"module": "CommonJS",
"rootDir": "./src",
"baseUrl": ".",
"paths": {
Expand Down
6 changes: 3 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"js",
"JavaScript"
],
"homepage": "https://github.com/alpheustangs/filego.ts",
"bugs": "https://github.com/alpheustangs/filego.ts/issues",
"homepage": "https://github.com/alpheustangs/filego.js",
"bugs": "https://github.com/alpheustangs/filego.js/issues",
"license": "MIT",
"author": "Alpheus Tang",
"files": ["dist"],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/alpheustangs/filego.ts.git",
"url": "https://github.com/alpheustangs/filego.js.git",
"directory": "packages/node"
},
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES5",
"module": "CommonJS",
"rootDir": "./src",
"baseUrl": ".",
"paths": {
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"js",
"JavaScript"
],
"homepage": "https://github.com/alpheustangs/filego.ts",
"bugs": "https://github.com/alpheustangs/filego.ts/issues",
"homepage": "https://github.com/alpheustangs/filego.js",
"bugs": "https://github.com/alpheustangs/filego.js/issues",
"license": "MIT",
"author": "Alpheus Tang",
"files": ["dist"],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/alpheustangs/filego.ts.git",
"url": "https://github.com/alpheustangs/filego.js.git",
"directory": "packages/shared"
}
}
2 changes: 0 additions & 2 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES5",
"module": "CommonJS",
"rootDir": "./src",
"baseUrl": ".",
"paths": {
Expand Down
Loading

0 comments on commit 4bd81fb

Please sign in to comment.