pika-ux 1.0.0-beta.3 → 1.0.0-beta.5
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/dist/cli/index.js +21 -10
- package/package.json +1 -1
- package/readme.md +42 -7
package/dist/cli/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { promisify } from 'util';
|
|
|
11
11
|
import ora from 'ora';
|
|
12
12
|
import semver from 'semver';
|
|
13
13
|
import { glob } from 'glob';
|
|
14
|
+
import { createRequire } from 'module';
|
|
14
15
|
|
|
15
16
|
var Logger = class {
|
|
16
17
|
spinner = null;
|
|
@@ -120,11 +121,10 @@ async function copyAndProcessTemplate(templateDir, targetDir, variables) {
|
|
|
120
121
|
await fs.ensureDir(targetDir);
|
|
121
122
|
await processTemplateFiles(templateDir, targetDir, variables);
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
-
// tools/cli/commands/create.ts
|
|
125
124
|
var execAsync2 = promisify(exec);
|
|
126
125
|
var __filename = fileURLToPath(import.meta.url);
|
|
127
126
|
var __dirname = path2.dirname(__filename);
|
|
127
|
+
var require2 = createRequire(import.meta.url);
|
|
128
128
|
async function createCommand(options = {}) {
|
|
129
129
|
try {
|
|
130
130
|
logger.newLine();
|
|
@@ -180,10 +180,21 @@ async function createCommand(options = {}) {
|
|
|
180
180
|
}
|
|
181
181
|
const spinner = logger.startSpinner("Creating project...");
|
|
182
182
|
try {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
let pikaUxVersion = "1.0.0-beta.4";
|
|
184
|
+
try {
|
|
185
|
+
const pikaUxPackageJsonPath = require2.resolve("pika-ux/package.json");
|
|
186
|
+
const pikaUxPackageJson = await fs.readJson(pikaUxPackageJsonPath);
|
|
187
|
+
pikaUxVersion = pikaUxPackageJson.version;
|
|
188
|
+
} catch (error) {
|
|
189
|
+
logger.debug("Could not determine pika-ux version, using fallback");
|
|
190
|
+
}
|
|
191
|
+
let templateDir;
|
|
192
|
+
try {
|
|
193
|
+
const pikaUxRoot = path2.dirname(require2.resolve("pika-ux/package.json"));
|
|
194
|
+
templateDir = path2.join(pikaUxRoot, "dist/cli/template-files");
|
|
195
|
+
} catch (error) {
|
|
196
|
+
templateDir = path2.join(__dirname, "../template-files");
|
|
197
|
+
}
|
|
187
198
|
logger.updateSpinner("Processing template files...");
|
|
188
199
|
await copyAndProcessTemplate(templateDir, targetPath, {
|
|
189
200
|
projectName,
|
|
@@ -238,7 +249,7 @@ var __filename2 = fileURLToPath(import.meta.url);
|
|
|
238
249
|
var __dirname2 = path2.dirname(__filename2);
|
|
239
250
|
var packageJson = JSON.parse(readFileSync(path2.join(__dirname2, "../../package.json"), "utf8"));
|
|
240
251
|
var program = new Command();
|
|
241
|
-
program.name("
|
|
252
|
+
program.name("pika-ux").description("CLI tool for creating Pika webcomponent applications").version(packageJson.version);
|
|
242
253
|
program.command("create").description("Create a new Pika webcomponent application").argument("[name]", "Project name").action(async (name) => {
|
|
243
254
|
await validateNodeVersion();
|
|
244
255
|
await validatePnpm();
|
|
@@ -247,10 +258,10 @@ program.command("create").description("Create a new Pika webcomponent applicatio
|
|
|
247
258
|
program.on("--help", () => {
|
|
248
259
|
console.log("");
|
|
249
260
|
console.log(chalk2.bold("Examples:"));
|
|
250
|
-
console.log(chalk2.gray(" $
|
|
251
|
-
console.log(chalk2.gray(" $
|
|
261
|
+
console.log(chalk2.gray(" $ pika-ux create"));
|
|
262
|
+
console.log(chalk2.gray(" $ pika-ux create my-webcomponent"));
|
|
252
263
|
console.log("");
|
|
253
|
-
console.log(chalk2.dim('Tip: You can also use "
|
|
264
|
+
console.log(chalk2.dim('Tip: You can also use "pikaux" for shorter typing'));
|
|
254
265
|
console.log("");
|
|
255
266
|
});
|
|
256
267
|
program.exitOverride((err) => {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,23 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
UI Components library for the Pika project. This package contains both custom Pika components and shadcn/ui components adapted for Svelte.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start: Create a Webcomponent Project
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The fastest way to create a new webcomponent project with Pika UX:
|
|
8
8
|
|
|
9
|
+
```bash
|
|
10
|
+
pnpm dlx pika-ux create my-webcomponent
|
|
9
11
|
```
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
### Global Installation (Optional)
|
|
14
|
+
|
|
15
|
+
If you'll be creating multiple projects, you can install globally:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# pnpm (recommended)
|
|
19
|
+
pnpm add -g pika-ux
|
|
20
|
+
|
|
21
|
+
# npm
|
|
22
|
+
npm install -g pika-ux
|
|
23
|
+
|
|
24
|
+
# yarn
|
|
25
|
+
yarn global add pika-ux
|
|
11
26
|
```
|
|
12
27
|
|
|
13
|
-
|
|
28
|
+
Then use the command:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pika-ux create my-webcomponent
|
|
32
|
+
# or use the shorter alias
|
|
33
|
+
pikaux create my-webcomponent
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Both `pika-ux` and `pikaux` commands work identically - use whichever you prefer!
|
|
37
|
+
|
|
38
|
+
## Manual Installation
|
|
39
|
+
|
|
40
|
+
If you prefer to add Pika UX to an existing project:
|
|
41
|
+
|
|
42
|
+
1. Install the module
|
|
14
43
|
|
|
15
44
|
```bash
|
|
16
|
-
npm install pika-ux
|
|
17
|
-
# or
|
|
18
45
|
pnpm install pika-ux
|
|
46
|
+
# or
|
|
47
|
+
npm install pika-ux
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
2. Install peer dependencies
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm install @iconify-json/ci @iconify-json/lucide @tailwindcss/vite tailwindcss unplugin-icons
|
|
19
54
|
```
|
|
20
55
|
|
|
21
|
-
|
|
56
|
+
3. Modify `vite.config.ts`
|
|
22
57
|
|
|
23
58
|
The config below turns on tailwind and also the unplugin-icons to make icons available.
|
|
24
59
|
|