@tsparticles/cli-command-create 4.0.0-beta.12 → 4.0.0-beta.15
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 +8 -0
- package/README.md +96 -0
- package/dist/create.js +18 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -37
- package/src/create.ts +18 -6
- package/.cache/eslint/.eslintcache +0 -1
- package/dist/plugin/create-plugin.d.ts +0 -8
- package/dist/plugin/create-plugin.js +0 -136
- package/dist/plugin/plugin.d.ts +0 -3
- package/dist/plugin/plugin.js +0 -34
- package/dist/preset/create-preset.d.ts +0 -8
- package/dist/preset/create-preset.js +0 -154
- package/dist/preset/preset.d.ts +0 -3
- package/dist/preset/preset.js +0 -34
- package/dist/shape/create-shape.d.ts +0 -8
- package/dist/shape/create-shape.js +0 -137
- package/dist/shape/shape.d.ts +0 -3
- package/dist/shape/shape.js +0 -34
- package/src/plugin/create-plugin.ts +0 -198
- package/src/plugin/plugin.ts +0 -46
- package/src/preset/create-preset.ts +0 -218
- package/src/preset/preset.ts +0 -46
- package/src/shape/create-shape.ts +0 -200
- package/src/shape/shape.ts +0 -46
package/src/shape/shape.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { capitalize, getDestinationDir, getRepositoryUrl } from "@tsparticles/cli-create-utils";
|
|
2
|
-
import prompts, { type PromptObject } from "prompts";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { createShapeTemplate } from "./create-shape.js";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
|
|
7
|
-
const shapeCommand = new Command("shape");
|
|
8
|
-
|
|
9
|
-
shapeCommand.description("Create a new tsParticles shape");
|
|
10
|
-
shapeCommand.argument("<destination>", "Destination folder");
|
|
11
|
-
shapeCommand.action(async (destination: string) => {
|
|
12
|
-
const destPath = await getDestinationDir(destination),
|
|
13
|
-
repoUrl = await getRepositoryUrl(),
|
|
14
|
-
initialName = destPath.split(path.sep).pop(),
|
|
15
|
-
questions: PromptObject[] = [
|
|
16
|
-
{
|
|
17
|
-
type: "text",
|
|
18
|
-
name: "name",
|
|
19
|
-
message: "What is the name of the shape?",
|
|
20
|
-
validate: (value: string) => (value ? true : "The name can't be empty"),
|
|
21
|
-
initial: initialName,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
type: "text",
|
|
25
|
-
name: "description",
|
|
26
|
-
message: "What is the description of the shape?",
|
|
27
|
-
validate: (value: string) => (value ? true : "The description can't be empty"),
|
|
28
|
-
initial: capitalize(initialName ?? ""),
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "text",
|
|
32
|
-
name: "repositoryUrl",
|
|
33
|
-
message: "What is the repository URL? (optional)",
|
|
34
|
-
initial: repoUrl.trim(),
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
{ name, description, repositoryUrl } = (await prompts(questions)) as {
|
|
38
|
-
description: string;
|
|
39
|
-
name: string;
|
|
40
|
-
repositoryUrl: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
await createShapeTemplate(name.trim(), description.trim(), repositoryUrl.trim(), destPath);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { shapeCommand };
|