Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
donchev7 committed Dec 22, 2023
0 parents commit 22e4f27
Show file tree
Hide file tree
Showing 81 changed files with 9,022 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "jacoblincool/d1-manager" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/gorgeous-pots-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"d1-manager": minor
---

Add CSV Support (Export / Import)
12 changes: 12 additions & 0 deletions .changeset/three-shoes-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"d1-manager": major
---

First Release for Web UI and API

- [x] Multiple D1 Databases
- [x] List all tables in a database
- [x] Show table schema
- [x] Run SQL queries
- [x] I18n support (English, Chinese)
- [x] API support
5 changes: 5 additions & 0 deletions .changeset/tricky-garlics-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"d1-manager": patch
---

Change D1 shim fallback logic
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu

ENV PNPM_HOME="/usr/local/share/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN export DEBIAN_FRONTEND=noninteractive && \
rm -f /bin/sh && \
ln -s /bin/bash /bin/sh && \
apt update && \
apt upgrade -y && \
apt install -y software-properties-common && \
add-apt-repository -y ppa:git-core/ppa && \
apt update && \
apt install -y git bash-completion htop jq lsof less curl zip unzip tree python3 build-essential && \
apt autoremove -y && \
rm -f /usr/bin/python && \
ln -s /usr/bin/python3 /usr/bin/python

RUN curl -fsSL https://get.pnpm.io/install.sh | sh - && \
pnpm env use -g lts && \
sudo rm -rf /tmp/* && \
chmod -R 777 /usr/local/share/pnpm

RUN pnpm i -g pnpm taze tsx prettier @changesets/cli serve
53 changes: 53 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "workspace",
"dockerComposeFile": "docker-compose.yml",
"service": "workspace",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"settings": {
"[svelte]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"[css]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"i18n-ally.localesPaths": ["locales"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.keepFulfilled": true,
"i18n-ally.extract.parsers.html": {
"attributes": ["text", "title", "alt", "placeholder", "label", "aria-label"],
"ignoredTags": ["script", "style"],
"inlineText": true
},
"i18n-ally.extract.autoDetect": true,
"i18n-ally.refactor.templates": [
{
"source": "html-attribute",
"templates": ["{$t('{key}'{args})}"],
"include": ["src/**/*.{svelte,ts}", "index.html"]
}
]
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"GitHub.copilot",
"GitHub.copilot-labs",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"antfu.iconify",
"lokalise.i18n-ally"
]
}
},
"onCreateCommand": "pnpm config set -g store-dir /workspace/node_modules/.pnpm-store",
"postStartCommand": "pnpm i"
}
10 changes: 10 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3.9"

services:
workspace:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace
command: sleep infinity
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
20 changes: 20 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
plugins: ["svelte3", "@typescript-eslint"],
ignorePatterns: ["*.cjs"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
settings: {
"svelte3/typescript": () => require("typescript"),
},
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
},
env: {
browser: true,
es2017: true,
node: true,
},
};
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
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"]
}
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]
with:
run_install: true

- name: Build
run: pnpm build

- name: Create Release Pull Request or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: pnpm changeset publish
version: pnpm changeset version
title: Release Packages
commit: bump versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/[email protected]
with:
run_install: true

# - name: Install Browser
# run: npx playwright install chromium --with-deps

- name: Build All
run: pnpm build

# - name: Run Tests
# run: pnpm test
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
4 changes: 4 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm i
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
20 changes: 20 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
printWidth: 100
tabWidth: 4
useTabs: true
trailingComma: all
semi: true
singleQuote: false

overrides:
- files: "*.md"
options:
useTabs: false
- files: "*.svelte"
options:
parser: svelte

plugins:
- prettier-plugin-tailwindcss
- prettier-plugin-organize-imports
- prettier-plugin-svelte
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"GitHub.copilot",
"GitHub.copilot-labs",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"antfu.iconify",
"lokalise.i18n-ally"
]
}
32 changes: 32 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"[svelte]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"[css]": {
"editor.formatOnSave": true
},
"[json]": {
"editor.formatOnSave": true
},
"i18n-ally.localesPaths": ["locales"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.keepFulfilled": true,
"i18n-ally.extract.parsers.html": {
"attributes": ["text", "title", "alt", "placeholder", "label", "aria-label"],
"ignoredTags": ["script", "style"],
"inlineText": true
},
"i18n-ally.extract.autoDetect": true,
"i18n-ally.refactor.templates": [
{
"source": "html-attribute",
"templates": ["{$t('{key}'{args})}"],
"include": ["src/**/*.{svelte,ts}", "index.html"]
}
],
"i18n-ally.sourceLanguage": "en"
}
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) 2023 JacobLinCool

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.
Loading

0 comments on commit 22e4f27

Please sign in to comment.