Skip to content

Commit

Permalink
Fixed build config
Browse files Browse the repository at this point in the history
  • Loading branch information
ngo275 committed Oct 21, 2024
1 parent 008d5a1 commit 6f696e0
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 32 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What is this?

This library is a TypeScript library for retrieving public data from the App Store. For example, you can get app details, ratings, reviews, similar apps, and privacy information of other apps.
This library is a TypeScript library for retrieving public data from the App Store. For example, you can get app details, ratings, reviews, similar apps, and privacy information.

Note that it is different from App Connect API, which focuses on providing API about your app, such as app sales, ratings, reviews, etc.

Expand Down Expand Up @@ -52,6 +52,17 @@ const appData = await client.app({ id: "6446901002" });

// Or use app ID (bundle ID)
const appData = await client.app({ appId: "com.burbn.barcelona" });

console.log(appData);

// {
// id: '6446901002',
// appId: 'com.burbn.barcelona',
// title: 'Threads',
// url: 'https://apps.apple.com/us/app/threads/id6446901002?uo=4',
// description: 'Say more with Threads — Instagram’s text-based conversation app.\n' +
// ...
// }
```

### Get Apps by Developer
Expand Down Expand Up @@ -80,7 +91,6 @@ const topFreeApps = await client.list({
You can get privacy details by ID. You must provide the ID.

```typescript
// Use app ID
const privacy = await client.privacy({ id: "6446901002" });
```

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app-store-client",
"description": "A TypeScript client for the Apple App Store API",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"author": "Shu",
"main": "dist/index.cjs.js",
Expand All @@ -12,13 +12,14 @@
"build": "rollup -c --bundleConfigAsCjs",
"start": "node dist/index.js",
"test": "jest",
"prepare": "husky"
"prepare": "husky",
"prepublishOnly": "yarn build"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
},
"files": [
"dist/**/*"
"dist"
],
"devDependencies": {
"@eslint/js": "^9.12.0",
Expand All @@ -35,6 +36,7 @@
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"rollup": "^4.24.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^29.2.5",
"tslib": "^2.8.0",
Expand Down
54 changes: 32 additions & 22 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
import typescript from "@rollup/plugin-typescript";
import { terser } from "rollup-plugin-terser";
import { dts } from "rollup-plugin-dts";

export default {
input: "src/index.ts",
output: [
{
file: "dist/index.cjs.js",
format: "cjs",
sourcemap: true,
},
{
file: "dist/index.esm.js",
format: "es",
sourcemap: true,
},
],
plugins: [
typescript({
tsconfig: "./tsconfig.json",
}),
terser(), // Minifies the output bundle
],
external: ["memoizee", "xml2js", "util", "cheerio", "axios"],
};
export default [
{
input: "src/index.ts",
output: [
{
file: "dist/index.cjs.js",
format: "cjs",
sourcemap: true,
},
{
file: "dist/index.esm.js",
format: "es",
sourcemap: true,
},
],
plugins: [
typescript({
tsconfig: "./tsconfig.json",
declaration: true,
declarationDir: "./dist",
}),
terser(), // Minifies the output bundle
],
external: ["memoizee", "xml2js", "util", "cheerio", "axios"],
},
{
input: "./dist/index.d.ts",
output: [{ file: "dist/index.d.ts", format: "es" }],
plugins: [dts()],
},
];
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "NodeNext",
"module": "ESNext",
"moduleResolution": "node",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true
"esModuleInterop": true,
"declaration": true,
"declarationDir": "./dist",
"sourceMap": true,
"rootDir": "./src"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "**/*.test.ts"]
}
20 changes: 18 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.24"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.25.7":
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.24.2", "@babel/code-frame@^7.25.7":
version "7.25.7"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.7.tgz#438f2c524071531d643c6f0188e1e28f130cebc7"
integrity sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==
Expand Down Expand Up @@ -607,7 +607,7 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.25"

"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14":
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a"
integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==
Expand Down Expand Up @@ -2746,6 +2746,13 @@ lru-queue@^0.1.0:
dependencies:
es5-ext "~0.10.2"

magic-string@^0.30.10:
version "0.30.12"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.12.tgz#9eb11c9d072b9bcb4940a5b2c2e1a217e4ee1a60"
integrity sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==
dependencies:
"@jridgewell/sourcemap-codec" "^1.5.0"

make-dir@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e"
Expand Down Expand Up @@ -3173,6 +3180,15 @@ rfdc@^1.4.1:
resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca"
integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==

rollup-plugin-dts@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-dts/-/rollup-plugin-dts-6.1.1.tgz#46b33f4d1d7f4e66f1171ced9b282ac11a15a254"
integrity sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==
dependencies:
magic-string "^0.30.10"
optionalDependencies:
"@babel/code-frame" "^7.24.2"

rollup-plugin-terser@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d"
Expand Down

0 comments on commit 6f696e0

Please sign in to comment.