lapikit 0.0.0-insiders.198ca43 → 0.0.0-insiders.83afa82

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.
@@ -0,0 +1,40 @@
1
+ export declare const ansi: {
2
+ color: {
3
+ red: (text: string) => string;
4
+ green: (text: string) => string;
5
+ yellow: (text: string) => string;
6
+ blue: (text: string) => string;
7
+ purple: (text: string) => string;
8
+ cyan: (text: string) => string;
9
+ };
10
+ variant: {
11
+ bold: (text: string) => string;
12
+ underline: (text: string) => string;
13
+ inverse: (text: string) => string;
14
+ };
15
+ bold: {
16
+ red: (text: string) => string;
17
+ green: (text: string) => string;
18
+ yellow: (text: string) => string;
19
+ blue: (text: string) => string;
20
+ purple: (text: string) => string;
21
+ cyan: (text: string) => string;
22
+ };
23
+ inverse: {
24
+ red: (text: string) => string;
25
+ green: (text: string) => string;
26
+ yellow: (text: string) => string;
27
+ blue: (text: string) => string;
28
+ purple: (text: string) => string;
29
+ cyan: (text: string) => string;
30
+ };
31
+ underline: {
32
+ red: (text: string) => string;
33
+ green: (text: string) => string;
34
+ yellow: (text: string) => string;
35
+ blue: (text: string) => string;
36
+ purple: (text: string) => string;
37
+ cyan: (text: string) => string;
38
+ };
39
+ };
40
+ export type Ansi = typeof ansi;
@@ -0,0 +1,44 @@
1
+ const color = {
2
+ red: (text) => `\x1b[31m${text}\x1b[0m`,
3
+ green: (text) => `\x1b[32m${text}\x1b[0m`,
4
+ yellow: (text) => `\x1b[33m${text}\x1b[0m`,
5
+ blue: (text) => `\x1b[34m${text}\x1b[0m`,
6
+ purple: (text) => `\x1b[35m${text}\x1b[0m`,
7
+ cyan: (text) => `\x1b[36m${text}\x1b[0m`
8
+ };
9
+ const variant = {
10
+ bold: (text) => `\x1b[1m${text}\x1b[0m`,
11
+ underline: (text) => `\x1b[4m${text}\x1b[0m`,
12
+ inverse: (text) => `\x1b[7m${text}\x1b[0m`
13
+ };
14
+ const bold = {
15
+ red: (text) => `\x1b[1m\x1b[31m${text}\x1b[0m`,
16
+ green: (text) => `\x1b[1m\x1b[32m${text}\x1b[0m`,
17
+ yellow: (text) => `\x1b[1m\x1b[33m${text}\x1b[0m`,
18
+ blue: (text) => `\x1b[1m\x1b[34m${text}\x1b[0m`,
19
+ purple: (text) => `\x1b[1m\x1b[35m${text}\x1b[0m`,
20
+ cyan: (text) => `\x1b[1m\x1b[36m${text}\x1b[0m`
21
+ };
22
+ const inverse = {
23
+ red: (text) => `\x1b[7m\x1b[31m${text}\x1b[0m`,
24
+ green: (text) => `\x1b[7m\x1b[32m${text}\x1b[0m`,
25
+ yellow: (text) => `\x1b[7m\x1b[33m${text}\x1b[0m`,
26
+ blue: (text) => `\x1b[7m\x1b[34m${text}\x1b[0m`,
27
+ purple: (text) => `\x1b[7m\x1b[35m${text}\x1b[0m`,
28
+ cyan: (text) => `\x1b[7m\x1b[36m${text}\x1b[0m`
29
+ };
30
+ const underline = {
31
+ red: (text) => `\x1b[4m\x1b[31m${text}\x1b[0m`,
32
+ green: (text) => `\x1b[4m\x1b[32m${text}\x1b[0m`,
33
+ yellow: (text) => `\x1b[4m\x1b[33m${text}\x1b[0m`,
34
+ blue: (text) => `\x1b[4m\x1b[34m${text}\x1b[0m`,
35
+ purple: (text) => `\x1b[4m\x1b[35m${text}\x1b[0m`,
36
+ cyan: (text) => `\x1b[4m\x1b[36m${text}\x1b[0m`
37
+ };
38
+ export const ansi = {
39
+ color,
40
+ variant,
41
+ bold,
42
+ inverse,
43
+ underline
44
+ };
@@ -0,0 +1 @@
1
+ export declare const importer: () => Promise<any>;
@@ -0,0 +1,13 @@
1
+ import path from 'path';
2
+ import fs from 'fs';
3
+ import { ansi } from './ansi.js';
4
+ const app = process.cwd();
5
+ const pathConfig = path.resolve(app, 'lapikit.config.js');
6
+ export const importer = async () => {
7
+ if (!fs.existsSync(pathConfig)) {
8
+ console.error(ansi.color.cyan('lapikit'), ansi.bold.red('[error]'), 'config file not found\n', ansi.color.yellow('Could not find lapikit.config.js. See https://localhost/docs/kit/vite to learn more about the configuration file.'), '\n\n', ansi.color.blue('for initializing a new lapikit config, run:\n'), ' ' + ansi.variant.bold('npx lapikit init') + ' ' + ansi.bold.yellow('(preview)'), '\n\n');
9
+ process.exit(1);
10
+ }
11
+ const content = await import(pathConfig);
12
+ return content.default;
13
+ };
@@ -0,0 +1,11 @@
1
+ import type { ViteDevServer } from 'vite';
2
+ interface LapikitPlugin {
3
+ extends?: 'tailwindcss';
4
+ minify?: boolean;
5
+ }
6
+ export declare function lapikit(options?: LapikitPlugin): Promise<{
7
+ name: string;
8
+ configResolved(): Promise<void>;
9
+ configureServer(server: ViteDevServer): Promise<void>;
10
+ }>;
11
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ansi } from './modules/ansi.js';
2
+ import { importer } from './modules/importer.js';
3
+ export async function lapikit(options = {}) {
4
+ return {
5
+ name: 'lapikit/vite.js',
6
+ async configResolved() {
7
+ console.log(ansi.bold.blue('Vite plugin loaded'), options);
8
+ const config = await importer();
9
+ console.log('config', config);
10
+ },
11
+ async configureServer(server) {
12
+ console.log(ansi.inverse.red('Vite server configured'), server);
13
+ }
14
+ };
15
+ }
@@ -0,0 +1,80 @@
1
+ html {
2
+ -webkit-text-size-adjust: 100%;
3
+ tab-size: 4;
4
+ line-height: 1.5;
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ body {
9
+ margin: 0;
10
+ }
11
+
12
+ main {
13
+ display: block;
14
+ }
15
+
16
+ button,
17
+ input,
18
+ optgroup,
19
+ select,
20
+ textarea {
21
+ font: inherit;
22
+ }
23
+
24
+ button {
25
+ overflow: visible;
26
+ }
27
+
28
+ button,
29
+ [type='button'],
30
+ [type='reset'],
31
+ [type='submit'],
32
+ [role='button'] {
33
+ cursor: pointer;
34
+ color: inherit;
35
+ }
36
+
37
+ button,
38
+ input,
39
+ select,
40
+ textarea {
41
+ background-color: transparent;
42
+ border-style: none;
43
+ }
44
+
45
+ *:not(body) {
46
+ outline: none;
47
+ }
48
+
49
+ *,
50
+ ::after,
51
+ ::before,
52
+ ::backdrop {
53
+ box-sizing: border-box;
54
+ margin: 0;
55
+ padding: 0;
56
+ border: 0 solid;
57
+ }
58
+
59
+ img {
60
+ border-style: none;
61
+ }
62
+
63
+ *,
64
+ ::before,
65
+ ::after {
66
+ background-repeat: no-repeat;
67
+ box-sizing: inherit;
68
+ }
69
+
70
+ ::before,
71
+ ::after {
72
+ text-decoration: inherit;
73
+ vertical-align: inherit;
74
+ }
75
+
76
+ [type='search'] {
77
+ -webkit-appearance: textfield;
78
+ appearance: textfield;
79
+ outline-offset: -2px;
80
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.0.0-insiders.198ca43",
3
+ "version": "0.0.0-insiders.83afa82",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -32,7 +32,11 @@
32
32
  ".": {
33
33
  "types": "./dist/index.d.ts",
34
34
  "svelte": "./dist/index.js"
35
- }
35
+ },
36
+ "./vite": {
37
+ "default": "./dist/server/vite.js"
38
+ },
39
+ "./css": "./dist/styles.css"
36
40
  },
37
41
  "peerDependencies": {
38
42
  "svelte": "^5.0.0"