@teispace/next-maker 1.19.2 → 1.20.0
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/CHANGELOG.md +7 -0
- package/dist/index.js +278 -271
- package/dist/index.js.map +4 -4
- package/dist/src/commands/favicon.d.ts +3 -0
- package/dist/src/commands/favicon.d.ts.map +1 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/prompts/favicon.prompt.d.ts +7 -0
- package/dist/src/prompts/favicon.prompt.d.ts.map +1 -0
- package/dist/src/services/favicon/css-colors.d.ts +8 -0
- package/dist/src/services/favicon/css-colors.d.ts.map +1 -0
- package/dist/src/services/favicon/detect.d.ts +16 -0
- package/dist/src/services/favicon/detect.d.ts.map +1 -0
- package/dist/src/services/favicon/encoders.d.ts +23 -0
- package/dist/src/services/favicon/encoders.d.ts.map +1 -0
- package/dist/src/services/favicon/index.d.ts +7 -0
- package/dist/src/services/favicon/index.d.ts.map +1 -0
- package/dist/src/services/favicon/manifest.d.ts +25 -0
- package/dist/src/services/favicon/manifest.d.ts.map +1 -0
- package/dist/src/services/favicon/pipeline.d.ts +3 -0
- package/dist/src/services/favicon/pipeline.d.ts.map +1 -0
- package/dist/src/services/favicon/shapes.d.ts +11 -0
- package/dist/src/services/favicon/shapes.d.ts.map +1 -0
- package/dist/src/services/favicon/types.d.ts +32 -0
- package/dist/src/services/favicon/types.d.ts.map +1 -0
- package/dist/src/services/favicon/validate.d.ts +11 -0
- package/dist/src/services/favicon/validate.d.ts.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favicon.d.ts","sourceRoot":"","sources":["../../../src/commands/favicon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmEzC,eAAO,MAAM,sBAAsB,GAAI,SAAS,OAAO,SAqGtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,SAiBhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favicon.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/favicon.prompt.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,sBAAsB,GACjC,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,KAChC,OAAO,CAAC,mBAAmB,CAc7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard CSS named colors. Used to validate --bg before passing it to sharp,
|
|
3
|
+
* which silently accepts unknown strings.
|
|
4
|
+
*
|
|
5
|
+
* Source: https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
|
|
6
|
+
*/
|
|
7
|
+
export declare const CSS_NAMED_COLORS: Set<string>;
|
|
8
|
+
//# sourceMappingURL=css-colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-colors.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/css-colors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAqJ3B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the App Router directory for metadata files.
|
|
3
|
+
* Prefers `src/app`, falls back to `app`. Returns absolute path.
|
|
4
|
+
*/
|
|
5
|
+
export declare const detectAppDir: (projectPath: string) => Promise<string | null>;
|
|
6
|
+
export interface PwaDetection {
|
|
7
|
+
isPwa: boolean;
|
|
8
|
+
/** Path to a static manifest file (json/webmanifest) if present in /public. */
|
|
9
|
+
publicManifestPath?: string;
|
|
10
|
+
/** Path to a typed `manifest.ts`/`manifest.tsx` in app dir if present. */
|
|
11
|
+
appManifestPath?: string;
|
|
12
|
+
/** Detected PWA framework, if any. */
|
|
13
|
+
framework?: 'next-pwa' | '@ducanh2912/next-pwa' | '@serwist/next' | 'serwist';
|
|
14
|
+
}
|
|
15
|
+
export declare const detectPwa: (projectPath: string) => Promise<PwaDetection>;
|
|
16
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/detect.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAU,aAAa,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAM7E,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,SAAS,CAAC,EAAE,UAAU,GAAG,sBAAsB,GAAG,eAAe,GAAG,SAAS,CAAC;CAC/E;AAID,eAAO,MAAM,SAAS,GAAU,aAAa,MAAM,KAAG,OAAO,CAAC,YAAY,CA8CzE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import sharp from 'sharp';
|
|
2
|
+
import type { FaviconFit, FaviconShape } from './types';
|
|
3
|
+
export interface RenderOptions {
|
|
4
|
+
/** Pre-loaded source bytes — read once by the pipeline and reused per size. */
|
|
5
|
+
sourceBuffer: Buffer;
|
|
6
|
+
size: number;
|
|
7
|
+
shape: FaviconShape;
|
|
8
|
+
radiusPercent: number;
|
|
9
|
+
bg: string;
|
|
10
|
+
paddingPercent: number;
|
|
11
|
+
fit: FaviconFit;
|
|
12
|
+
/** PNG compression level mapped 1..100 → 9..0; lossless, affects file size only. */
|
|
13
|
+
quality: number;
|
|
14
|
+
/** When true, never apply shape clipping (used for ICO frames). */
|
|
15
|
+
forceSquare?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const renderPng: (opts: RenderOptions) => Promise<Buffer>;
|
|
18
|
+
export declare const flatColor: (color: string) => Promise<sharp.Color>;
|
|
19
|
+
/**
|
|
20
|
+
* Build a multi-size ICO from a set of source PNG buffers.
|
|
21
|
+
*/
|
|
22
|
+
export declare const encodeIco: (frames: Buffer[]) => Promise<Buffer>;
|
|
23
|
+
//# sourceMappingURL=encoders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoders.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/encoders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,UAAU,CAAC;IAChB,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,SAAS,GAAU,MAAM,aAAa,KAAG,OAAO,CAAC,MAAM,CAuDnE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAOlE,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAU,QAAQ,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CAGhE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { PwaDetection } from './detect';
|
|
2
|
+
export { detectAppDir, detectPwa } from './detect';
|
|
3
|
+
export { runFavicon } from './pipeline';
|
|
4
|
+
export { buildShapeMask } from './shapes';
|
|
5
|
+
export type { FaviconFit, FaviconOptions, FaviconRunResult, FaviconShape, FaviconWriteResult, } from './types';
|
|
6
|
+
export { isHexColor, parseSizes, validateSource } from './validate';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ManifestIcon {
|
|
2
|
+
src: string;
|
|
3
|
+
sizes: string;
|
|
4
|
+
type: string;
|
|
5
|
+
purpose?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const buildIconEntries: (publicPaths: {
|
|
8
|
+
src: string;
|
|
9
|
+
size: number;
|
|
10
|
+
}[]) => ManifestIcon[];
|
|
11
|
+
/**
|
|
12
|
+
* Merge new icons into a JSON manifest, deduping by `src`. Returns the
|
|
13
|
+
* formatted JSON string ready to write back.
|
|
14
|
+
*/
|
|
15
|
+
export declare const patchJsonManifest: (manifestPath: string, icons: ManifestIcon[]) => Promise<string>;
|
|
16
|
+
export declare const writeJsonManifest: (manifestPath: string, icons: ManifestIcon[]) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Render a snippet the user can paste into a typed `manifest.ts`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const renderManifestSnippet: (icons: ManifestIcon[]) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Bootstrap a fresh `manifest.webmanifest` for projects without one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const buildBootstrapManifest: (appName: string, themeColor: string, icons: ManifestIcon[]) => string;
|
|
25
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,gBAAgB,GAAI,aAAa;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KAAG,YAAY,EAMvF,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,OAAO,YAAY,EAAE,KACpB,OAAO,CAAC,MAAM,CAUhB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,OAAO,YAAY,EAAE,KACpB,OAAO,CAAC,IAAI,CAGd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,YAAY,EAAE,KAAG,MAU7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,OAAO,YAAY,EAAE,KACpB,MAWF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/pipeline.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAwCpF,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,SAAS,cAAc,KACtB,OAAO,CAAC,gBAAgB,CAyH1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FaviconShape } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Build an SVG mask (white shape on transparent) sized to `size` × `size`.
|
|
4
|
+
* Used as a destIn composite over the resized source to clip it to the shape.
|
|
5
|
+
*/
|
|
6
|
+
export declare const buildShapeMask: (shape: FaviconShape, size: number, radiusPercent: number) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Build a flat-color background SVG of the given size.
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildBackground: (size: number, color: string) => string;
|
|
11
|
+
//# sourceMappingURL=shapes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,YAAY,EACnB,MAAM,MAAM,EACZ,eAAe,MAAM,KACpB,MAeF,CAAC;AAsBF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAC2F,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type FaviconShape = 'square' | 'rounded' | 'circle' | 'squircle';
|
|
2
|
+
export type FaviconFit = 'contain' | 'cover' | 'clip';
|
|
3
|
+
export interface FaviconOptions {
|
|
4
|
+
source: string;
|
|
5
|
+
outDir: string;
|
|
6
|
+
force: boolean;
|
|
7
|
+
dryRun: boolean;
|
|
8
|
+
emitIcon: boolean;
|
|
9
|
+
emitApple: boolean;
|
|
10
|
+
emitOg: boolean;
|
|
11
|
+
emitTwitter: boolean;
|
|
12
|
+
ogSource?: string;
|
|
13
|
+
pwa: boolean;
|
|
14
|
+
pwaInit: boolean;
|
|
15
|
+
shape: FaviconShape;
|
|
16
|
+
radius: number;
|
|
17
|
+
bg: string;
|
|
18
|
+
padding: number;
|
|
19
|
+
fit: FaviconFit;
|
|
20
|
+
icoSizes: number[];
|
|
21
|
+
quality: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FaviconWriteResult {
|
|
24
|
+
path: string;
|
|
25
|
+
bytes: number;
|
|
26
|
+
skipped?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface FaviconRunResult {
|
|
29
|
+
outputs: FaviconWriteResult[];
|
|
30
|
+
pwaSnippet?: string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAEhB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IAEjB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAEhB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SourceInfo {
|
|
2
|
+
absolutePath: string;
|
|
3
|
+
ext: string;
|
|
4
|
+
bytes: number;
|
|
5
|
+
isVector: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const validateSource: (source: string) => Promise<SourceInfo>;
|
|
8
|
+
export declare const isHexColor: (value: string) => boolean;
|
|
9
|
+
export declare const normalizeBg: (value: string) => string;
|
|
10
|
+
export declare const parseSizes: (raw: string | undefined, fallback: number[]) => number[];
|
|
11
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/services/favicon/validate.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,UAAU,CAkBvE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,OACsB,CAAC;AAElE,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,MAK3C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,EAAE,KAAG,MAAM,EAU9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teispace/next-maker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "Create a new Teispace Next.js application with interactive setup.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
"degit": "^2.8.4",
|
|
45
45
|
"enquirer": "^2.4.1",
|
|
46
46
|
"ora": "^9.4.0",
|
|
47
|
-
"picocolors": "^1.1.1"
|
|
47
|
+
"picocolors": "^1.1.1",
|
|
48
|
+
"png-to-ico": "^3.0.1",
|
|
49
|
+
"sharp": "^0.34.5"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
52
|
"@types/degit": "^2.8.6",
|