Skip to content

Commit 0088865

Browse files
committed
Migrate to SvelteKit
1 parent 4083c8e commit 0088865

37 files changed

+5503
-4184
lines changed

.eslintignore

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
/docs/build/
2-
/dist/
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.\*
8+
!.env.example
9+
/temp
10+
11+
# Ignore files for PNPM, NPM and YARN
12+
13+
pnpm-lock.yaml
14+
package-lock.json
15+
yarn.lock

.eslintrc.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['eslint:recommended', 'prettier'],
4+
plugins: ['svelte3'],
5+
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
6+
parserOptions: {
7+
sourceType: 'module',
8+
ecmaVersion: 2020
9+
},
10+
env: {
11+
browser: true,
12+
es2017: true,
13+
node: true
14+
}
15+
}

.eslintrc.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,9 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/macos,node
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,node
3-
4-
### macOS ###
5-
# General
61
.DS_Store
7-
.AppleDouble
8-
.LSOverride
9-
10-
# Icon must end with two \r
11-
Icon
12-
13-
# Thumbnails
14-
._*
15-
16-
# Files that might appear in the root of a volume
17-
.DocumentRevisions-V100
18-
.fseventsd
19-
.Spotlight-V100
20-
.TemporaryItems
21-
.Trashes
22-
.VolumeIcon.icns
23-
.com.apple.timemachine.donotpresent
24-
25-
# Directories potentially created on remote AFP share
26-
.AppleDB
27-
.AppleDesktop
28-
Network Trash Folder
29-
Temporary Items
30-
.apdisk
31-
32-
### Node ###
33-
# Logs
34-
logs
35-
*.log
36-
npm-debug.log*
37-
yarn-debug.log*
38-
yarn-error.log*
39-
lerna-debug.log*
40-
41-
# Diagnostic reports (https://nodejs.org/api/report.html)
42-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
43-
44-
# Runtime data
45-
pids
46-
*.pid
47-
*.seed
48-
*.pid.lock
49-
50-
# Directory for instrumented libs generated by jscoverage/JSCover
51-
lib-cov
52-
53-
# Coverage directory used by tools like istanbul
54-
coverage
55-
*.lcov
56-
57-
# nyc test coverage
58-
.nyc_output
59-
60-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
61-
.grunt
62-
63-
# Bower dependency directory (https://bower.io/)
64-
bower_components
65-
66-
# node-waf configuration
67-
.lock-wscript
68-
69-
# Compiled binary addons (https://nodejs.org/api/addons.html)
70-
build/Release
71-
72-
# Dependency directories
73-
node_modules/
74-
jspm_packages/
75-
76-
# TypeScript v1 declaration files
77-
typings/
78-
79-
# TypeScript cache
80-
*.tsbuildinfo
81-
82-
# Optional npm cache directory
83-
.npm
84-
85-
# Optional eslint cache
86-
.eslintcache
87-
88-
# Microbundle cache
89-
.rpt2_cache/
90-
.rts2_cache_cjs/
91-
.rts2_cache_es/
92-
.rts2_cache_umd/
93-
94-
# Optional REPL history
95-
.node_repl_history
96-
97-
# Output of 'npm pack'
98-
*.tgz
99-
100-
# Yarn Integrity file
101-
.yarn-integrity
102-
103-
# dotenv environment variables file
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
1046
.env
105-
.env.test
106-
107-
# parcel-bundler cache (https://parceljs.org/)
108-
.cache
109-
110-
# Next.js build output
111-
.next
112-
113-
# Nuxt.js build / generate output
114-
.nuxt
115-
116-
# Gatsby files
117-
.cache/
118-
# Comment in the public line in if your project uses Gatsby and not Next.js
119-
# https://nextjs.org/blog/next-9-1#public-directory-support
120-
# public
121-
122-
# vuepress build output
123-
.vuepress/dist
124-
125-
# Serverless directories
126-
.serverless/
127-
128-
# FuseBox cache
129-
.fusebox/
130-
131-
# DynamoDB Local files
132-
.dynamodb/
133-
134-
# TernJS port file
135-
.tern-port
136-
137-
# Stores VSCode versions used for testing VSCode extensions
138-
.vscode-test
139-
140-
# End of https://www.toptal.com/developers/gitignore/api/macos,node
7+
.env.*
8+
!.env.example
9+
/temp

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
/temp
10+
LICENSE
11+
12+
# Ignore files for PNPM, NPM and YARN
13+
pnpm-lock.yaml
14+
package-lock.json
15+
yarn.lock

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 100,
3+
"semi": false,
4+
"singleQuote": true,
5+
"trailingComma": "none",
6+
"proseWrap": "always",
7+
"svelteIndentScriptAndStyle": false
8+
}

LICENSE

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

3-
Copyright (c) 2020, Jason Lee <[email protected]>
3+
Copyright (c) 2022, Jason Lee <[email protected]>
44

55
Permission to use, copy, modify, and/or distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ into this:
1515
```html
1616
<div>
1717
<div style="background:url('/image-tiny.jpg') center center / cover no-repeat"></div>
18-
<img src="/image.jpg" alt="image" loading="lazy">
18+
<img src="/image.jpg" alt="image" loading="lazy" />
1919
</div>
2020
```
2121

22-
where the placeholder will be gaussian blurred and the main image beautifully transitioned in place when its download completes.
22+
where the placeholder will be gaussian blurred and the main image beautifully transitioned in place
23+
when its download completes.
2324

24-
The work of lazy-loading is deferred to browsers to handle natively via the `loading="lazy"` attribute. For browsers that don't support this (yet), images will load as normal (i.e. eagerly).
25+
The work of lazy-loading is deferred to browsers to handle natively via the `loading="lazy"`
26+
attribute. For browsers that don't support this (yet), images will load as normal (i.e. eagerly).
2527

2628
## Usage
2729

@@ -61,13 +63,13 @@ Simply consume anywhere in your app:
6163
</style>
6264
6365
<div class="container">
64-
<Img
66+
<img
6567
srcset="/images/hello-800.jpg 800w, /images/hello-480.jpg 480w"
6668
sizes="(max-width: 600px) 480px, 800px"
6769
src="/images/hello-800.jpg"
6870
alt="hello"
6971
placeholder="/images/hello-20.jpg"
70-
/>
72+
/>
7173
</div>
7274
```
7375
@@ -90,7 +92,9 @@ Just load the web component definition from CDN then use anywhere.
9092
</body>
9193
```
9294
93-
Or you can [download](https://raw.githubusercontent.com/zerodevx/svelte-img/master/dist/svelte-img.js) the script and host it yourself.
95+
Or you can
96+
[download](https://raw.githubusercontent.com/zerodevx/svelte-img/master/dist/svelte-img.js) the
97+
script and host it yourself.
9498
9599
## Contributing
96100
@@ -124,7 +128,6 @@ $ npm run lint
124128
125129
Then raise a PR.
126130
127-
128131
## License
129132
130133
ISC

dist/svelte-img.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)