lapikit 0.0.0-insiders.b9305c0 → 0.0.0-insiders.bd609af

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,295 @@
1
+ #!/usr/bin/env node
2
+ import { promises as fs } from 'fs';
3
+ import path from 'path';
4
+ import presets from './presets.js';
5
+
6
+ async function findReferenceFile(projectPath) {
7
+ const routesPath = path.join(projectPath, 'src', 'routes');
8
+
9
+ try {
10
+ await fs.access(routesPath);
11
+ } catch {
12
+ throw new Error('Lapikit cannot find the routes/ directory.');
13
+ }
14
+
15
+ const layoutFile = path.join(routesPath, '+layout.svelte');
16
+ try {
17
+ await fs.access(layoutFile);
18
+ return layoutFile;
19
+ } catch {
20
+ // +layout.svelte not found in routes/
21
+ }
22
+
23
+ const pageFile = path.join(routesPath, '+page.svelte');
24
+ try {
25
+ await fs.access(pageFile);
26
+ return pageFile;
27
+ } catch {
28
+ // +page.svelte not found in routes/
29
+ }
30
+
31
+ try {
32
+ const entries = await fs.readdir(routesPath, { withFileTypes: true });
33
+ const subDirectories = entries.filter((entry) => entry.isDirectory());
34
+
35
+ for (const dir of subDirectories) {
36
+ const subDirPath = path.join(routesPath, dir.name);
37
+
38
+ const subLayoutFile = path.join(subDirPath, '+layout.svelte');
39
+ try {
40
+ await fs.access(subLayoutFile);
41
+ return subLayoutFile;
42
+ } catch {
43
+ // +layout.svelte not found in subdirectory
44
+ }
45
+
46
+ const subPageFile = path.join(subDirPath, '+page.svelte');
47
+ try {
48
+ await fs.access(subPageFile);
49
+ return subPageFile;
50
+ } catch {
51
+ // +page.svelte not found in subdirectory
52
+ }
53
+ }
54
+ } catch {
55
+ // Error reading routes directory
56
+ }
57
+
58
+ throw new Error('Not found +layout or +page main on your project.');
59
+ }
60
+
61
+ async function addImportToReferenceFile(targetFile, referenceFile) {
62
+ try {
63
+ const content = await fs.readFile(referenceFile, 'utf-8');
64
+ const relativePath = path.relative(path.dirname(referenceFile), targetFile);
65
+ const importStatement = `import "${relativePath.startsWith('.') ? relativePath : './' + relativePath}";\n`;
66
+
67
+ if (content.includes(`import "${relativePath}"`)) {
68
+ console.log(`import has already exist ${referenceFile}`);
69
+ return;
70
+ }
71
+
72
+ const lines = content.split('\n');
73
+ let insertIndex = -1;
74
+
75
+ for (let i = 0; i < lines.length; i++) {
76
+ const line = lines[i].trim();
77
+ if (line.startsWith('<script>') || line.startsWith('<script lang="ts">')) {
78
+ insertIndex = i + 1;
79
+ break;
80
+ }
81
+ }
82
+
83
+ if (insertIndex === -1) {
84
+ throw new Error(`No found balise <script> ou <script lang="ts"> ${referenceFile}`);
85
+ }
86
+
87
+ let finalInsertIndex = insertIndex;
88
+ for (let i = insertIndex; i < lines.length; i++) {
89
+ const line = lines[i].trim();
90
+
91
+ if (line === '</script>') {
92
+ break;
93
+ }
94
+
95
+ if (line === '' || line.startsWith('import ') || line.startsWith('//')) {
96
+ finalInsertIndex = i + 1;
97
+ } else {
98
+ break;
99
+ }
100
+ }
101
+
102
+ lines.splice(finalInsertIndex, 0, `\t${importStatement.trim()}`);
103
+ const newContent = lines.join('\n');
104
+
105
+ await fs.writeFile(referenceFile, newContent);
106
+ console.log(`Import has added on ${referenceFile}`);
107
+ } catch (error) {
108
+ console.error(`Error adding import: ${error.message}`);
109
+ throw error;
110
+ }
111
+ }
112
+
113
+ async function findViteConfigFile(projectPath, typescript) {
114
+ const ext = typescript ? 'ts' : 'js';
115
+ const viteConfigFile = path.join(projectPath, `vite.config.${ext}`);
116
+
117
+ try {
118
+ await fs.access(viteConfigFile);
119
+ return viteConfigFile;
120
+ } catch {
121
+ // Try the other extension if the preferred one doesn't exist
122
+ const alternativeExt = typescript ? 'js' : 'ts';
123
+ const alternativeFile = path.join(projectPath, `vite.config.${alternativeExt}`);
124
+
125
+ try {
126
+ await fs.access(alternativeFile);
127
+ return alternativeFile;
128
+ } catch {
129
+ throw new Error(`No vite.config.js or vite.config.ts file found in ${projectPath}`);
130
+ }
131
+ }
132
+ }
133
+
134
+ async function addLapikitToViteConfig(viteConfigFile) {
135
+ try {
136
+ const content = await fs.readFile(viteConfigFile, 'utf-8');
137
+ const lapikitImport = `import { lapikit } from 'lapikit/vite';`;
138
+
139
+ // Check if lapikit import already exists
140
+ if (content.includes(lapikitImport) || content.includes(`from 'lapikit/vite'`)) {
141
+ console.log(`Lapikit import already exists in ${viteConfigFile}`);
142
+ return;
143
+ }
144
+
145
+ const lines = content.split('\n');
146
+ let importInsertIndex = -1;
147
+ let pluginAdded = false;
148
+
149
+ // Find where to insert the import (after other imports)
150
+ for (let i = 0; i < lines.length; i++) {
151
+ const line = lines[i].trim();
152
+
153
+ if (line.startsWith('import ') && !line.includes('type ')) {
154
+ importInsertIndex = i + 1;
155
+ } else if (
156
+ line === '' &&
157
+ importInsertIndex !== -1 &&
158
+ lines[i + 1] &&
159
+ !lines[i + 1].trim().startsWith('import ')
160
+ ) {
161
+ importInsertIndex = i;
162
+ break;
163
+ }
164
+ }
165
+
166
+ // If no imports found, insert at the beginning
167
+ if (importInsertIndex === -1) {
168
+ importInsertIndex = 0;
169
+ }
170
+
171
+ // Insert the lapikit import
172
+ lines.splice(importInsertIndex, 0, lapikitImport);
173
+
174
+ // Find and update the plugins array
175
+ for (let i = 0; i < lines.length; i++) {
176
+ const line = lines[i].trim();
177
+
178
+ if (line.includes('plugins:') && line.includes('[') && line.includes(']')) {
179
+ // Single line plugins array
180
+ if (line.includes('sveltekit()')) {
181
+ const pluginMatch = line.match(/plugins:\s*\[(.*)\]/);
182
+ if (pluginMatch) {
183
+ const pluginsContent = pluginMatch[1];
184
+ if (!pluginsContent.includes('lapikit()')) {
185
+ const newPluginsContent = pluginsContent.replace(
186
+ /sveltekit\(\)/,
187
+ 'sveltekit(), lapikit()'
188
+ );
189
+ lines[i] = line.replace(pluginsContent, newPluginsContent);
190
+ pluginAdded = true;
191
+ }
192
+ }
193
+ }
194
+ break;
195
+ } else if (line.includes('plugins:') && line.includes('[') && !line.includes(']')) {
196
+ // Multi-line plugins array start
197
+ for (let j = i; j < lines.length; j++) {
198
+ const pluginLine = lines[j].trim();
199
+
200
+ if (pluginLine.includes('sveltekit()') && !pluginAdded) {
201
+ // Check if lapikit() is not already present
202
+ let hasLapikit = false;
203
+ for (let k = i; k < lines.length && !lines[k].includes(']'); k++) {
204
+ if (lines[k].includes('lapikit()')) {
205
+ hasLapikit = true;
206
+ break;
207
+ }
208
+ }
209
+
210
+ if (!hasLapikit) {
211
+ // Add lapikit() after sveltekit()
212
+ if (pluginLine.includes(',')) {
213
+ lines[j] = lines[j].replace('sveltekit()', 'sveltekit(), lapikit()');
214
+ } else {
215
+ lines[j] = lines[j].replace('sveltekit()', 'sveltekit(),');
216
+ // Insert lapikit() on the next line with proper indentation
217
+ const indentation = lines[j].match(/^\s*/)[0];
218
+ lines.splice(j + 1, 0, `${indentation}lapikit()`);
219
+ }
220
+ pluginAdded = true;
221
+ }
222
+ break;
223
+ }
224
+
225
+ if (pluginLine.includes(']')) {
226
+ break;
227
+ }
228
+ }
229
+ break;
230
+ }
231
+ }
232
+
233
+ if (!pluginAdded) {
234
+ console.warn('Could not find sveltekit() in plugins array to add lapikit() after it');
235
+ }
236
+
237
+ const newContent = lines.join('\n');
238
+ await fs.writeFile(viteConfigFile, newContent);
239
+ console.log(`Lapikit import and plugin added to ${viteConfigFile}`);
240
+ } catch (error) {
241
+ console.error(`Error adding lapikit to vite config: ${error.message}`);
242
+ throw error;
243
+ }
244
+ }
245
+
246
+ export async function initConfiguration(options) {
247
+ console.log('initConfiguration called with:', options);
248
+ const { typescript, pathConfig, formatCSS } = options;
249
+ const ext = typescript ? 'ts' : 'js';
250
+ const targetDir = path.resolve(process.cwd(), pathConfig);
251
+ const targetFile = path.join(targetDir, `lapikit.${ext}`);
252
+
253
+ await fs.mkdir(targetDir, { recursive: true });
254
+
255
+ let fileCreated = false;
256
+ try {
257
+ console.log(`Trying to access ${targetFile}`);
258
+ await fs.access(targetFile);
259
+ console.log(`File ${targetFile} already exists.`);
260
+ } catch {
261
+ console.log(`Creating file: ${targetFile}`);
262
+ const content = presets({
263
+ classic: formatCSS === 'global'
264
+ });
265
+ await fs.writeFile(targetFile, content);
266
+ console.log(`File created : ${targetFile}`);
267
+ fileCreated = true;
268
+ }
269
+
270
+ try {
271
+ const referenceFile = await findReferenceFile(process.cwd());
272
+ await addImportToReferenceFile(targetFile, referenceFile);
273
+ } catch (error) {
274
+ console.error(`Error: ${error.message}`);
275
+ // If the file was just created and we can't add the import, delete it
276
+ if (fileCreated) {
277
+ try {
278
+ await fs.unlink(targetFile);
279
+ console.log(`File ${targetFile} deleted due to error.`);
280
+ } catch {
281
+ // Ignore deletion error
282
+ }
283
+ }
284
+ throw error;
285
+ }
286
+
287
+ // Add lapikit to vite.config file
288
+ try {
289
+ const viteConfigFile = await findViteConfigFile(process.cwd(), typescript);
290
+ await addLapikitToViteConfig(viteConfigFile);
291
+ } catch (error) {
292
+ console.warn(`Warning: Could not update vite.config file: ${error.message}`);
293
+ // This is not a critical error, so we don't throw it
294
+ }
295
+ }
package/bin/helper.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+
1
4
  const color = {
2
5
  red: (text) => `\x1b[31m${text}\x1b[0m`,
3
6
  green: (text) => `\x1b[32m${text}\x1b[0m`,
@@ -63,6 +66,26 @@ export function getCssPathFromArgs() {
63
66
  return args[1] || 'src/app.css';
64
67
  }
65
68
 
69
+ export function getLapikitPathFromArgs() {
70
+ const args = process.argv.slice(2);
71
+ // Search argument after --plugin-path or -p
72
+ const pluginPathIndex = args.findIndex((arg) => arg === '--plugin-path' || arg === '-p');
73
+ if (pluginPathIndex !== -1 && args[pluginPathIndex + 1]) {
74
+ return args[pluginPathIndex + 1];
75
+ }
76
+ return 'src/plugin';
77
+ }
78
+
79
+ export function validatePluginPath(pluginPath) {
80
+ if (!pluginPath.startsWith('src/')) {
81
+ return {
82
+ valid: false,
83
+ error: 'The path must start with "src/"'
84
+ };
85
+ }
86
+ return { valid: true };
87
+ }
88
+
66
89
  export async function envTypescript() {
67
90
  const directory = process.cwd();
68
91
  try {
package/bin/index.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { initConfiguration } from './configuration.js';
3
+ import { ansi, terminal } from './helper.js';
4
+ import { legacyConfiguration } from './legacy.js';
5
+ import { initPrompts } from './prompts.js';
6
+
7
+ async function run() {
8
+ console.log(' _ _ _ _ _ ');
9
+ console.log(' | | (_) | (_) | ');
10
+ console.log(' | | __ _ _ __ _| | ___| |_ ');
11
+ console.log(" | | / _` | '_ \\| | |/ / | __|");
12
+ console.log(' | |___| (_| | |_) | | <| | |_ ');
13
+ console.log(' |______\\__,_| .__/|_|_|\\_\\_|\\__|');
14
+ console.log(' | | ');
15
+ console.log(' |_| \n');
16
+
17
+ terminal('none', `${ansi.bold.blue('Lapikit')} - Component Library for Svelte\n\n`);
18
+
19
+ const promptsConfig = await initPrompts();
20
+
21
+ if (promptsConfig.env === 'current') {
22
+ await legacyConfiguration(promptsConfig);
23
+ }
24
+
25
+ if (promptsConfig.env === 'experimental') {
26
+ terminal('warn', `Experimental mode is not yet implemented.`);
27
+ await initConfiguration(promptsConfig);
28
+ }
29
+ }
30
+
31
+ run()
32
+ .then(() => {
33
+ console.log('Website: https://lapikit.dev');
34
+ console.log('Github: https://github.com/nycolaide/lapikit');
35
+ console.log('Support the developement: https://buymeacoffee.com/nycolaide');
36
+ process.exit(0);
37
+ })
38
+ .catch((error) => {
39
+ console.error(`\n${red('✖')} ${error}\n`);
40
+ process.exit(1);
41
+ });
package/bin/lapikit.js CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { promises as fs } from 'fs';
3
3
  import path from 'path';
4
- import { ansi, terminal, envTypescript } from './helper.js';
4
+ import {
5
+ ansi,
6
+ terminal,
7
+ envTypescript,
8
+ getLapikitPathFromArgs,
9
+ validatePluginPath
10
+ } from './helper.js';
5
11
  import { preset } from './modules/preset.js';
6
12
  import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
13
+ import { createPluginStructure, setupSvelteKitIntegration } from './modules/plugin.js';
7
14
 
8
15
  const [, , command] = process.argv;
9
16
  const typescriptEnabled = envTypescript();
@@ -11,8 +18,9 @@ const typescriptEnabled = envTypescript();
11
18
  if (process.argv.includes('--help') || process.argv.includes('-h')) {
12
19
  terminal(
13
20
  'info',
14
- `usage: ${ansi.color.yellow('npx lapikit init {cssPath}')}\n\n ${ansi.variant.bold('options:')}\n
15
- - {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file.\n\n`
21
+ `usage: ${ansi.color.yellow('npx lapikit init {cssPath} [--plugin-path {pluginPath}]')}\n\n ${ansi.variant.bold('options:')}\n
22
+ - {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file.
23
+ - --plugin-path, -p: (${ansi.color.cyan('src/plugin')}) customize path for the plugin directory.\n\n`
16
24
  );
17
25
  process.exit(0);
18
26
  } else if (command === 'init') {
@@ -27,6 +35,15 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
27
35
 
28
36
  terminal('none', `${ansi.bold.blue('LAPIKIT')} - Component Library for Svelte\n\n`);
29
37
 
38
+ // Get Path
39
+ const pluginPath = getLapikitPathFromArgs();
40
+ const pathValidation = validatePluginPath(pluginPath);
41
+
42
+ if (!pathValidation.valid) {
43
+ terminal('error', `Invalid path: ${pathValidation.error}`);
44
+ process.exit(1);
45
+ }
46
+
30
47
  const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
31
48
  try {
32
49
  await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
@@ -39,6 +56,20 @@ if (process.argv.includes('--help') || process.argv.includes('-h')) {
39
56
  );
40
57
  }
41
58
 
59
+ // Create plugin structure
60
+ try {
61
+ await createPluginStructure(pluginPath, typescriptEnabled);
62
+ } catch (error) {
63
+ terminal('error', `Create plugin structure not working : ${error.message}`);
64
+ }
65
+
66
+ // Setup SvelteKit integration
67
+ try {
68
+ await setupSvelteKitIntegration(pluginPath, typescriptEnabled);
69
+ } catch (error) {
70
+ terminal('error', `SvelteKit integration setup failed: ${error.message}`);
71
+ }
72
+
42
73
  await adapterViteConfig(typescriptEnabled);
43
74
  await adapterCSSConfig();
44
75
 
package/bin/legacy.js ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import { promises as fs } from 'fs';
3
+ import path from 'path';
4
+ import { preset } from './modules/preset.js';
5
+ import { ansi, terminal, envTypescript } from './helper.js';
6
+ import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
7
+
8
+ export async function legacyConfiguration(options) {
9
+ const typescriptEnabled = envTypescript();
10
+ const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
11
+
12
+ try {
13
+ await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
14
+ terminal('success', `has create lapikit.config.js on your project.`);
15
+ } catch (error) {
16
+ terminal('error', `failed to create configuration file:\n\n ${error}`);
17
+ terminal(
18
+ 'warn',
19
+ `you can create lapikit.config.js manually, please visite https://lapikit.dev/docs/getting-started for more information`
20
+ );
21
+ }
22
+
23
+ await adapterViteConfig(typescriptEnabled);
24
+ await adapterCSSConfig(options);
25
+
26
+ terminal(
27
+ 'info',
28
+ `${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://lapikit.dev')}\n\n`
29
+ );
30
+
31
+ console.log('Website: https://lapikit.dev');
32
+ console.log('Github: https://github.com/nycolaide/lapikit');
33
+ console.log('Support the developement: https://buymeacoffee.com/nycolaide');
34
+ }
@@ -1,6 +1,6 @@
1
1
  import { promises as fs } from 'fs';
2
2
  import path from 'path';
3
- import { getCssPathFromArgs, terminal } from '../helper.js';
3
+ import { terminal } from '../helper.js';
4
4
 
5
5
  const importLapikitVite = `import { lapikit } from 'lapikit/vite';`;
6
6
  const importLapikitCss = `@import 'lapikit/css';`;
@@ -33,8 +33,8 @@ export async function adapterViteConfig(typescript) {
33
33
  }
34
34
  }
35
35
 
36
- export async function adapterCSSConfig() {
37
- const cssPath = getCssPathFromArgs();
36
+ export async function adapterCSSConfig(options) {
37
+ const cssPath = options?.pathCSS || 'src/app.css';
38
38
  const resolvedPath = path.resolve(process.cwd(), cssPath);
39
39
  try {
40
40
  await fs.access(resolvedPath);
@@ -0,0 +1,223 @@
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+ import { terminal } from '../helper.js';
4
+
5
+ const lapikitTsTemplate = `import type { Config } from 'lapikit';
6
+
7
+ /**
8
+ * Custom configuration for Lapikit
9
+ * @see https://lapikit.dev/docs/customize
10
+ */
11
+ const config: Config = {
12
+ theme: {
13
+ colorScheme: 'light',
14
+ colors: {
15
+ primary: '#3b82f6',
16
+ secondary: '#6b7280'
17
+ }
18
+ }
19
+ };
20
+
21
+ export default config;
22
+ `;
23
+
24
+ const lapikitJsTemplate = `/**
25
+ * Custom configuration for Lapikit
26
+ * @see https://lapikit.dev/docs/customize
27
+ * @type {import('lapikit').Config}
28
+ */
29
+ const config = {
30
+ theme: {
31
+ colorScheme: 'light',
32
+ colors: {
33
+ primary: '#3b82f6',
34
+ secondary: '#6b7280'
35
+ }
36
+ }
37
+ };
38
+
39
+ export default config;
40
+ `;
41
+
42
+ export async function createPluginStructure(pluginPath, isTypescript) {
43
+ const resolvedPluginPath = path.resolve(process.cwd(), pluginPath);
44
+ const lapikitFileName = isTypescript ? 'lapikit.ts' : 'lapikit.js';
45
+ const lapikitFilePath = path.join(resolvedPluginPath, lapikitFileName);
46
+
47
+ try {
48
+ // Verify plugin directory
49
+ try {
50
+ await fs.access(resolvedPluginPath);
51
+ terminal('info', `The folder ${pluginPath} already exists.`);
52
+ } catch {
53
+ await fs.mkdir(resolvedPluginPath, { recursive: true });
54
+ terminal('success', `Folder ${pluginPath} created successfully.`);
55
+ }
56
+
57
+ // Create lapikit.ts or lapikit.js
58
+ const template = isTypescript ? lapikitTsTemplate : lapikitJsTemplate;
59
+ await fs.writeFile(lapikitFilePath, template.trim() + '\n', 'utf8');
60
+
61
+ terminal('success', `File ${lapikitFileName} created in ${pluginPath}.`);
62
+ } catch (error) {
63
+ terminal('error', `Error creating plugin structure: ${error.message}`);
64
+ throw error;
65
+ }
66
+ }
67
+
68
+ export async function setupSvelteKitIntegration(pluginPath, isTypescript) {
69
+ const srcRoutesPath = path.resolve(process.cwd(), 'src/routes');
70
+
71
+ try {
72
+ // Check if the src/routes directory exists
73
+ await fs.access(srcRoutesPath);
74
+ terminal('info', 'Folder src/routes found, configuring SvelteKit...');
75
+ } catch {
76
+ terminal('info', 'Folder src/routes not found, no SvelteKit configuration needed.');
77
+ return;
78
+ }
79
+
80
+ const layoutPath = path.join(srcRoutesPath, '+layout.svelte');
81
+ const pagePath = path.join(srcRoutesPath, '+page.svelte');
82
+
83
+ let targetFile = null;
84
+ let targetFileName = '';
85
+
86
+ try {
87
+ await fs.access(layoutPath);
88
+ targetFile = layoutPath;
89
+ targetFileName = '+layout.svelte';
90
+ } catch {
91
+ try {
92
+ await fs.access(pagePath);
93
+ targetFile = pagePath;
94
+ targetFileName = '+page.svelte';
95
+ } catch {
96
+ terminal('warn', 'No +layout.svelte or +page.svelte file found in src/routes.');
97
+ return;
98
+ }
99
+ }
100
+
101
+ // Read content
102
+ let fileContent = await fs.readFile(targetFile, 'utf8');
103
+
104
+ // Get Path
105
+ const relativePath = path.relative(
106
+ path.dirname(targetFile),
107
+ path.resolve(process.cwd(), pluginPath)
108
+ );
109
+ const lapikitFileName = isTypescript ? 'lapikit' : 'lapikit.js';
110
+ const configImportPath = `${relativePath}/${lapikitFileName}`.replace(/\\/g, '/');
111
+
112
+ // Imports
113
+ const createLapikitImport = `\n\timport { createLapikit } from 'lapikit';`;
114
+ const configImport = `\timport config from '${configImportPath}';`;
115
+
116
+ const scriptLang = isTypescript ? ' lang="ts"' : '';
117
+ const effectCode = `\n\t$effect.pre(() => {\n\t\tcreateLapikit(config);\n\t});`;
118
+
119
+ // search balise
120
+ const scriptRegex = /<script(\s+lang="ts")?>([\s\S]*?)<\/script>/;
121
+ const scriptMatch = fileContent.match(scriptRegex);
122
+
123
+ if (scriptMatch) {
124
+ // If have script balise , add import
125
+ let scriptContent = scriptMatch[2];
126
+
127
+ // Add imports if they don't already exist
128
+ if (!scriptContent.includes('createLapikit')) {
129
+ scriptContent = `${createLapikitImport}\n${configImport}\n${scriptContent}`;
130
+ }
131
+
132
+ // Add effect
133
+ if (!scriptContent.includes('createLapikit(config)')) {
134
+ scriptContent += effectCode;
135
+ }
136
+
137
+ // Replace script balise
138
+ const newScript = `<script${scriptMatch[1] || scriptLang}>${scriptContent}\n</script>`;
139
+ fileContent = fileContent.replace(scriptRegex, newScript);
140
+ } else {
141
+ // If no script tag exists, create one
142
+ const newScript = `<script${scriptLang}>\n${createLapikitImport}\n${configImport}${effectCode}\n</script>\n\n`;
143
+ fileContent = newScript + fileContent;
144
+ }
145
+
146
+ // Write the modified file
147
+ await fs.writeFile(targetFile, fileContent, 'utf8');
148
+ terminal('success', `Config added ${targetFileName}.`);
149
+ }
150
+
151
+ const [, , command] = process.argv;
152
+ const typescriptEnabled = envTypescript();
153
+ const args = process.argv.slice(2);
154
+ const previewMode = args.includes('--preview');
155
+
156
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
157
+ terminal(
158
+ 'info',
159
+ `usage: ${ansi.color.yellow('npx lapikit init {cssPath} [--plugin-path {pluginPath}] [--preview]')}\n\n ${ansi.variant.bold('options:')}\n
160
+ - {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file.
161
+ - --plugin-path, -p: (${ansi.color.cyan('src/plugin')}) customize path for the plugin directory.
162
+ - --preview: active preview mode (plugin + SvelteKit integration)\n\n`
163
+ );
164
+ process.exit(0);
165
+ } else if (command === 'init') {
166
+ console.log(' _ _ _ _ _ ');
167
+ console.log(' | | (_) | (_) | ');
168
+ console.log(' | | __ _ _ __ _| | ___| |_ ');
169
+ console.log(" | | / _` | '_ \\| | |/ / | __|");
170
+ console.log(' | |___| (_| | |_) | | <| | |_ ');
171
+ console.log(' |______\\__,_| .__/|_|_|\\_\\_|\\__|');
172
+ console.log(' | | ');
173
+ console.log(' |_| \n');
174
+
175
+ terminal('none', `${ansi.bold.blue('LAPIKIT')} - Component Library for Svelte\n\n`);
176
+
177
+ if (previewMode) {
178
+ // Mode preview
179
+ const pluginPath = getLapikitPathFromArgs();
180
+ const pathValidation = validatePluginPath(pluginPath);
181
+ if (!pathValidation.valid) {
182
+ terminal('error', `Invalid path: ${pathValidation.error}`);
183
+ process.exit(1);
184
+ }
185
+ try {
186
+ await createPluginStructure(pluginPath, typescriptEnabled);
187
+ } catch (error) {
188
+ terminal('error', `Create plugin structure not working : ${error.message}`);
189
+ }
190
+ try {
191
+ await setupSvelteKitIntegration(pluginPath, typescriptEnabled);
192
+ } catch (error) {
193
+ terminal('error', `SvelteKit integration setup failed: ${error.message}`);
194
+ }
195
+ } else {
196
+ // Mode classic
197
+ const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
198
+ try {
199
+ await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
200
+ terminal('success', `has create lapikit.config.js on your project.`);
201
+ } catch (error) {
202
+ terminal('error', `failed to create configuration file:\n\n ${error}`);
203
+ terminal(
204
+ 'warn',
205
+ `you can create lapikit.config.js manually, please visite https://lapikit.dev/docs/getting-started for more information`
206
+ );
207
+ }
208
+ await adapterCSSConfig();
209
+ }
210
+
211
+ await adapterViteConfig(typescriptEnabled);
212
+
213
+ terminal(
214
+ 'info',
215
+ `${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://lapikit.dev')}\n\n`
216
+ );
217
+
218
+ console.log('Website: https://lapikit.dev');
219
+ console.log('Github: https://github.com/nycolaide/lapikit');
220
+ console.log('Support the developement: https://buymeacoffee.com/nycolaide');
221
+ } else {
222
+ terminal('error', `Command not recognized. Try 'npx lapikit -h'`);
223
+ }
package/bin/presets.js ADDED
@@ -0,0 +1,23 @@
1
+ function presets({ classic }) {
2
+ let content = '';
3
+
4
+ content += `/**\n`;
5
+ content += `\t* Lapikit\n`;
6
+ content += `\t* Library documentation: https://lapikit.dev\n`;
7
+ content += ` */\n\n`;
8
+
9
+ if (classic) {
10
+ content += `// Classic\n`;
11
+ content += `import 'lapikit/css';\n\n`;
12
+ }
13
+
14
+ content += `// Composables\n`;
15
+ content += `import { helloWorld } from 'lapikit';\n\n`;
16
+
17
+ content += `// https://lapikit.dev/docs/getting-started\n`;
18
+ content += `export default helloWorld();`;
19
+
20
+ return content;
21
+ }
22
+
23
+ export default presets;
package/bin/prompts.js ADDED
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ import prompts from 'prompts';
3
+
4
+ export async function initPrompts() {
5
+ const { confirm } = await prompts({
6
+ type: 'toggle',
7
+ name: 'confirm',
8
+ message: 'Start install Lapikit on your app?',
9
+ initial: true,
10
+ active: 'Yes',
11
+ inactive: 'No'
12
+ });
13
+
14
+ if (!confirm) {
15
+ console.log('❌ Installation canceled. See you soon.');
16
+ process.exit(0);
17
+ }
18
+ // temps with legacy and new process install
19
+ const { type } = await prompts({
20
+ type: 'select',
21
+ name: 'type',
22
+ message: 'Select installation type:',
23
+ choices: [
24
+ { title: 'Classic install with lapikit.config.js', value: 'current' },
25
+ {
26
+ title: 'Preview install with new plugin/lapikit.(js|ts) <experimental>',
27
+ value: 'experimental'
28
+ }
29
+ ]
30
+ });
31
+
32
+ if (type === 'current') {
33
+ // Classic install
34
+ const settings = await prompts([
35
+ {
36
+ type: 'text',
37
+ name: 'pathCSS',
38
+ message: 'Where would you like to import the lapikit CSS files?',
39
+ initial: 'src/app.css',
40
+ validate: (value) =>
41
+ value.startsWith('src/') ? true : 'Please provide a valid path starting with src/'
42
+ }
43
+ ]);
44
+
45
+ return {
46
+ ...settings,
47
+ env: 'current'
48
+ };
49
+ } else if (type === 'experimental') {
50
+ // Preview install
51
+ let settings = await prompts([
52
+ {
53
+ type: 'text',
54
+ name: 'pathConfig',
55
+ message: 'Where would you like to install the lapikit configuration files?',
56
+ initial: 'src/plugins',
57
+ validate: (value) =>
58
+ value.startsWith('src/') ? true : 'Please provide a valid path starting with src/'
59
+ },
60
+ {
61
+ type: 'toggle',
62
+ name: 'typescript',
63
+ message: 'Use TypeScript?',
64
+ initial: true,
65
+ active: 'Yes',
66
+ inactive: 'No'
67
+ },
68
+ {
69
+ type: 'select',
70
+ name: 'formatCSS',
71
+ message: 'What is your CSS format used on your app?',
72
+ choices: [
73
+ { title: 'Basic (classic import)', value: 'global' },
74
+ {
75
+ title: 'TailwindCSS (v4)',
76
+ value: 'tailwind-v4'
77
+ },
78
+ {
79
+ title: 'UnoCSS',
80
+ value: 'unocss'
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ type: (prev) => (prev !== 'global' ? 'text' : null),
86
+ name: 'pathCSS',
87
+ message: 'Where would you like to import the lapikit CSS files?',
88
+ initial: 'src/app.css',
89
+ validate: (value) =>
90
+ value.startsWith('src/') ? true : 'Please provide a valid path starting with src/'
91
+ }
92
+ ]);
93
+
94
+ console.log('response config', settings);
95
+
96
+ return {
97
+ ...settings,
98
+ env: 'experimental'
99
+ };
100
+ }
101
+ }
@@ -1,23 +1,24 @@
1
+ /* root */
1
2
  .kit-alert {
2
3
  --alert-color: var(--on, var(--kit-on-container));
3
4
  --alert-background: var(--base, var(--kit-container));
4
5
  --alert-radius: var(--shape, var(--kit-radius-md));
6
+ }
5
7
 
8
+ .kit-alert {
6
9
  display: grid;
7
10
  flex: 1 1;
8
11
  grid-template-areas:
9
12
  'prepend content append close'
10
13
  '. content . .';
11
- /* grid-template-columns: max-content auto max-content max-content; */ /* bug */
14
+ grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
12
15
  position: relative;
13
16
  padding: 1rem;
14
17
  overflow: hidden;
15
18
  color: var(--alert-color);
16
19
  background-color: var(--alert-background);
17
20
  border-radius: var(--alert-radius);
18
- /* transition:
19
- color 0.5s,
20
- background-color 0.5s; */
21
+ line-height: 0;
21
22
  }
22
23
 
23
24
  .kit-alert .kit-alert--underlay {
@@ -53,7 +54,7 @@
53
54
  padding-top: 0.75rem;
54
55
  }
55
56
 
56
- .kit-alert .kit-alert-prepend {
57
+ .kit-alert .kit-alert--prepend {
57
58
  align-self: flex-start;
58
59
  display: flex;
59
60
  align-items: center;
@@ -61,10 +62,11 @@
61
62
  margin-inline-end: 1rem;
62
63
  }
63
64
 
64
- .kit-alert .kit-alert-content {
65
- align-self: center;
65
+ .kit-alert .kit-alert--content {
66
+ align-self: flex-start;
66
67
  grid-area: content;
67
68
  overflow: hidden;
69
+ line-height: normal;
68
70
  }
69
71
 
70
72
  .kit-alert .kit-alert--close {
@@ -74,6 +76,14 @@
74
76
  grid-area: close;
75
77
  }
76
78
 
79
+ .kit-alert .kit-alert--append {
80
+ align-self: flex-start;
81
+ display: flex;
82
+ align-items: center;
83
+ grid-area: append;
84
+ margin-inline-start: 1rem;
85
+ }
86
+
77
87
  /* state */
78
88
  .kit-alert.kit-alert--info:not([class*='alert--variant-']) {
79
89
  --on: var(--kit-on-info);
@@ -147,8 +147,8 @@
147
147
  }
148
148
 
149
149
  .kit-button[breakpoint]kit-button--variant-outline {
150
- --button-color: var(--base, var(--kit-on-container));
151
- background-color: transparent;
150
+ --button-color: var(--on, var(--kit-on-container));
151
+ background-color: var(--button-background);
152
152
  }
153
153
  .kit-button[breakpoint]kit-button--variant-outline::before {
154
154
  content: '';
@@ -36,6 +36,7 @@
36
36
  white-space: nowrap;
37
37
  gap: calc(var(--kit-spacing) * var(--chip-multiplier-gap));
38
38
  font-size: calc(var(--kit-spacing) * var(--chip-multiplier-font-size));
39
+ line-height: 0;
39
40
  }
40
41
 
41
42
  .kit-chip:not(div):not(span)::after {
@@ -115,8 +116,8 @@
115
116
  }
116
117
 
117
118
  .kit-chip[breakpoint]kit-chip--variant-outline {
118
- --chip-color: var(--base, var(--kit-oncontainer));
119
- background-color: transparent;
119
+ --chip-color: var(--on, var(--kit-on-container));
120
+ background-color: var(--chip-background);
120
121
  }
121
122
  .kit-chip[breakpoint]kit-chip--variant-outline::before {
122
123
  content: '';
@@ -10,6 +10,7 @@
10
10
  .kit-modal {
11
11
  width: 100%;
12
12
  height: 100%;
13
+ position: absolute;
13
14
  }
14
15
 
15
16
  .kit-modal-container {
@@ -16,6 +16,45 @@
16
16
  grid-template-rows: 1fr auto;
17
17
  }
18
18
 
19
+ /* variant */
20
+ .kit-textfield[breakpoint]kit-textfield--variant-filled .kit-field {
21
+ --textfield-border-color: var(--textfield-background);
22
+ background-color: var(--textfield-background);
23
+ border-radius: var(--textfield-radius);
24
+ color: var(--textfield-color);
25
+ }
26
+
27
+ .kit-textfield[breakpoint]kit-textfield--variant-outline .kit-field {
28
+ --textfield-border-color: var(--textfield-color);
29
+ background-color: var(--textfield-background);
30
+ border-radius: var(--textfield-radius);
31
+ color: var(--textfield-color);
32
+ }
33
+
34
+ .kit-textfield[breakpoint]kit-textfield--variant-filled .kit-textfield-outline,
35
+ .kit-textfield[breakpoint]kit-textfield--variant-outline .kit-textfield-outline {
36
+ border-bottom: 1px solid var(--textfield-border-color);
37
+ border-top: 1px solid var(--textfield-border-color);
38
+ border-right: 1px solid var(--textfield-border-color);
39
+ border-left: 1px solid var(--textfield-border-color);
40
+ border-radius: var(--textfield-radius);
41
+ }
42
+
43
+ .kit-textfield[breakpoint]kit-textfield--variant-text .kit-field {
44
+ --textfield-border-color: var(--textfield-color);
45
+ background-color: transparent;
46
+ border-radius: 0;
47
+ color: var(--textfield-color);
48
+ }
49
+
50
+ .kit-textfield[breakpoint]kit-textfield--variant-text .kit-textfield-outline {
51
+ border-bottom: 1px solid var(--textfield-border-color);
52
+ border-top: 0;
53
+ border-right: 0;
54
+ border-left: 0;
55
+ border-radius: 0;
56
+ }
57
+
19
58
  .kit-textfield--hide-spin-buttons input[type='number'] {
20
59
  -moz-appearance: textfield;
21
60
  appearance: textfield;
@@ -49,7 +88,6 @@
49
88
  position: absolute;
50
89
  right: 0;
51
90
  width: 100%;
52
- border: 1px solid var(--textfield-background);
53
91
  }
54
92
 
55
93
  .kit-textfield .kit-textfield-prepend {
@@ -72,9 +110,6 @@
72
110
  .kit-textfield-control {
73
111
  display: flex;
74
112
  grid-area: control;
75
- background-color: var(--textfield-background);
76
- border-radius: var(--textfield-radius);
77
- color: var(--textfield-color);
78
113
  }
79
114
 
80
115
  .kit-textfield-control .kit-textfield-prepend-inner {
@@ -119,14 +154,16 @@
119
154
  .kit-textfield-control .kit-field {
120
155
  display: grid;
121
156
  grid-template-areas: 'prepend-inner field clear append-inner';
122
- grid-template-columns: min-content minmax(0, 1fr) min-content min-content;
123
- font-size: 16px;
157
+ grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
158
+ font-size: calc(var(--kit-spacing) * var(--textfield-multiplier-font-size));
124
159
  max-width: 100%;
125
- border-radius: 4px;
126
160
  contain: layout;
127
161
  flex: 1 0;
128
162
  grid-area: control;
129
163
  position: relative;
164
+ padding: calc(var(--kit-spacing) * var(--textfield-multiplier-x))
165
+ calc(var(--kit-spacing) * var(--textfield-multiplier-y));
166
+ gap: calc(var(--kit-spacing) * var(--textfield-multiplier-gap));
130
167
  }
131
168
 
132
169
  .kit-textfield-control .kit-field .kit-field--field {
@@ -141,7 +178,6 @@
141
178
  font: inherit;
142
179
  border-radius: 0;
143
180
  color: inherit;
144
- /* opacity: 0; */
145
181
  flex: 1;
146
182
  min-width: 0;
147
183
  align-items: center;
@@ -163,13 +199,13 @@
163
199
 
164
200
  /* message */
165
201
  .kit-textfield-message {
166
- padding-inline: 16px;
202
+ padding-inline: var(--textfield-spacing-y);
167
203
  align-items: flex-end;
168
204
  display: flex;
169
205
  font-size: 0.75rem;
170
206
  grid-area: messages;
171
207
  min-height: 22px;
172
- padding-top: 6px;
208
+ padding-top: var(--textfield-spacing-x);
173
209
  overflow: hidden;
174
210
  justify-content: space-between;
175
211
  opacity: 0;
@@ -186,6 +222,7 @@
186
222
  min-width: 1px;
187
223
  position: relative;
188
224
  display: grid;
225
+ gap: calc(var(--kit-spacing) * var(--textfield-multiplier-gap));
189
226
  grid-template-areas: 'message-prepend message message-append ';
190
227
  grid-template-columns: max-content minmax(0, 1fr) max-content;
191
228
  }
@@ -214,3 +251,55 @@
214
251
  .kit-message .kit-message--append {
215
252
  grid-area: message-append;
216
253
  }
254
+
255
+ /* size */
256
+ .kit-textfield[breakpoint]kit-textfield--size-xs {
257
+ --textfield-multiplier-x: 2;
258
+ --textfield-multiplier-y: 2;
259
+ --textfield-multiplier-gap: 1;
260
+ --textfield-multiplier-font-size: 6;
261
+ }
262
+
263
+ .kit-textfield[breakpoint]kit-textfield--size-sm {
264
+ --textfield-multiplier-x: 3;
265
+ --textfield-multiplier-y: 4;
266
+ --textfield-multiplier-gap: 2;
267
+ --textfield-multiplier-font-size: 7;
268
+ }
269
+
270
+ .kit-textfield[breakpoint]kit-textfield--size-md {
271
+ --textfield-multiplier-x: 4;
272
+ --textfield-multiplier-y: 6;
273
+ --textfield-multiplier-gap: 2;
274
+ --textfield-multiplier-font-size: 8;
275
+ }
276
+
277
+ .kit-textfield[breakpoint]kit-textfield--size-lg {
278
+ --textfield-multiplier-x: 5;
279
+ --textfield-multiplier-y: 6;
280
+ --textfield-multiplier-gap: 2;
281
+ --textfield-multiplier-font-size: 9;
282
+ }
283
+
284
+ .kit-textfield[breakpoint]kit-textfield--size-xl {
285
+ --textfield-multiplier-x: 6;
286
+ --textfield-multiplier-y: 8;
287
+ --textfield-multiplier-gap: 3;
288
+ --textfield-multiplier-font-size: 10;
289
+ }
290
+
291
+ /*density */
292
+ .kit-textfield[breakpoint]kit-textfield--density-default {
293
+ --textfield-spacing-x: 0;
294
+ --textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y));
295
+ }
296
+
297
+ .kit-textfield[breakpoint]kit-textfield--density-compact {
298
+ --textfield-spacing-x: calc(0 - 0.5rem);
299
+ --textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y) - 0.5rem);
300
+ }
301
+
302
+ .kit-textfield[breakpoint]kit-textfield--density-comfortable {
303
+ --textfield-spacing-x: calc(0 + 0.5rem);
304
+ --textfield-spacing-y: calc(var(--kit-spacing) * var(--textfield-multiplier-y) + 0.5rem);
305
+ }
@@ -1,15 +1,24 @@
1
1
  <script lang="ts">
2
- import Icon from '../icon/icon.svelte';
2
+ import { getAssets } from '../../internal/index.js';
3
3
  import type { TextfieldProps } from './types.js';
4
4
 
5
+ //external
6
+ import { Icon } from '../index.js';
7
+
5
8
  let {
9
+ ref = $bindable(),
6
10
  prepend,
7
11
  append,
8
12
  prependInner,
9
13
  appendInner,
10
14
  value = $bindable(),
11
15
  type = 'text',
16
+ density = 'default',
17
+ size = 'md',
18
+ variant = 'filled',
12
19
  placeholder,
20
+ light,
21
+ dark,
13
22
  counter,
14
23
  min,
15
24
  max,
@@ -26,9 +35,14 @@
26
35
  persistentMessage,
27
36
  hideSpinButtons, // only type="number"
28
37
  readonly,
38
+ color,
39
+ background,
40
+ rounded,
29
41
  ...rest
30
42
  }: TextfieldProps = $props();
31
43
 
44
+ const assets = getAssets();
45
+
32
46
  let counterValue: number = $state(0);
33
47
  let displayMessage: boolean = $state(false);
34
48
  let displayClear: boolean = $state(false);
@@ -76,17 +90,25 @@
76
90
  });
77
91
  </script>
78
92
 
79
- {errorMessage}
80
93
  <div
94
+ bind:this={ref}
81
95
  {...rest}
82
96
  class={[
83
97
  'kit-textfield',
98
+ light && 'light',
99
+ dark && 'dark',
100
+ size && assets.className('textfield', 'size', size),
101
+ variant && assets.className('textfield', 'variant', variant),
102
+ density && assets.className('textfield', 'density', density),
84
103
  disabled && 'kit-textfield--disabled',
85
104
  readonly && 'kit-textfield--readonly',
86
105
  error && 'kit-textfield--error',
87
106
  type === 'number' && hideSpinButtons && 'kit-textfield--hide-spin-buttons',
88
107
  rest.class
89
108
  ]}
109
+ style:--base={assets.color(background)}
110
+ style:--on={assets.color(color)}
111
+ style:--shape={assets.shape(rounded)}
90
112
  >
91
113
  {#if prepend}
92
114
  <div class="kit-textfield-prepend">
@@ -160,7 +182,7 @@
160
182
  {#if counter || messageSuffix}
161
183
  <div class="kit-message--append">
162
184
  {#if counter}
163
- {counterValue}/{max}
185
+ {counterValue}{max ? `/${max}` : ''}
164
186
  {:else if messageSuffix}
165
187
  {messageSuffix}
166
188
  {/if}
@@ -1,4 +1,4 @@
1
1
  import type { TextfieldProps } from './types.js';
2
- declare const Textfield: import("svelte").Component<TextfieldProps, {}, "value">;
2
+ declare const Textfield: import("svelte").Component<TextfieldProps, {}, "value" | "ref">;
3
3
  type Textfield = ReturnType<typeof Textfield>;
4
4
  export default Textfield;
@@ -1,10 +1,37 @@
1
- import type { Base } from '../../internal/types.js';
2
- export interface TextfieldProps extends Base {
3
- is?: 'div';
1
+ import type { Component } from '../../internal/types.js';
2
+ import type { Snippet } from 'svelte';
3
+ export interface TextfieldProps extends Component {
4
+ ref?: HTMLElement | null;
5
+ dark?: boolean;
6
+ light?: boolean;
4
7
  value?: string | number;
5
8
  type?: 'text' | 'email' | 'password' | 'number';
6
9
  placeholder?: string;
7
10
  counter?: boolean;
8
11
  min?: number;
9
12
  max?: number;
13
+ variant?: 'outline' | 'text' | 'filled';
14
+ density?: 'compact' | 'comfortable' | 'default';
15
+ error?: boolean;
16
+ errorMessage?: string;
17
+ disabled?: boolean;
18
+ color?: string;
19
+ background?: string;
20
+ size?: string | {
21
+ [key: string]: string;
22
+ };
23
+ readonly?: boolean;
24
+ hideSpinButtons?: boolean;
25
+ persistentMessage?: boolean;
26
+ persistentClear?: boolean;
27
+ clearable?: boolean;
28
+ message?: string;
29
+ messagePrefix?: string;
30
+ messageSuffix?: string;
31
+ append?: Snippet;
32
+ prepend?: Snippet;
33
+ prependInner?: Snippet;
34
+ appendInner?: Snippet;
35
+ prefix?: string;
36
+ suffix?: string;
10
37
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  display: flex;
7
7
  align-items: center;
8
- min-width: max-content;
8
+ /* min-width: max-content; */
9
9
  border-style: solid;
10
10
  /* transition:
11
11
  color 0.5s,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapikit",
3
- "version": "0.0.0-insiders.b9305c0",
3
+ "version": "0.0.0-insiders.bd609af",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,7 +36,7 @@
36
36
  "**/*.css"
37
37
  ],
38
38
  "bin": {
39
- "lapikit": "bin/lapikit.js"
39
+ "lapikit": "bin/index.js"
40
40
  },
41
41
  "svelte": "./dist/index.js",
42
42
  "types": "./dist/index.d.ts",
@@ -90,5 +90,8 @@
90
90
  },
91
91
  "keywords": [
92
92
  "svelte"
93
- ]
93
+ ],
94
+ "dependencies": {
95
+ "prompts": "^2.4.2"
96
+ }
94
97
  }