Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
insertish authored Mar 30, 2024
0 parents commit 4110b5d
Show file tree
Hide file tree
Showing 29 changed files with 3,746 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "no-only-tests", "eslint-comments"],
"ignorePatterns": ["node_modules", "dist", "dev", "tsup.config.ts", "vitest.config.ts"],
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": ".",
"sourceType": "module"
},
"rules": {
"prefer-const": "warn",
"no-console": "warn",
"no-debugger": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-useless-empty-export": "warn",
"no-only-tests/no-only-tests": "warn",
"eslint-comments/no-unused-disable": "warn"
}
}
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "🐛 Bug report"
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue :pray:.
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: Minimal Reproduction Link
description: |
Please provide a link to a minimal reproduction of the bug you are running into.
It makes the process of verifying and fixing the bug much easier.
Note:
- Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the solid-js and solid-primitives.
- To create a shareable code example you can use [Stackblitz](https://stackblitz.com/) (https://solid.new). Please no localhost URLs.
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
placeholder: |
e.g. https://stackblitz.com/edit/...... OR Github Repo
validations:
required: true
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Feature Request"
description: For feature/enhancement requests. Please search for existing issues first.
body:
- type: markdown
attributes:
value: |
Thank you for bringing your ideas here :pray:.
The more information you fill in, the better the community can understand your idea.
- type: textarea
id: problem
attributes:
label: Describe The Problem To Be Solved
description: Provide a clear and concise description of the challenge you are running into.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Suggest A Solution
description: |
A concise description of your preferred solution. Things to address include:
- Details of the technical implementation
- Tradeoffs made in design decisions
- Caveats and considerations for the future
validations:
required: true
46 changes: 46 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "30 1 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
upload: false
output: sarif-results

# Only include files that are public
- name: filter-sarif
uses: advanced-security/filter-sarif@main
with:
patterns: |
/src/**/*.*
-**/*.test.*
input: sarif-results/javascript.sarif
output: sarif-results/javascript.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: sarif-results/javascript.sarif
37 changes: 37 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Format

on:
push:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18

# "git restore ." discards changes to package-lock.json
- name: Install dependencies
run: |
pnpm install --no-frozen-lockfile --ignore-scripts
git restore .
- name: Format
run: pnpm run format

- name: Add, Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Format'
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: pnpm/action-setup@v2.2.4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test
env:
CI: true

- name: Lint
run: pnpm run lint
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
gitignore

# tsup
tsup.config.bundled_*.{m,c,}s
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 100,
"semi": false,
"singleQuote": true,
"useTabs": false,
"arrowParens": "avoid",
"bracketSpacing": true
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
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) 2022 {{me}}

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.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<p>
<img width="100%" src="https://assets.solidjs.com/banner?type={{name_of_lib}}&background=tiles&project=%20" alt="{{name_of_lib}}">
</p>

# {{name_of_lib}}

[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)

{{desc_of_lib}}

> **Note** After using this template, you have to search and replace all `{{name_of_lib}}` and similar strings
> with appropriate texts.
>
> `{{name_of_lib}}` should be a **kebab-case** string representing the name of you monorepo.
>
> `{{desc_of_lib}}` should be a **Normal case** string with the description of the repository.
>
> `{{me}}` should be a **kebab-case** string from your profile URL.
## Quick start

Install it:

```bash
npm i {{name_of_lib}}
# or
yarn add {{name_of_lib}}
# or
pnpm add {{name_of_lib}}
```

Use it:

```tsx
import {{name_of_lib}} from '{{name_of_lib}}'
```
33 changes: 33 additions & 0 deletions dev/App.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.App {
text-align: center;
}

.logo {
animation: logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}

.header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.link {
color: #b318f0;
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
30 changes: 30 additions & 0 deletions dev/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Component } from 'solid-js'
import logo from './logo.svg'
import styles from './App.module.css'
import { Hello } from '../src'

const App: Component = () => {
return (
<div class={styles.App}>
<header class={styles.header}>
<img src={logo} class={styles.logo} alt="logo" />
<h1>
<Hello></Hello>
</h1>
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
class={styles.link}
href="https://github.com/solidjs/solid"
target="_blank"
rel="noopener noreferrer"
>
Learn Solid
</a>
</header>
</div>
)
}

export default App
18 changes: 18 additions & 0 deletions dev/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>Solid App</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="./index.tsx" type="module"></script>
</body>

</html>
6 changes: 6 additions & 0 deletions dev/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { render } from 'solid-js/web'
import './styles.css'

import App from './App'

render(() => <App />, document.getElementById('root')!)
Loading

0 comments on commit 4110b5d

Please sign in to comment.