@studiokloek/vite-config 0.13.1 → 0.14.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/package.json CHANGED
@@ -1,21 +1,11 @@
1
1
  {
2
2
  "name": "@studiokloek/vite-config",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
+ "description": "Base Vite config and CLI for our game projects.",
4
5
  "type": "module",
5
6
  "license": "MIT",
6
7
  "author": "Martijn Swart <opensource@studiokloek.nl> (https://studiokloek.nl)",
7
- "description": "Base Vite config for usage in our projects.",
8
- "homepage": "https://github.com/studiokloek/vite-config/tree/main/#readme",
9
- "exports": {
10
- ".": "./dist/index.js",
11
- "./package.json": "./package.json"
12
- },
13
- "main": "dist/index.js",
14
- "types": "dist/index.d.ts",
15
- "bin": {
16
- "kloek-build": "./bin/build.js",
17
- "kloek-development": "./bin/development.js"
18
- },
8
+ "homepage": "https://github.com/studiokloek/vite-config#readme",
19
9
  "repository": {
20
10
  "type": "git",
21
11
  "url": "git+https://github.com/studiokloek/vite-config.git"
@@ -23,90 +13,84 @@
23
13
  "bugs": {
24
14
  "url": "https://github.com/studiokloek/vite-config/issues"
25
15
  },
26
- "scripts": {
27
- "dev": "run-s build/clean build/watch",
28
- "build": "run-s build/clean build/bundle types",
29
- "build/clean": "rimraf dist",
30
- "build/watch": "yarn rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript --watch",
31
- "build/bundle": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
32
- "types": "run-s types/temp types/roll types/clean",
33
- "types/temp": "tsc --project tsconfig.types.json",
34
- "types/roll": "api-extractor run",
35
- "types/clean": "rimraf tmp/types",
36
- "prepublishOnly": "run-s build",
37
- "release": "run-s build release/publish",
38
- "release/publish": "npx np"
39
- },
16
+ "keywords": [
17
+ "vite",
18
+ "vite-config",
19
+ "svelte",
20
+ "handlebars",
21
+ "pixi",
22
+ "games"
23
+ ],
40
24
  "engines": {
41
- "node": ">=22"
25
+ "node": ">=22.19"
42
26
  },
43
- "np": {
44
- "tests": false
27
+ "volta": {
28
+ "node": "24.21.0"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./cli": {
36
+ "types": "./dist/cli.d.ts",
37
+ "default": "./dist/cli.js"
38
+ },
39
+ "./package.json": "./package.json"
40
+ },
41
+ "main": "./dist/index.js",
42
+ "types": "./dist/index.d.ts",
43
+ "bin": {
44
+ "kloek-assets": "./bin/assets.js",
45
+ "kloek-build": "./bin/build.js",
46
+ "kloek-development": "./bin/development.js"
45
47
  },
46
48
  "files": [
47
- "dist/*",
48
- "bin/*"
49
+ "dist",
50
+ "bin",
51
+ "partials"
49
52
  ],
50
53
  "publishConfig": {
51
54
  "access": "public"
52
55
  },
53
56
  "dependencies": {
54
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
55
- "@vheemstra/vite-plugin-imagemin": "^2.2.1",
56
- "@vitejs/plugin-legacy": "^7.2.1",
57
- "filenamify": "^6.0.0",
57
+ "@studiokloek/vite-assets-plugin": "^0.1.0",
58
+ "@sveltejs/vite-plugin-svelte": "^7.3.1",
59
+ "@vitejs/plugin-legacy": "^8.2.3",
60
+ "cac": "^7.0.0",
61
+ "filenamify": "^7.0.3",
58
62
  "handlebars": "^4.7.9",
59
- "imagemin-mozjpeg": "^10.0.0",
60
- "imagemin-optipng": "^8.0.0",
61
- "imagemin-pngquant": "^10.0.0",
62
- "meow": "12.1.1",
63
- "npm-run-all": "^4.1.5",
64
- "postcss": "^8.5.15",
65
- "postcss-load-config": "^6.0.1",
66
- "rollup-plugin-visualizer": "^6.0.11",
67
- "sass": "1.100.0",
68
- "stylelint": "^16.26.1",
69
- "svelte": "^5.56.1",
70
- "svelte-preprocess": "^6.0.5",
71
- "terser": "^5.48.0",
72
- "vite": "v7.3.5",
73
- "vite-plugin-banner": "0.8.1",
74
- "vite-plugin-checker": "^0.14.1",
63
+ "html-minifier-next": "^8.7.0",
64
+ "rollup-plugin-visualizer": "^7.1.1",
65
+ "sass": "^1.105.0",
66
+ "sharp": "^0.35.5",
67
+ "svelte": "^5.57.1",
68
+ "terser": "^5.51.2",
69
+ "vite": "^8.3.1",
70
+ "vite-plugin-checker": "^0.14.5",
75
71
  "vite-plugin-full-reload": "^1.2.0",
76
- "vite-plugin-html": "3.2.2",
77
- "vite-plugin-live-reload": "^3.1.0",
78
- "vite-plugin-mkcert": "^1.17.12",
79
- "vite-tsconfig-paths": "^5.1.4",
80
- "zip-a-folder": "^3.1.9"
72
+ "vite-plugin-mkcert": "^2.1.0",
73
+ "zip-a-folder": "^5.0.1",
74
+ "zod": "^4.6.5"
81
75
  },
82
76
  "devDependencies": {
83
- "@biomejs/biome": "^2.4.16",
84
- "@microsoft/api-extractor": "7.58.7",
85
- "@rollup/plugin-node-resolve": "^16.0.3",
86
- "@rollup/plugin-typescript": "^12.3.0",
87
- "@sveltejs/kit": "^2.63.0",
88
- "@types/ejs": "^3.1.5",
89
- "@types/estree": "^1.0.9",
90
- "@types/html-minifier-terser": "^7.0.2",
91
- "@types/imagemin": "^9.0.1",
92
- "@types/imagemin-mozjpeg": "^8.0.4",
93
- "@types/imagemin-optipng": "^5.2.4",
94
- "@types/node": "^24.13.0",
95
- "rimraf": "^6.1.3",
96
- "rollup": "^4.61.1",
97
- "rollup-plugin-copy": "^3.5.0",
98
- "tslib": "^2.8.1",
99
- "typescript": "5.9.3"
100
- },
101
- "resolutions": {
102
- "@types/estree": "1.0.8",
103
- "@types/imagemin": "9.0.1",
104
- "@types/node": "24.13.0",
105
- "vite": "v7.3.5",
106
- "rollup": "4.61.1"
77
+ "@biomejs/biome": "^2.5.14",
78
+ "@changesets/cli": "^3.0.3",
79
+ "@types/node": "^22.18.0",
80
+ "tsdown": "^0.23.0",
81
+ "typescript": "^7.0.2",
82
+ "vitest": "^5.0.2"
107
83
  },
108
- "volta": {
109
- "node": "22.22.2",
110
- "yarn": "1.22.22"
84
+ "scripts": {
85
+ "build": "tsdown",
86
+ "dev": "tsdown --watch",
87
+ "typecheck": "tsc --noEmit",
88
+ "lint": "biome check .",
89
+ "format": "biome check --write .",
90
+ "test": "vitest run",
91
+ "test:watch": "vitest",
92
+ "changeset": "changeset",
93
+ "ci:version": "changeset version",
94
+ "ci:publish": "pnpm build && changeset publish"
111
95
  }
112
- }
96
+ }
package/dist/config.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { ConfigEnv, UserConfig } from 'vite';
2
- export declare function defineKloekViteConfig(environment: ConfigEnv): Promise<UserConfig>;
@@ -1,3 +0,0 @@
1
- import type { Plugin, PluginOption } from 'vite';
2
- import type { ViteOptions } from '../utils/interfaces';
3
- export declare function basePlugins(options: ViteOptions): Array<Plugin | PluginOption>;
@@ -1,3 +0,0 @@
1
- import type { Plugin, PluginOption } from 'vite';
2
- import type { ViteOptions } from '../utils/interfaces';
3
- export declare function buildPlugins(options: ViteOptions): Array<Plugin | PluginOption>;
@@ -1,2 +0,0 @@
1
- export type Context = Record<string, unknown> | ((path: string) => Record<string, unknown>) | ((path: string) => Promise<Record<string, unknown>>);
2
- export declare function resolveContext(context: Context | undefined, pagePath: string): Promise<Record<string, unknown> | undefined>;
@@ -1,3 +0,0 @@
1
- import { type Plugin as VitePlugin } from 'vite';
2
- import type { ViteOptions } from '../../../utils/interfaces.js';
3
- export declare function handlebarsPlugin(partialsDirectoryPaths: string | string[], options: ViteOptions): VitePlugin;
@@ -1,4 +0,0 @@
1
- /**
2
- * Registers each HTML file in a directory as Handlebars partial
3
- */
4
- export declare function registerPartials(directoryPath: string | Array<string>, partialsSet: Set<string>): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- import type { GamesSettings } from '../../utils/interfaces';
3
- export declare function htmlPlugin(games: GamesSettings): Plugin;
@@ -1,3 +0,0 @@
1
- import type { ConfigEnv, Plugin } from 'vite';
2
- import type { ImageQualityConfig } from '../../utils/interfaces';
3
- export declare function imageminPlugin(environment: ConfigEnv, options: ImageQualityConfig): Plugin | undefined;
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- import type { GamesSettings } from '../../utils/interfaces';
3
- export declare function manifestPlugin(games: GamesSettings): Plugin;
@@ -1,6 +0,0 @@
1
- import type { Plugin, PluginOption } from 'vite';
2
- export type KloekConfigServeSettings = {
3
- fullReloadSvelte?: boolean;
4
- https?: boolean;
5
- };
6
- export declare function servePlugins(settings?: KloekConfigServeSettings): Array<Plugin | PluginOption>;
package/dist/public.d.ts DELETED
@@ -1,49 +0,0 @@
1
- import type { TypedFlags } from 'meow';
2
-
3
- export declare function kloekBuild(flags: TypedFlags<{
4
- base: {
5
- type: 'string';
6
- shortFlag: string;
7
- default: string;
8
- };
9
- mode: {
10
- type: 'string';
11
- shortFlag: string;
12
- default?: string;
13
- };
14
- logLevel: {
15
- type: 'string';
16
- shortFlag: string;
17
- default?: string;
18
- };
19
- emptyOutDir: {
20
- type: 'boolean';
21
- shortFlag: string;
22
- default: true;
23
- };
24
- sourcemaps: {
25
- type: 'boolean';
26
- shortFlag: string;
27
- default: false;
28
- };
29
- inlineSourcemaps: {
30
- type: 'boolean';
31
- shortFlag: string;
32
- default: false;
33
- };
34
- createZip: {
35
- type: 'boolean';
36
- shortFlag: string;
37
- default: false;
38
- };
39
- }>): Promise<void>;
40
-
41
- export declare function kloekDevelopment(flags: TypedFlags<{
42
- mode: {
43
- type: 'string';
44
- shortFlag: string;
45
- default?: string;
46
- };
47
- }>): Promise<void>;
48
-
49
- export { }
@@ -1,3 +0,0 @@
1
- import type { BuildOptions } from 'vite';
2
- import type { ViteOptions } from './interfaces';
3
- export declare function defineBuildConfig(options: ViteOptions): BuildOptions;
@@ -1 +0,0 @@
1
- export declare const cwd: string;
@@ -1,5 +0,0 @@
1
- import type { GameSettings, GamesSettings, GamesSettingsData, KloekViteConfig, PackageGamesSettings } from './interfaces';
2
- export declare function parsePackageGamesSettings(packageSettings: PackageGamesSettings, version: string): GamesSettingsData;
3
- export declare function pathToGameData(fullFilePath: string, settings: GamesSettings): GameSettings | undefined;
4
- export declare function getPageToServe(config: KloekViteConfig, settings: GamesSettings): string;
5
- export declare function getPageIdFromUrl(url: string): string;
@@ -1,2 +0,0 @@
1
- import { type BinaryLike } from 'node:crypto';
2
- export declare function md5(buffer: BinaryLike): string;
@@ -1,6 +0,0 @@
1
- export * from './build';
2
- export * from './cwd';
3
- export * from './game';
4
- export * from './json';
5
- export * from './pkg';
6
- export * from './zip';
@@ -1,77 +0,0 @@
1
- import type { ConfigEnv } from 'vite';
2
- export type ImageQualityConfig = {
3
- jpeg: number;
4
- png: [number, number];
5
- };
6
- export type KloekViteDevConfig = {
7
- serveParams: string;
8
- fullReloadSvelte?: boolean;
9
- cors?: boolean;
10
- https?: boolean;
11
- };
12
- export type KloekViteServeConfig = {
13
- partials: string | string[];
14
- };
15
- export type KloekViteBuildConfig = {
16
- basePath: string;
17
- legacy?: boolean;
18
- browserslist?: string | string[];
19
- imageQuality: ImageQualityConfig;
20
- manifest?: boolean;
21
- analyzeBundle?: boolean;
22
- sourceMaps?: boolean | 'inline' | 'hidden';
23
- createZip?: boolean;
24
- };
25
- export type KloekViteConfig = {
26
- dev: KloekViteDevConfig;
27
- serve: KloekViteServeConfig;
28
- build: KloekViteBuildConfig;
29
- };
30
- export type GameSettingsProperty = 'info' | 'meta' | 'options';
31
- export type GameSettings = {
32
- info: {
33
- id: string;
34
- page: string;
35
- version: string;
36
- client: string;
37
- year: number;
38
- };
39
- meta: {
40
- title: string;
41
- description: string;
42
- apptitle: string;
43
- };
44
- options: {
45
- backgroundColor: string;
46
- orientation: string;
47
- fullscreen: string;
48
- };
49
- };
50
- export type GamesSettings = Record<string, GameSettings>;
51
- export type GamesSettingsData = {
52
- development: GameSettings;
53
- games: GamesSettings;
54
- };
55
- export type PackageGamesSettings = {
56
- generic: GameSettings;
57
- games: GameSettings[];
58
- };
59
- export type ViteOptions = {
60
- root: string;
61
- package: {
62
- version: string;
63
- name: string;
64
- description: string;
65
- };
66
- environment: ConfigEnv;
67
- settings: GamesSettingsData;
68
- config: KloekViteConfig;
69
- };
70
- export type PackageConfig = {
71
- vite: KloekViteConfig;
72
- settings: PackageGamesSettings;
73
- browserslist: string | string[];
74
- version: string;
75
- name: string;
76
- description: string;
77
- };
@@ -1 +0,0 @@
1
- export declare function readJSON(path: string): unknown;
@@ -1,2 +0,0 @@
1
- import type { PackageConfig } from './interfaces';
2
- export declare function getPackageConfig(): PackageConfig;
@@ -1 +0,0 @@
1
- export declare function addBuildFolderToZip(): Promise<void>;
File without changes