@tsparticles/cli-create-utils 4.0.0-beta.12 → 4.0.0-beta.16

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 ADDED
@@ -0,0 +1,12 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [4.0.0-beta.16](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.15...v4.0.0-beta.16) (2026-05-09)
7
+
8
+ **Note:** Version bump only for package @tsparticles/cli-create-utils
9
+
10
+ # [4.0.0-beta.15](https://github.com/tsparticles/tsparticles/compare/v4.0.0-beta.14...v4.0.0-beta.15) (2026-05-09)
11
+
12
+ **Note:** Version bump only for package @tsparticles/cli-create-utils
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Matteo Bruni
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,51 +1,52 @@
1
- [![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org)
1
+ # @tsparticles/cli-create-utils
2
2
 
3
- # tsParticles CLI
3
+ Shared utilities used by `@tsparticles/cli-command-create` and all modular `create-*` command packages.
4
4
 
5
- ## Installation
6
-
7
- ### NPM
8
-
9
- ```bash
10
- npm install -g @tsparticles/cli-create
11
- ```
5
+ ## What It Provides
12
6
 
13
- ### Yarn
7
+ - project scaffold generation (`createProjectTemplate`)
8
+ - interactive prompt helpers (`promptProjectData`)
9
+ - filesystem helpers (`getDestinationDir`, `getRepositoryUrl`, token replacement)
10
+ - template/package update helpers (`updatePackageFile`, `copyEmptyTemplateFiles`, `runInstall`, `runBuild`)
11
+ - string naming helpers (`capitalize`, `camelize`, `dash`)
14
12
 
15
- ```bash
16
- yarn global add @tsparticles/cli-create
17
- ```
18
-
19
- ### PNPM
13
+ ## Installation
20
14
 
21
15
  ```bash
22
- pnpm global add @tsparticles/cli-create
16
+ pnpm add @tsparticles/cli-create-utils
23
17
  ```
24
18
 
25
- ## Usage
19
+ ## Exports
26
20
 
27
- ### Help
21
+ This package re-exports everything from:
28
22
 
29
- ```bash
30
- npx @tsparticles/cli-create --help
31
- ```
23
+ - `src/create-project.ts`
24
+ - `src/file-utils.ts`
25
+ - `src/prompt-utils.ts`
26
+ - `src/string-utils.ts`
27
+ - `src/template-utils.ts`
32
28
 
33
- or
29
+ ## Typical Usage
34
30
 
35
- ```bash
36
- tsparticles-create --help
37
- ```
31
+ ```ts
32
+ import { Command } from "commander";
33
+ import { createProjectTemplate, promptProjectData } from "@tsparticles/cli-create-utils";
38
34
 
39
- ### Create
35
+ const cmd = new Command("shape");
40
36
 
41
- #### Preset
37
+ cmd.argument("<destination>");
38
+ cmd.action(async destination => {
39
+ const data = await promptProjectData({
40
+ destination,
41
+ nameLabel: "shape",
42
+ });
42
43
 
43
- ```bash
44
- npx @tsparticles/cli-create preset <folder>
45
- ```
46
-
47
- or
48
-
49
- ```bash
50
- tsparticles-create preset <folder>
44
+ await createProjectTemplate({
45
+ description: data.description,
46
+ destination: data.destinationPath,
47
+ kind: "shape",
48
+ name: data.name,
49
+ repositoryUrl: data.repositoryUrl,
50
+ });
51
+ });
51
52
  ```
@@ -0,0 +1,18 @@
1
+ export type CreateProjectKind = "bundle" | "effect" | "interaction" | "palette" | "path" | "plugin" | "preset" | "shape" | "updater";
2
+ export type InteractionType = "external" | "generic" | "particles";
3
+ export type PluginType = "color-manager" | "easing" | "emitters-shape" | "export" | "generic";
4
+ type SubType = InteractionType | PluginType | undefined;
5
+ export interface ICreateProjectOptions {
6
+ description: string;
7
+ destination: string;
8
+ kind: CreateProjectKind;
9
+ name: string;
10
+ repositoryUrl: string;
11
+ type?: SubType;
12
+ }
13
+ /**
14
+ *
15
+ * @param options
16
+ */
17
+ export declare function createProjectTemplate(options: ICreateProjectOptions): Promise<void>;
18
+ export {};