Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebriday committed Jan 4, 2024
0 parents commit 5522482
Show file tree
Hide file tree
Showing 22 changed files with 6,181 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/env", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-typescript"]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// https://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: "@typescript-eslint/parser",
env: {
browser: true,
node: true,
es6: true,
},
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: ["standard", "prettier"],
plugins: ["@typescript-eslint"],
};
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint

on: [push]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: ".node-version"
cache: "yarn"
- run: |
yarn install --silent --non-interactive
yarn lint
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
build
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.github
jest
.babelrc
jest.config.js
index.html
netlify.toml
.node-version
.eslintrc.js
src
specs
tsconfig.json
vite.config.js
.prettierignore
postcss.config.js
tailwind.config.js
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
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) Guillaume Briday

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.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Stimulus Skeleton

[![](https://img.shields.io/npm/dt/stimulus-skeleton.svg)](https://www.npmjs.com/package/stimulus-skeleton)
[![](https://img.shields.io/npm/v/stimulus-skeleton.svg)](https://www.npmjs.com/package/stimulus-skeleton)
[![](https://github.com/stimulus-components/stimulus-skeleton/workflows/Lint/badge.svg)](https://github.com/stimulus-components/stimulus-skeleton)
[![](https://img.shields.io/github/license/stimulus-components/stimulus-skeleton.svg)](https://github.com/stimulus-components/stimulus-skeleton)

## Getting started

This repo is a template for a future Stimulus Components' controller.

1. Clone this repo
2. Find and rename every occurences of `StimulusSkeleton`, `stimulus-skeleton`, `Skeleton`, `skeleton`, `Stimulus Skeleton` and `TODO`.
3. Adapt the changelog
4. Removing the git folder and `git init` back again.
5. Create the Netlify site.
6. Create the docs on [stimulus-components.com](https://www.stimulus-components.com/).
7. Update Node and dependencies if needed.

## 📚 Documentation

See [stimulus-skeleton documentation](https://www.stimulus-components.com/docs/stimulus-skeleton/).

## 👷‍♂️ Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

## 📝 License

This project is released under the [MIT](http://opensource.org/licenses/MIT) license.
170 changes: 170 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="TODO" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Stimulus Skeleton</title>

<script type="module" defer>
import "./src/app.css";
import { Application } from "@hotwired/stimulus";
import Skeleton from "./src/index";

const application = Application.start();
application.register("skeleton", Skeleton);
</script>
</head>

<body>
<div class="relative bg-white overflow-hidden">
<div class="relative isolate pt-14">
<div
class="absolute inset-x-0 top-[calc(100%-13rem)] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[calc(100%-30rem)]"
aria-hidden="true"
>
<div
class="relative left-[calc(50%+3rem)] aspect-[1155/678] w-[36.125rem] -translate-x-1/2 bg-gradient-to-tr from-yellow-500 to-orange-500 opacity-30 sm:left-[calc(50%+36rem)] sm:w-[72.1875rem]"
style="
clip-path: polygon(
74.1% 44.1%,
100% 61.6%,
97.5% 26.9%,
85.5% 0.1%,
80.7% 2%,
72.5% 32.5%,
60.2% 62.4%,
52.4% 68.1%,
47.5% 58.3%,
45.2% 34.5%,
27.5% 76.7%,
0.1% 64.9%,
17.9% 100%,
27.6% 76.8%,
76.1% 97.7%,
74.1% 44.1%
);
"
></div>
</div>
</div>

<div class="relative pt-6 pb-16 sm:pb-24">
<main class="mt-16 mx-auto max-w-7xl px-4 sm:mt-24">
<div class="text-center">
<h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
<span class="block xl:inline">Stimulus</span>
<span class="block bg-gradient-to-r from-yellow-500 to-orange-500 xl:inline bg-clip-text text-transparent"
>Skeleton</span
>
</h1>

<p class="mt-3 max-w-md mx-auto text-base text-gray-500 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">TODO</p>

<p class="text-center mt-3">
<img class="inline-block" src="https://img.shields.io/npm/dt/stimulus-skeleton.svg" />
<img class="inline-block" src="https://img.shields.io/npm/v/stimulus-skeleton.svg" />

<img
class="inline-block"
src="https://github.com/stimulus-components/stimulus-skeleton/workflows/Lint/badge.svg"
/>

<img
class="inline-block"
src="https://img.shields.io/github/license/stimulus-components/stimulus-skeleton.svg"
/>
</p>

<div class="mt-5 max-w-md mx-auto sm:flex sm:justify-center md:mt-8">
<div class="rounded-md shadow">
<a
href="https://www.stimulus-components.com/docs/stimulus-skeleton/"
class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-gradient-to-r from-yellow-500 to-orange-500 md:py-4 md:text-lg md:px-10"
>
Documentation &rarr;
</a>
</div>
<div class="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
<a
href="https://github.com/stimulus-components/stimulus-skeleton"
class="w-full flex items-center justify-center gap-1 px-8 py-3 border border-transparent text-base font-medium rounded-md bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10"
>
<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" class="h-6 w-6">
<path
fill-rule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
clip-rule="evenodd"
></path>
</svg>
GitHub
</a>
</div>
</div>
</div>
</main>
</div>
</div>

<div class="relative h-full max-w-5xl mx-auto px-4">
<section class="mt-16">
<div data-controller="skeleton">TODO</div>
</section>
</div>

<footer class="bg-white">
<div class="max-w-7xl mx-auto py-12 px-4 overflow-hidden sm:px-6 lg:px-8">
<div class="-mx-5 -my-2 flex flex-wrap justify-center" aria-label="Footer">
<div class="px-5 py-2">
<p class="text-base text-gray-500">
stimulus-skeleton is a package from the
<a href="https://github.com/stimulus-components/stimulus-components" class="hover:text-gray-900 underline"
>stimulus-components</a
>
project.
</p>
</div>
</div>

<div class="mt-8 flex justify-center space-x-6">
<a
href="https://twitter.com/guillaumebriday"
target="_blank"
rel="noopener"
class="text-gray-400 hover:text-gray-500"
>
<span class="sr-only">Twitter</span>
<svg class="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"
/>
</svg>
</a>

<a
href="https://github.com/stimulus-components/stimulus-skeleton"
target="_blank"
rel="noopener"
class="text-gray-400 hover:text-gray-500"
>
<span class="sr-only">GitHub</span>
<svg class="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path
fill-rule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
clip-rule="evenodd"
/>
</svg>
</a>
</div>

<p class="mt-8 text-center text-base text-gray-400">
This project is released under the
<a href="https://opensource.org/licenses/MIT" class="hover:text-gray-900 underline">MIT</a>
license.
</p>
</div>
</footer>
</body>
</html>
9 changes: 9 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
publish="dist"
command="yarn prod"

[[redirects]]
from = "https://stimulus-skeleton.netlify.app/*"
to = "https://stimulus-skeleton.stimulus-components.com/:splat"
status = 301
force = true
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "stimulus-skeleton",
"version": "0.0.0",
"description": "TODO",
"keywords": [
"stimulus",
"stimulusjs",
"stimulus controller",
"TODO"
],
"repository": "git@github.com:stimulus-components/stimulus-skeleton.git",
"bugs": {
"url": "https://github.com/stimulus-components/stimulus-skeleton/issues"
},
"author": "Guillaume Briday <guillaumebriday@gmail.com>",
"license": "MIT",
"homepage": "https://github.com/stimulus-components/stimulus-skeleton",
"private": false,
"main": "dist/stimulus-skeleton.umd.js",
"module": "dist/stimulus-skeleton.mjs",
"scripts": {
"lint": "eslint --ext .js,.mjs,.ts . && prettier . --check",
"lintfix": "eslint --ext .js,.mjs,.ts . --fix && prettier . --write",
"dev": "vite",
"prod": "vite build --mode netlify",
"build": "tsc --noEmit && vite build",
"version": "yarn build",
"np": "np --no-2fa --no-tests"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.23.7",
"@babel/preset-typescript": "7.23.3",
"@hotwired/stimulus": "3.2.2",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"autoprefixer": "10.4.16",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.6.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-standard": "5.0.0",
"np": "9.2.0",
"postcss": "8.4.32",
"prettier": "3.1.1",
"tailwindcss": "3.4.0",
"typescript": "^5.3.3",
"vite": "5.0.10"
},
"peerDependencies": {
"@hotwired/stimulus": "3.2.1"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
3 changes: 3 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
connect(): void {
console.log("it works! ");
}
}
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
};
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"lib": ["dom", "es6"],
"types": ["vite/client", "jest"],
"skipLibCheck": true
}
}
Loading

0 comments on commit 5522482

Please sign in to comment.