@betterstore/react 0.0.3
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/CHANGELOG.md +26 -0
- package/CONTRIBUTING.md +52 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/checkout/CheckoutProvider.d.ts +2 -0
- package/dist/index.cjs.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +7 -0
- package/package.json +46 -0
- package/rollup.config.mjs +19 -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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @betterstore/sdk
|
|
2
|
+
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cicd debug, readme changed
|
|
8
|
+
|
|
9
|
+
## 0.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- initial commit, cicd setup
|
|
14
|
+
|
|
15
|
+
## 0.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 372cbbc: checkout create method added
|
|
20
|
+
- cicd test
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 6d0e6e4: ci cd test
|
|
25
|
+
- 6769d53: Change sets added, debug
|
|
26
|
+
- fd3f4da: npm ignore added
|
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,34 @@
|
|
|
1
|
+
# Better Store SDK
|
|
2
|
+
|
|
3
|
+
π **Better Store SDK** is a modern, developer-friendly sdk toolkit designed to help developers build flexible and powerful e-commerce stores with ease.
|
|
4
|
+
|
|
5
|
+
## π¦ Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @betterstore/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## π Quick Start
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { BetterStore } from "@betterstore/sdk";
|
|
15
|
+
|
|
16
|
+
const betterStore = new BetterStore("YOUR_API_KEY");
|
|
17
|
+
|
|
18
|
+
betterStore.checkout.create({
|
|
19
|
+
type: "hosted",
|
|
20
|
+
lineItems: [{ productId: "example_id", quantity: 1 }],
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## π Documentation
|
|
25
|
+
|
|
26
|
+
Full documentation is available at **[betterstore.io](https://betterstore.io)**.
|
|
27
|
+
|
|
28
|
+
## π€ Contributing
|
|
29
|
+
|
|
30
|
+
We welcome contributions! Please check the [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
31
|
+
|
|
32
|
+
## βοΈ License
|
|
33
|
+
|
|
34
|
+
This project is licensed under the [MIT License](./LICENSE).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckoutProvider } from "./checkout/CheckoutProvider";
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterstore/react",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "E-commerce for Developers",
|
|
5
|
+
"private": false,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.mjs",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"betterstore",
|
|
14
|
+
"ecommerce",
|
|
15
|
+
"storefront",
|
|
16
|
+
"storefronts"
|
|
17
|
+
],
|
|
18
|
+
"author": "Better Store",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@changesets/cli": "^2.28.1",
|
|
22
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
23
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
24
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
25
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
26
|
+
"@types/react": "^19.0.10",
|
|
27
|
+
"babel-preset-react": "^6.24.1",
|
|
28
|
+
"prettier": "^3.5.3",
|
|
29
|
+
"rollup": "^4.34.9",
|
|
30
|
+
"tslib": "^2.8.1",
|
|
31
|
+
"tsup": "^8.4.0",
|
|
32
|
+
"typescript": "^5.8.2"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^19.0.0",
|
|
36
|
+
"react-dom": "^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rollup -c",
|
|
40
|
+
"lint": "tsc",
|
|
41
|
+
"format:check": "prettier --check --ignore-path .prettierignore .",
|
|
42
|
+
"format": "prettier --write --ignore-path .prettierignore .",
|
|
43
|
+
"ci": "pnpm run lint && pnpm run format:check && pnpm run build",
|
|
44
|
+
"release": "pnpm run ci && changeset publish"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
2
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
3
|
+
import typescript from "@rollup/plugin-typescript";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
input: "src/index.ts",
|
|
7
|
+
output: [
|
|
8
|
+
{
|
|
9
|
+
file: "dist/index.cjs.js",
|
|
10
|
+
format: "cjs",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
file: "dist/index.esm.js",
|
|
14
|
+
format: "esm",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
plugins: [resolve(), commonjs(), typescript()],
|
|
18
|
+
external: ["react", "react-dom"],
|
|
19
|
+
};
|