@betterstore/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +3 -0
- package/.prettierrc +8 -0
- package/.vscode/settings.json +33 -0
- package/CONTRIBUTING.md +52 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +31 -0
- package/dist/index.mjs +6 -0
- package/package.json +31 -0
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
3
|
+
"editor.formatOnSave": true,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll": "explicit",
|
|
6
|
+
"source.organizeImports": "explicit"
|
|
7
|
+
},
|
|
8
|
+
"editor.quickSuggestionsDelay": 0,
|
|
9
|
+
"editor.acceptSuggestionOnEnter": "on",
|
|
10
|
+
"files.associations": {
|
|
11
|
+
".html": "html",
|
|
12
|
+
".ts": "typescript",
|
|
13
|
+
".tsx": "typescriptreact",
|
|
14
|
+
".prisma": "prisma",
|
|
15
|
+
".json": "json",
|
|
16
|
+
".js": "javascript",
|
|
17
|
+
"*.css": "tailwindcss",
|
|
18
|
+
".gitignore": "ignore"
|
|
19
|
+
},
|
|
20
|
+
"[prisma]": { "editor.defaultFormatter": "Prisma.prisma" },
|
|
21
|
+
"turboConsoleLog.addSemicolonInTheEnd": true,
|
|
22
|
+
"turboConsoleLog.delimiterInsideMessage": "-",
|
|
23
|
+
"turboConsoleLog.includeFileNameAndLineNum": false,
|
|
24
|
+
"turboConsoleLog.insertEmptyLineAfterLogMessage": false,
|
|
25
|
+
"turboConsoleLog.insertEmptyLineBeforeLogMessage": false,
|
|
26
|
+
"turboConsoleLog.logMessagePrefix": "",
|
|
27
|
+
"turboConsoleLog.logMessageSuffix": ": ",
|
|
28
|
+
"turboConsoleLog.wrapLogMessage": false,
|
|
29
|
+
"workbench.sideBar.location": "right",
|
|
30
|
+
"i18n-ally.localesPaths": ["messages"],
|
|
31
|
+
"i18n-ally.keystyle": "nested",
|
|
32
|
+
"i18n-ally.sourceLanguage": "en"
|
|
33
|
+
}
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing to Better Store SDK
|
|
2
|
+
|
|
3
|
+
π Thank you for your interest in contributing to **Better Store SDK**! Weβre building the best developer experience for eCommerce, and weβd love your help.
|
|
4
|
+
|
|
5
|
+
## π Getting Started
|
|
6
|
+
|
|
7
|
+
1. **Fork the repository** and clone your fork locally:
|
|
8
|
+
```sh
|
|
9
|
+
git clone https://github.com/your-username/better-store-sdk.git
|
|
10
|
+
cd better-store-sdk
|
|
11
|
+
```
|
|
12
|
+
2. **Install dependencies:**
|
|
13
|
+
```sh
|
|
14
|
+
npm install
|
|
15
|
+
```
|
|
16
|
+
3. **Run the tests to ensure everything is working:**
|
|
17
|
+
```sh
|
|
18
|
+
npm test
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## π Code Guidelines
|
|
22
|
+
|
|
23
|
+
- Use **TypeScript** for type safety.
|
|
24
|
+
- Follow **Prettier** and **ESLint** formatting.
|
|
25
|
+
- Keep PRs small and focused on a single issue.
|
|
26
|
+
- Write **unit tests** for any new functionality.
|
|
27
|
+
|
|
28
|
+
## π Submitting a Pull Request
|
|
29
|
+
|
|
30
|
+
1. **Create a feature branch:**
|
|
31
|
+
```sh
|
|
32
|
+
git checkout -b feature/new-feature
|
|
33
|
+
```
|
|
34
|
+
2. **Make your changes and commit them:**
|
|
35
|
+
```sh
|
|
36
|
+
git add .
|
|
37
|
+
git commit -m "β¨ Added new feature"
|
|
38
|
+
```
|
|
39
|
+
3. **Push your branch:**
|
|
40
|
+
```sh
|
|
41
|
+
git push origin feature/new-feature
|
|
42
|
+
```
|
|
43
|
+
4. **Open a Pull Request** on GitHub and describe your changes.
|
|
44
|
+
|
|
45
|
+
## π Reporting Issues
|
|
46
|
+
|
|
47
|
+
- Use the [GitHub Issues](https://github.com/your-org/better-store-sdk/issues) to report bugs and request features.
|
|
48
|
+
- Provide steps to reproduce bugs if possible.
|
|
49
|
+
|
|
50
|
+
## β€οΈ Thank You!
|
|
51
|
+
|
|
52
|
+
Your contributions make **Better Store SDK** awesome. Let's build a better eCommerce experience together! π
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Better Store
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Better Store SDK
|
|
2
|
+
|
|
3
|
+
π **Better Store SDK** is a modern, developer-friendly eCommerce toolkit designed to help developers build flexible and powerful online stores with ease.
|
|
4
|
+
|
|
5
|
+
## β¨ Features
|
|
6
|
+
|
|
7
|
+
- π **Custom Checkout** β Build checkout flows that suit your business needs.
|
|
8
|
+
- π³ **Payments** β Integrate with Stripe, PayPal, and custom gateways.
|
|
9
|
+
- π¦ **Product & Order Management** β API-driven store management.
|
|
10
|
+
- π¨ **Customizable UI** β Prebuilt components and themes.
|
|
11
|
+
- π‘ **Webhooks & API Events** β Extend and automate eCommerce operations.
|
|
12
|
+
- π **Optimized for DX** β Built with TypeScript and fully documented.
|
|
13
|
+
|
|
14
|
+
## π¦ Installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install better-store-sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## π Quick Start
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import { BetterStore } from "better-store-sdk";
|
|
24
|
+
|
|
25
|
+
const store = new BetterStore({ apiKey: "YOUR_API_KEY" });
|
|
26
|
+
|
|
27
|
+
store.checkout.start({
|
|
28
|
+
cart: [{ id: "prod_1", name: "T-Shirt", price: 20 }],
|
|
29
|
+
currency: "USD",
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## π Documentation
|
|
34
|
+
|
|
35
|
+
Full documentation is available at **[betterstore.dev](https://betterstore.dev)**.
|
|
36
|
+
|
|
37
|
+
## π€ Contributing
|
|
38
|
+
|
|
39
|
+
We welcome contributions! Please check the [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
40
|
+
|
|
41
|
+
## βοΈ License
|
|
42
|
+
|
|
43
|
+
This project is licensed under the [MIT License](./LICENSE).
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
hello: () => hello
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var hello = () => {
|
|
27
|
+
};
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
hello
|
|
31
|
+
});
|
package/dist/index.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterstore/sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "E-commerce for Developers",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
11
|
+
"lint": "tsc",
|
|
12
|
+
"format:check": "prettier --check --ignore-path .prettierignore .",
|
|
13
|
+
"format": "prettier --write --ignore-path .prettierignore .",
|
|
14
|
+
"ci": "pnpm run lint && pnpm run format:check && pnpm run build",
|
|
15
|
+
"release": "pnpm run ci && changeset publish"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"betterstore",
|
|
19
|
+
"ecommerce",
|
|
20
|
+
"storefront",
|
|
21
|
+
"storefronts"
|
|
22
|
+
],
|
|
23
|
+
"author": "Better Store",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@changesets/cli": "^2.28.1",
|
|
27
|
+
"prettier": "^3.5.3",
|
|
28
|
+
"tsup": "^8.4.0",
|
|
29
|
+
"typescript": "^5.8.2"
|
|
30
|
+
}
|
|
31
|
+
}
|