@phosart/common 0.4.22 → 0.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -56
- package/dist/util/art.d.ts +2 -1
- package/dist/util/art.d.ts.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/util/art.ts +2 -1
- package/src/lib/util/index.ts +2 -1
package/README.md
CHANGED
|
@@ -1,58 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# phosart-common
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A set of common utilities for reading and processing images for an art gallery website
|
|
4
|
+
of this structure.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Creating a project
|
|
8
|
-
|
|
9
|
-
If you're seeing this, you've probably already done this step. Congrats!
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
# create a new project in the current directory
|
|
13
|
-
npx sv create
|
|
14
|
-
|
|
15
|
-
# create a new project in my-app
|
|
16
|
-
npx sv create my-app
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Developing
|
|
20
|
-
|
|
21
|
-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
npm run dev
|
|
25
|
-
|
|
26
|
-
# or start the server and open the app in a new browser tab
|
|
27
|
-
npm run dev -- --open
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
31
|
-
|
|
32
|
-
## Building
|
|
33
|
-
|
|
34
|
-
To build your library:
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
npm pack
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
To create a production version of your showcase app:
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
npm run build
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can preview the production build with `npm run preview`.
|
|
47
|
-
|
|
48
|
-
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
49
|
-
|
|
50
|
-
## Publishing
|
|
51
|
-
|
|
52
|
-
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
53
|
-
|
|
54
|
-
To publish your library to [npm](https://www.npmjs.com):
|
|
55
|
-
|
|
56
|
-
```sh
|
|
57
|
-
npm publish
|
|
58
|
-
```
|
|
6
|
+
(More documentation forthcoming)
|
package/dist/util/art.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { FullCharacter } from '../server/models/Character.ts';
|
|
2
|
+
import type { FullCharacter, RawCharacter } from '../server/models/Character.ts';
|
|
3
3
|
import type { Artist as ZArtist } from '../server/models/Artist.ts';
|
|
4
4
|
import type { Picture as ZPicture, Image as ZImage, Source as ZSource } from '../server/models/image.ts';
|
|
5
5
|
import type { FullGallery, FullArtPiece, BaseArtPiece as ZBaseArtPiece, RawGallery as ZRawGallery, BaseArtist as ZBaseArtist, BaseGallery as ZBaseGallery, ExtendedGallery as ZExtendedGallery } from '../server/models/Gallery.ts';
|
|
@@ -9,6 +9,7 @@ export type RawGallery = z.infer<typeof ZRawGallery>;
|
|
|
9
9
|
export type BaseGallery = z.infer<typeof ZBaseGallery>;
|
|
10
10
|
export type ExtendedGallery = z.infer<typeof ZExtendedGallery>;
|
|
11
11
|
export type Gallery = z.infer<typeof FullGallery>;
|
|
12
|
+
export type BaseCharacter = z.infer<typeof RawCharacter>;
|
|
12
13
|
export type Character = z.infer<typeof FullCharacter>;
|
|
13
14
|
export type BaseArtist = z.infer<typeof ZBaseArtist>;
|
|
14
15
|
export type Artist = z.infer<typeof ZArtist>;
|
package/dist/util/art.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"art.d.ts","sourceRoot":"","sources":["../../src/lib/util/art.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"art.d.ts","sourceRoot":"","sources":["../../src/lib/util/art.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EACX,OAAO,IAAI,QAAQ,EACnB,KAAK,IAAI,MAAM,EACf,MAAM,IAAI,OAAO,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,YAAY,IAAI,aAAa,EAC7B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,WAAW,IAAI,YAAY,EAC3B,eAAe,IAAI,gBAAgB,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,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AE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAeD,wBAAgB,eAAe,CAC9B,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACtB,OAAO,CAAC,EAAE,WAAW,GACnB,KAAK,CAAC,gBAAgB,CAAC,CASzB;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAWxC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAS/C;AAcD,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,mBAAmB,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC"}
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { no4K, normalizeArtist, normalizeCharacter, onlyHighRes } from './art.ts';
|
|
2
|
-
export type { ArtPiece, Artist, Character, CharacterRef, Gallery, RawGallery, Image, NormalizedArtist, Picture, Source, BaseArtist, BaseArtPiece, BaseGallery, ExtendedGallery, NormalizedCharacter, ResourceRef } from './art.ts';
|
|
2
|
+
export type { ArtPiece, Artist, Character, CharacterRef, Gallery, RawGallery, Image, NormalizedArtist, Picture, Source, BaseArtist, BaseArtPiece, BaseGallery, ExtendedGallery, NormalizedCharacter, ResourceRef, BaseCharacter } from './art.ts';
|
|
3
3
|
export { executeSearch } from './search.ts';
|
|
4
4
|
export { useArtist, useArtists, useArtistsContext } from './artistcontext.svelte.ts';
|
|
5
5
|
export { useCharacterContext, useCharacters } from './charactercontext.svelte.ts';
|
package/dist/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClF,YAAY,EACX,QAAQ,EACR,MAAM,EACN,SAAS,EACT,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAClF,YAAY,EACX,QAAQ,EACR,MAAM,EACN,SAAS,EACT,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
package/src/lib/util/art.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
import type { FullCharacter } from '../server/models/Character.ts';
|
|
3
|
+
import type { FullCharacter, RawCharacter } from '../server/models/Character.ts';
|
|
4
4
|
import type { Artist as ZArtist } from '../server/models/Artist.ts';
|
|
5
5
|
import type {
|
|
6
6
|
Picture as ZPicture,
|
|
@@ -23,6 +23,7 @@ export type RawGallery = z.infer<typeof ZRawGallery>;
|
|
|
23
23
|
export type BaseGallery = z.infer<typeof ZBaseGallery>;
|
|
24
24
|
export type ExtendedGallery = z.infer<typeof ZExtendedGallery>;
|
|
25
25
|
export type Gallery = z.infer<typeof FullGallery>;
|
|
26
|
+
export type BaseCharacter = z.infer<typeof RawCharacter>;
|
|
26
27
|
export type Character = z.infer<typeof FullCharacter>;
|
|
27
28
|
export type BaseArtist = z.infer<typeof ZBaseArtist>;
|
|
28
29
|
export type Artist = z.infer<typeof ZArtist>;
|
package/src/lib/util/index.ts
CHANGED
|
@@ -15,7 +15,8 @@ export type {
|
|
|
15
15
|
BaseGallery,
|
|
16
16
|
ExtendedGallery,
|
|
17
17
|
NormalizedCharacter,
|
|
18
|
-
ResourceRef
|
|
18
|
+
ResourceRef,
|
|
19
|
+
BaseCharacter
|
|
19
20
|
} from './art.ts';
|
|
20
21
|
export { executeSearch } from './search.ts';
|
|
21
22
|
export { useArtist, useArtists, useArtistsContext } from './artistcontext.svelte.ts';
|