Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Aug 31, 2023
0 parents commit 70a1d3f
Show file tree
Hide file tree
Showing 49 changed files with 7,604 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Browsers we support
Chrome >= 84
Firefox >= 90
Edge >= 84
Safari >= 15
iOS >= 15
opera >= 70
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: tannerlinsley
85 changes: 85 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: '🐛 Bug report'
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue :pray:.
This issue tracker is for reporting bugs found in `store` (https://github.com/tanstack/store).
If you have a question about how to achieve something and are struggling, please post a question
inside of `store` Discussions tab: https://github.com/tanstack/store/discussions
Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
- `store` Issues tab: https://github.com/tanstack/store/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
- `store` closed issues tab: https://github.com/tanstack/store/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
- `store` Discussions tab: https://github.com/tanstack/store/discussions
The more information you fill in, the better the community can help you.
- type: textarea
id: description
attributes:
label: Describe the bug
description: Provide a clear and concise description of the challenge you are running into.
validations:
required: true
- type: input
id: link
attributes:
label: Your Example Website or App
description: |
Which website or app were you using when the bug happened?
Note:
- Please provide a link via our pre-configured [Stackblitz project](https://stackblitz.com/github/tanstack/store/tree/beta/examples/react/quickstart?file=src%2Fmain.tsx) or a link to a repo that can reproduce the issue.
- Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `store` npm package / dependency.
- To create a shareable code example you can use Stackblitz. Please no localhost URLs.
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
placeholder: reproduction URL
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to Reproduce the Bug or Issue
description: Describe the steps we have to take to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: Provide a clear and concise description of what you expected to happen.
placeholder: |
As a user, I expected ___ behavior but i am seeing ___
validations:
required: true
- type: textarea
id: screenshots_or_videos
attributes:
label: Screenshots or Videos
description: |
If applicable, add screenshots or a video to help explain your problem.
For more information on the supported file image/file types and the file size limits, please refer
to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
placeholder: |
You can drag your video or image files inside of this editor ↓
- type: textarea
id: platform
attributes:
label: Platform
value: |
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any other context about the problem here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: 🤔 Feature Requests & Questions
url: https://github.com/tanstack/store/discussions
about: Please ask and answer questions here.
- name: 💬 Community Chat
url: https://discord.gg/mQd7egN
about: A dedicated discord server hosted by Tanner Linsley
- name: 💬 Tanstack Twitter
url: https://twitter.com/tan_stack
about: Stay up to date with new releases of our libraries
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ci
concurrency:
group: publish-${{ github.github.base_ref }}
cancel-in-progress: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
on:
push:
branches:
- 'main'
- 'beta'
jobs:
test-and-publish:
name: 'Test & Publish'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup Pnpm
uses: pnpm/[email protected]
with:
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.19.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm --filter "./packages/**" --prefer-offline install --no-frozen-lockfile
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
pnpm cipublish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pr
on: [pull_request]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup Pnpm
uses: pnpm/[email protected]
with:
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.19.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm --filter "./packages/**" --prefer-offline install --no-frozen-lockfile
- name: Build & Test
run: npx nx run-many --targets=test,build --projects=@tanstack/* --exclude=@tanstack/react-start
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.vite
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# builds
types
build
*/build
dist
lib
es
artifacts
.rpt2_cache
coverage
*.tgz

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.next

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.history
size-plugin.json
stats-hydration.json
stats-react.json
stats.html
.vscode/settings.json

*.log
.DS_Store
node_modules
.cache
dist
ts-perf

/examples/*/*/yarn.lock
/examples/*/*/package-lock.json

.netlify

nx-cloud.env
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.17.6
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

- Clone the repo
- `gh repo clone TanStack/store`
- Ensure `node` is installed
- https://nodejs.org/en/
- Ensure `pnpm` is installed
- https://pnpm.io/installation
- Why? We use `pnpm` to manage workspace dependencies. It's easily the best monorepo/workspace experience available as of when this was written.
- Install dependencies
- `pnpm install`
- This installs dependencies for all of the packages in the monorepo, even examples!
- Dependencies inside of the packages and examples are automatically linked together as local/dynamic dependencies.
- Run the build or dev watcher
- `pnpm build` or
- `pnpm dev`
- Navigate to an example
- `cd examples/react/basic`
- Run the example
- `pnpm dev`
- Make changes to the code
- If you ran `pnpm dev` the dev watcher will automatically rebuild the code that has changed
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Tanner Linsley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<img src="https://static.scarf.sh/a.png?x-pxid=d988eb79-b0fc-4a2b-8514-6a1ab932d188" />

![TanStack Store Header](https://github.com/tanstack/store/raw/beta/media/header.png)

🤖 Type-safe store w/ framework agnostic reactive adapters.

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://npmjs.com/package/@tanstack/store" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/store.svg" />
</a><a href="https://bundlephobia.com/result?p=@tanstack/store" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/store" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/tanstack/store/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/store"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=tanstack%2Fstore%26since=daily" /></a><a href="https://github.com/tanstack/store" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/tanstack/store.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tan_stack" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social&label=Follow @TanStack" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow @TannerLinsley" />
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)!

## Visit [tanstack.com/store](https://tanstack.com/store) for docs, guides, API and more!

<!-- Use the force, Luke! -->
49 changes: 49 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const { NODE_ENV, BABEL_ENV } = process.env
const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
const loose = true

module.exports = {
presets: [
[
'@babel/env',
{
loose,
modules: false,
bugfixes: true,
// useBuiltIns: false,
// exclude: ['@babel/plugin-transform-regenerator'],
},
],
'@babel/react',
'@babel/preset-typescript',
],
plugins: [
// 'babel-plugin-transform-async-to-promises',
cjs && ['@babel/transform-modules-commonjs', { loose }],
// [
// '@babel/transform-runtime',
// {
// useESModules: !cjs,
// version: require('./package.json').devDependencies[
// '@babel/runtime'
// ].replace(/^[^0-9]*/, ''),
// },
// ],
].filter(Boolean),
overrides: [
{
exclude: [
'./packages/solid-store/**',
'./packages/svelte-store/**',
'./packages/vue-store/**',
],
presets: ['@babel/react'],
},
{
include: [
'./packages/solid-store/**',
],
presets: ['babel-preset-solid'],
},
],
}
6 changes: 6 additions & 0 deletions docs/api/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: api
title: API Reference
---

# TODO
Loading

0 comments on commit 70a1d3f

Please sign in to comment.