Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
octoper committed May 3, 2023
0 parents commit 64c44ae
Show file tree
Hide file tree
Showing 80 changed files with 15,483 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = true
26 changes: 26 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { StorybookConfig } from 'storybook-framework-qwik';
import { qwikVite } from '@builder.io/qwik/optimizer';

const config: StorybookConfig = {
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
framework: {
name: 'storybook-framework-qwik',
},
core: {
renderer: 'storybook-framework-qwik',
},
stories: [
// ...rootMain.stories,
'../packages/hooks/src/**/*.stories.@(js|jsx|ts|tsx)',
],

viteFinal(config) {
config.plugins = config.plugins || []
config.plugins.push(qwikVite({
srcDir: './playground/src',
}))
return config;
},
};

export default config;
4 changes: 4 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script>
window.global = window;
</script>
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
17 changes: 17 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Parameters } from 'storybook-framework-qwik';

export const parameters: Parameters = {
a11y: {
config: {},
options: {
checks: { 'color-contrast': { options: { noScroll: true } } },
restoreScroll: true,
},
},
options: {
showRoots: true,
},
docs: {
iframeHeight: '200px',
},
};
19 changes: 19 additions & 0 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},

"exclude": ["../**/*.spec.ts", "../**/*.test.ts", "../**/*.spec.tsx", "../**/*.test.tsx"],
"include": [
"../packages/**/*.stories.ts",
"../packages/**/*.stories.js",
"../packages/**/*.stories.jsx",
"../packages/**/*.stories.tsx",
"../packages/**/*.stories.mdx",
"*.ts",
"*.js",
"preview.tsx"
]
}
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Vaggelis Yfantis

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.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Qwiky (WIP)

> **This is a WIP, please don't use it in production a lot of things will break as we move forward with the development.**
Qwiky is a collection of utilities, hooks and components for building awesome apps with [Qwik](https://qwik.builder.io/)


## 🦄 Hooks
Collection of essential Qwik Hooks

## 📦 Getting Started - (Not working at the moment)
```shell
npm install @qwiky/hooks
# or
pnpm add @qwiky/hooks
# or
yarn add @qwiky/hooks
```

## 🎨 TODO: Components
UI component Library


# 🏗️ Contribute

1. Fork it!
2. Create your feature branch: git checkout -b feat/new-hook
3. Commit your changes: git commit -am 'feat(hooks): add a new hook'
4. Push to the branch: git push origin feat/new-hook
5. Submit a pull request :D


## 🤩 Thanks

This project is heavily inspired by the following awesome projects.

- [vueuse/vueuse](https://github.com/vueuse/vueuse)
- [mantinedev/mantine](https://github.com/mantinedev/mantine)
- [streamich/react-use](https://github.com/streamich/react-use)

Also thanks to the [Qwik Team](https://github.com/builderio/qwik)

And thanks to [all the contributors on GitHub](https://github.com/octoper/qwiky/contributors)!

## 📄 License

[MIT License](LICENSE) © 2023 [Vaggelis Yfantis](https://github.com/octoper)
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"private": true,
"type": "module",
"scripts": {
"build": "turbo run build --filter='./packages/**'",
"dev": "turbo run dev --filter='./packages/**'",
"play": "turbo run dev --filter='./playground/'",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"typecheck": "tsc --noEmit",
"test": "vitest",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"devDependencies": {
"@builder.io/qwik": "^1.0.0",
"@storybook/addon-essentials": "7.0.7",
"@storybook/addon-links": "7.0.7",
"@storybook/blocks": "7.0.7",
"@storybook/builder-vite": "7.0.7",
"@storybook/html": "7.0.7",
"@storybook/html-vite": "7.0.7",
"@types/jsdom": "^21.1.1",
"eslint": "^8.39.0",
"esno": "^0.16.3",
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"storybook": "7.0.7",
"storybook-framework-qwik": "0.2.0",
"turbo": "^1.9.3",
"typescript": "^5.0.4",
"vite": "^4.3.3",
"vite-plugin-dts": "^2.3.0",
"vitest": "^0.30.1"
}
}
31 changes: 31 additions & 0 deletions packages/hooks/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
**/*.log
**/.DS_Store
*.
.vscode/settings.json
.history
.yarn
bazel-*
bazel-bin
bazel-out
bazel-qwik
bazel-testlogs
dist
dist-dev
lib
lib-types
etc
external
node_modules
temp
tsc-out
tsdoc-metadata.json
target
output
rollup.config.js
build
.cache
.vscode
.rollup.cache
dist
tsconfig.tsbuildinfo
vite.config.ts
41 changes: 41 additions & 0 deletions packages/hooks/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:qwik/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'prefer-spread': 'off',
'no-case-declarations': 'off',
'no-console': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'qwik/use-method-usage': 'off',
},
};
38 changes: 38 additions & 0 deletions packages/hooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Build
/dist
/lib
/lib-types
/server

# Development
node_modules

# Cache
.cache
.mf
.vscode
.rollup.cache
tsconfig.tsbuildinfo

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Yarn
.yarn/*
!.yarn/releases
6 changes: 6 additions & 0 deletions packages/hooks/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Files Prettier should not format
**/*.log
**/.DS_Store
*.
dist
node_modules
11 changes: 11 additions & 0 deletions packages/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 🦄 Qwiky Hooks
Collection of essential Qwik Hooks

## 📦 Getting Started - (Not working at the moment)
```shell
npm install @qwiky/hooks
# or
pnpm add @qwiky/hooks
# or
yarn add @qwiky/hooks
```
45 changes: 45 additions & 0 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@qwiky/hooks",
"main": "./dist/index.qwik.mjs",
"qwik": "./dits/index.qwik.mjs",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"import": "./dist/index.qwik.mjs",
"require": "./dist/index.qwik.cjs",
"types": "./dist/types/index.d.ts"
}
},
"files": [
"dist",
"README.md"
],
"engines": {
"node": ">=15.0.0"
},
"private": false,
"type": "module",
"scripts": {
"clean": "rm -rf dist",
"build": "vite build --mode lib",
"dev": "vite build --mode lib --watch",
"lint": "eslint \"src/**/*.ts*\"",
"lint:fix": "pnpm run lint --fix"
},
"peerDependencies": {
"@builder.io/qwik": "1.0.0"
},
"devDependencies": {
"@types/eslint": "8.37.0",
"@types/node": "^18.16.1",
"@typescript-eslint/eslint-plugin": "5.59.1",
"@typescript-eslint/parser": "5.59.1",
"eslint": "8.39.0",
"eslint-plugin-qwik": "latest",
"np": "7.6.1",
"prettier": "2.8.8",
"typescript": "5.0.4",
"undici": "5.22.0",
"vite": "4.3.3"
}
}
14 changes: 14 additions & 0 deletions packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export * from './useActiveElement'
export * from './useNetwork'
export * from './useWindowScroll'
export * from './useWindowSize'
export * from './useWindowFocus'
export * from './useIdle'
export * from './useHover'
export * from './useLastChanged'
export * from './useDocumentVisibility'
export * from './useTitle'
export * from './useTextSelection'
export * from './useMediaQuery'
export * from './useIntersectionObserver'
export * from './useMouse'
Loading

0 comments on commit 64c44ae

Please sign in to comment.