Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 6e03eab

Browse files
Updating config and move package to organization
1 parent b9100e1 commit 6e03eab

File tree

15 files changed

+2541
-2527
lines changed

15 files changed

+2541
-2527
lines changed

.babelrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"presets": [
3-
"@babel/env",
4-
"@babel/preset-typescript"
5-
],
2+
"presets": ["@babel/env", "@babel/preset-typescript"],
63
"plugins": ["@babel/plugin-transform-typescript"]
74
}

.eslintrc.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// https://eslint.org/docs/user-guide/configuring
22

33
module.exports = {
4+
root: true,
5+
parser: "@typescript-eslint/parser",
46
env: {
57
browser: true,
68
node: true,
7-
es6: true
9+
es6: true,
10+
jest: true,
811
},
9-
parserOptions: {
10-
sourceType: "module"
11-
}
12+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
13+
extends: ["standard", "prettier"],
14+
plugins: ["@typescript-eslint"],
1215
}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v2
1111
with:
12-
node-version-file: '.node-version'
13-
cache: 'yarn'
12+
node-version-file: ".node-version"
13+
cache: "yarn"
1414
- run: |
1515
yarn install --silent --non-interactive
1616
yarn lint

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

.npmignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
.github
2+
jest
23
.babelrc
4+
jest.config.js
35
index.html
46
netlify.toml
57
.node-version
68
.eslintrc.js
7-
src
8-
specs
9+
spec
910
tsconfig.json
10-
vite.config.js
11+
vite.config.mjs
1112
.prettierignore
12-
.prettierrc
13-
.eslintignore
1413
postcss.config.js
1514
tailwind.config.js

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"printWidth": 120
2+
"printWidth": 120,
3+
"semi": false
34
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [5.0.0] - 2024-03-17
10+
11+
### Chore
12+
13+
- Renaming the component from `stimulus-content-loader` to `@stimulus-components/content-loader`
14+
- Upgrading dependencies
15+
- Exporting Typescript Types
16+
- Updating demo UI
17+
- Add [Stimulus LSP](https://github.com/marcoroth/stimulus-lsp) compatibility
18+
919
## [4.2.0] - 2023-08-08
1020

1121
### Added

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Guillaume Briday
3+
Copyright (c) Guillaume Briday
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

index.html

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
@@ -26,52 +26,35 @@
2626
</head>
2727

2828
<body>
29-
<!-- This example requires Tailwind CSS v2.0+ -->
30-
<div class="relative bg-gray-50 overflow-hidden">
31-
<div class="hidden sm:block sm:absolute sm:inset-y-0 sm:h-full sm:w-full" aria-hidden="true">
32-
<div class="relative h-full max-w-7xl mx-auto">
33-
<svg
34-
class="absolute right-full transform translate-y-1/4 translate-x-1/4 lg:translate-x-1/2"
35-
width="404"
36-
height="784"
37-
fill="none"
38-
viewBox="0 0 404 784"
39-
>
40-
<defs>
41-
<pattern
42-
id="f210dbf6-a58d-4871-961e-36d5016a0f49"
43-
x="0"
44-
y="0"
45-
width="20"
46-
height="20"
47-
patternUnits="userSpaceOnUse"
48-
>
49-
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
50-
</pattern>
51-
</defs>
52-
<rect width="404" height="784" fill="url(#f210dbf6-a58d-4871-961e-36d5016a0f49)" />
53-
</svg>
54-
<svg
55-
class="absolute left-full transform -translate-y-3/4 -translate-x-1/4 md:-translate-y-1/2 lg:-translate-x-1/2"
56-
width="404"
57-
height="784"
58-
fill="none"
59-
viewBox="0 0 404 784"
60-
>
61-
<defs>
62-
<pattern
63-
id="5d0dd344-b041-4d26-bec4-8d33ea57ec9b"
64-
x="0"
65-
y="0"
66-
width="20"
67-
height="20"
68-
patternUnits="userSpaceOnUse"
69-
>
70-
<rect x="0" y="0" width="4" height="4" class="text-gray-200" fill="currentColor" />
71-
</pattern>
72-
</defs>
73-
<rect width="404" height="784" fill="url(#5d0dd344-b041-4d26-bec4-8d33ea57ec9b)" />
74-
</svg>
29+
<div class="relative bg-white overflow-hidden">
30+
<div class="relative isolate pt-14">
31+
<div
32+
class="absolute inset-x-0 top-[calc(100%-13rem)] -z-10 transform-gpu overflow-hidden blur-3xl sm:top-[calc(100%-30rem)]"
33+
aria-hidden="true"
34+
>
35+
<div
36+
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]"
37+
style="
38+
clip-path: polygon(
39+
74.1% 44.1%,
40+
100% 61.6%,
41+
97.5% 26.9%,
42+
85.5% 0.1%,
43+
80.7% 2%,
44+
72.5% 32.5%,
45+
60.2% 62.4%,
46+
52.4% 68.1%,
47+
47.5% 58.3%,
48+
45.2% 34.5%,
49+
27.5% 76.7%,
50+
0.1% 64.9%,
51+
17.9% 100%,
52+
27.6% 76.8%,
53+
76.1% 97.7%,
54+
74.1% 44.1%
55+
);
56+
"
57+
></div>
7558
</div>
7659
</div>
7760

@@ -90,8 +73,8 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
9073
</p>
9174

9275
<p class="text-center mt-3">
93-
<img class="inline-block" src="https://img.shields.io/npm/dt/stimulus-content-loader.svg" />
94-
<img class="inline-block" src="https://img.shields.io/npm/v/stimulus-content-loader.svg" />
76+
<img class="inline-block" src="https://img.shields.io/npm/dt/@stimulus-components/content-loader.svg" />
77+
<img class="inline-block" src="https://img.shields.io/npm/v/@stimulus-components/content-loader.svg" />
9578

9679
<img
9780
class="inline-block"
@@ -118,7 +101,7 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
118101
href="https://github.com/stimulus-components/stimulus-content-loader"
119102
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"
120103
>
121-
<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" class="h-6 w-6">
104+
<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true" class="size-6">
122105
<path
123106
fill-rule="evenodd"
124107
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"
@@ -147,7 +130,6 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
147130
</section>
148131
</div>
149132

150-
<!-- This example requires Tailwind CSS v2.0+ -->
151133
<footer class="bg-white">
152134
<div class="max-w-7xl mx-auto py-12 px-4 overflow-hidden sm:px-6 lg:px-8">
153135
<div class="-mx-5 -my-2 flex flex-wrap justify-center" aria-label="Footer">
@@ -170,9 +152,11 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
170152
class="text-gray-400 hover:text-gray-500"
171153
>
172154
<span class="sr-only">Twitter</span>
173-
<svg class="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
155+
<svg class="size-6" fill="currentColor" viewBox="0 0 512 512">
174156
<path
175-
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"
157+
fill-rule="evenodd"
158+
d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"
159+
clip-rule="evenodd"
176160
/>
177161
</svg>
178162
</a>
@@ -184,7 +168,7 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
184168
class="text-gray-400 hover:text-gray-500"
185169
>
186170
<span class="sr-only">GitHub</span>
187-
<svg class="h-6 w-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
171+
<svg class="size-6" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
188172
<path
189173
fill-rule="evenodd"
190174
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"

package.json

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "stimulus-content-loader",
2+
"name": "@stimulus-components/content-loader",
33
"version": "4.2.0",
4-
"engines": {
5-
"node": "*"
6-
},
74
"description": "A Stimulus controller to asynchronously load HTML from an url.",
85
"keywords": [
96
"stimulus",
@@ -21,32 +18,47 @@
2118
"license": "MIT",
2219
"homepage": "https://github.com/stimulus-components/stimulus-content-loader",
2320
"private": false,
21+
"publishConfig": {
22+
"access": "public"
23+
},
2424
"main": "dist/stimulus-content-loader.umd.js",
2525
"module": "dist/stimulus-content-loader.mjs",
26+
"types": "dist/types/index.d.ts",
2627
"scripts": {
27-
"format": "prettier-standard '**/*.{ts,css,html}' --format",
28-
"lint": "prettier-standard '**/*.{ts,css,html}' --lint",
28+
"lint": "tsc --noEmit && eslint --ext .js,.mjs,.ts . && prettier . --check",
29+
"lintfix": "eslint --ext .js,.mjs,.ts . --fix && prettier . --write",
30+
"types": "tsc --noEmit false --declaration true --emitDeclarationOnly true --outDir dist/types",
2931
"dev": "vite",
3032
"prod": "vite build --mode netlify",
31-
"build": "tsc --noEmit && vite build",
33+
"build": "vite build && yarn types",
3234
"version": "yarn build",
33-
"np": "np --no-2fa --no-test"
35+
"np": "np --no-2fa --no-tests"
3436
},
3537
"devDependencies": {
36-
"@babel/core": "7.22.10",
37-
"@babel/plugin-syntax-class-properties": "7.12.13",
38-
"@babel/preset-env": "^7.22.10",
39-
"@babel/preset-typescript": "^7.22.5",
40-
"@hotwired/stimulus": "^3.2.2",
41-
"autoprefixer": "^10.4.14",
42-
"np": "^8.0.4",
43-
"postcss": "^8.4.27",
44-
"prettier-standard": "16.4.1",
45-
"tailwindcss": "^3.3.3",
46-
"typescript": "^5.1.6",
47-
"vite": "^4.4.9"
38+
"@babel/core": "7.24.1",
39+
"@babel/polyfill": "7.12.1",
40+
"@babel/preset-env": "7.24.1",
41+
"@babel/preset-typescript": "7.24.1",
42+
"@hotwired/stimulus": "^3",
43+
"@typescript-eslint/eslint-plugin": "^7.3.1",
44+
"@typescript-eslint/parser": "^7.3.1",
45+
"autoprefixer": "10.4.18",
46+
"eslint": "^8.57.0",
47+
"eslint-config-prettier": "^9.1.0",
48+
"eslint-config-standard": "17.1.0",
49+
"eslint-plugin-import": "2.29.1",
50+
"eslint-plugin-n": "16.6.2",
51+
"eslint-plugin-node": "11.1.0",
52+
"eslint-plugin-promise": "6.1.1",
53+
"eslint-plugin-standard": "5.0.0",
54+
"np": "9.2.0",
55+
"postcss": "8.4.37",
56+
"prettier": "3.2.5",
57+
"tailwindcss": "3.4.1",
58+
"typescript": "^5.4.2",
59+
"vite": "5.2.0"
4860
},
4961
"peerDependencies": {
50-
"@hotwired/stimulus": "^3.2.1"
62+
"@hotwired/stimulus": "^3.0.0"
5163
}
5264
}

0 commit comments

Comments
 (0)