create-inferative 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,70 @@
1
+ Copyright (c) 2024 WP Online Magyarország Kft.
2
+ Website: https://wpo.hu
3
+ All Rights Reserved.
4
+
5
+ ==============================================================================
6
+ WP Online Magyarország Kft. - Internal Use Software License
7
+ ==============================================================================
8
+
9
+ This software package and its accompanying documentation (collectively, "the Software")
10
+ are the proprietary and confidential information of WP Online Magyarország Kft.
11
+ ("the Company").
12
+
13
+ 1. GRANT OF LICENSE:
14
+ Subject to the terms and conditions of this License, the Company grants to
15
+ its employees and authorized contractors ("Authorized Users") a non-exclusive,
16
+ non-transferable, revocable license to install, use, copy, and modify the
17
+ Software solely for internal Company business purposes.
18
+
19
+ 2. RESTRICTIONS:
20
+ Authorized Users shall not:
21
+ a. Distribute, sublicense, sell, rent, lease, lend, or otherwise transfer
22
+ the Software, or any part thereof, to any third party outside of
23
+ WP Online Magyarország Kft. without the express prior written permission
24
+ of an authorized representative of the Company.
25
+ b. Use the Software for any purpose not expressly permitted by this License,
26
+ including any personal or commercial projects unrelated to the
27
+ Company's business.
28
+ c. Remove or alter any copyright, trademark, or other proprietary notices
29
+ contained in the Software.
30
+ d. Reverse engineer, decompile, or disassemble the Software, except and
31
+ only to the extent that such activity is expressly permitted by
32
+ applicable law notwithstanding this limitation.
33
+
34
+ 3. OWNERSHIP AND INTELLECTUAL PROPERTY:
35
+ The Company retains all right, title, and interest in and to the Software,
36
+ including all copyrights, patents, trade secrets, trademarks, and other
37
+ intellectual property rights therein. No rights are granted to Authorized
38
+ Users other than those expressly set forth in this License.
39
+
40
+ 4. CONFIDENTIALITY:
41
+ The Software, including its source code, design, and structure, is
42
+ confidential information of the Company. Authorized Users shall treat the
43
+ Software with the same degree of care as they treat other Company
44
+ confidential information and shall not disclose it to any third party
45
+ without the Company's prior written consent.
46
+
47
+ 5. NO WARRANTY:
48
+ THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
51
+ THE COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
52
+ IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
53
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
54
+
55
+ 6. TERMINATION:
56
+ This License will terminate automatically if an Authorized User breaches any
57
+ of its terms and conditions. The license granted herein is also contingent
58
+ upon continued employment or contract with the Company and terminates
59
+ immediately upon the cessation of that relationship. Upon termination, the
60
+ Authorized User must cease all use of the Software and destroy all copies
61
+
62
+ of the Software in their possession or control.
63
+
64
+ 7. GOVERNING LAW:
65
+ This License shall be governed by and construed in accordance with the laws
66
+ of Hungary, without regard to its conflict of law principles. Any disputes
67
+ arising under or in connection with this License shall be subject to the
68
+ exclusive jurisdiction of the courts of Hungary.
69
+
70
+ For questions regarding this license, please contact office@wpo.hu.
package/README.md CHANGED
@@ -1,3 +1,54 @@
1
- # Temporary Holding Version
1
+ # `create-inferative`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Create a new Inferative project with nothing installed first. `npm create inferative` runs the same command as
4
+ `inferative init`, so every flag works the same way.
5
+
6
+ ## Create a project
7
+
8
+ Run one command for your package manager.
9
+
10
+ ```sh
11
+ npm create inferative@latest my-site
12
+ pnpm create inferative my-site
13
+ yarn create inferative my-site
14
+ bun create inferative my-site
15
+ ```
16
+
17
+ The command writes the project into the folder `my-site`. Leave the name out to fill the current folder. The folder
18
+ must not exist, or must be empty. The command never overwrites a file.
19
+
20
+ ## What it does
21
+
22
+ 1. It writes the `@inferative` and `@heximon` lines into the `.npmrc` of the project. Both scopes live on GitHub
23
+ Packages.
24
+ 2. It checks that npm can read both scopes. If it cannot, it removes what it wrote, prints the lines to add to your
25
+ `~/.npmrc`, and stops.
26
+ 3. It downloads the starter from the `inferative/starters` repository.
27
+ 4. It sets the `name` of the project and the version of `inferative` and of every `@inferative/*` package.
28
+ 5. It runs `pnpm install`.
29
+
30
+ The package itself comes from public npm. Its dependencies come from GitHub Packages, so the command needs these
31
+ lines in your `~/.npmrc` before it starts:
32
+
33
+ ```ini
34
+ @inferative:registry=https://npm.pkg.github.com
35
+ @heximon:registry=https://npm.pkg.github.com
36
+ //npm.pkg.github.com/:_authToken=<a GitHub token with the read:packages scope>
37
+ ```
38
+
39
+ ## Flags
40
+
41
+ | Flag | What it does |
42
+ | :-- | :-- |
43
+ | `--starter <name>` | The starter to use. `nuxt-cloudflare` by default. |
44
+ | `--source <giget source>` | Download this source instead of the default starters. |
45
+ | `--local <folder>` | Copy the starter from this starters folder. Nothing is downloaded. |
46
+ | `--no-install` | Do not run `pnpm install`. |
47
+ | `--cwd <folder>` | The folder in which a named project folder is created. |
48
+
49
+ `pnpm`, `yarn` and `bun` pass a `--` to this package. The package drops the first one, so
50
+ `pnpm create inferative my-site -- --no-install` works as written.
51
+
52
+ ## Works with
53
+
54
+ - [`inferative`](../cli) holds the `init` command. This package only runs it under the name `create-inferative`.
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/bin.mjs ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { t as CreateFrontDoor } from "./front-door-Blirg1zz.mjs";
3
+ import { runMain } from "citty";
4
+ //#region src/bin.ts
5
+ await runMain(CreateFrontDoor.command(), { rawArgs: [...CreateFrontDoor.rawArgs(process.argv.slice(2))] });
6
+ //#endregion
7
+ export {};
@@ -0,0 +1,44 @@
1
+ import { createRequire } from "node:module";
2
+ import { InitCommand } from "inferative";
3
+ //#region src/front-door.ts
4
+ /**
5
+ * The front door of `npm create inferative`.
6
+ *
7
+ * It reuses the arguments and the `run` of {@link InitCommand}, so the two names never differ. It sets its own
8
+ * `meta`: `--help` then prints the binary that the user typed, and `--version` has a version to print.
9
+ */
10
+ var CreateFrontDoor = class CreateFrontDoor {
11
+ /** The binary name, as the usage line of `--help` shows it. */
12
+ static binaryName = "create-inferative";
13
+ /** The end-of-options marker that some package managers pass on to the binary. */
14
+ static optionsSeparator = "--";
15
+ /** The command that citty runs. */
16
+ static command() {
17
+ return {
18
+ ...InitCommand.definition(),
19
+ meta: {
20
+ name: CreateFrontDoor.binaryName,
21
+ version: CreateFrontDoor.version(),
22
+ description: "Create a new Inferative project (the `npm create inferative` front door)."
23
+ }
24
+ };
25
+ }
26
+ /**
27
+ * The arguments that citty parses, without the first bare `--`.
28
+ *
29
+ * `npm create` removes the separator itself. `pnpm`, `yarn` and `bun` pass it on, and citty puts every
30
+ * argument after it into the positional list, where no flag reads it.
31
+ *
32
+ * @param argv - The arguments after the executable's name.
33
+ */
34
+ static rawArgs(argv) {
35
+ const separator = argv.indexOf(CreateFrontDoor.optionsSeparator);
36
+ return separator === -1 ? [...argv] : [...argv.slice(0, separator), ...argv.slice(separator + 1)];
37
+ }
38
+ /** The version of this package, which `--version` prints. */
39
+ static version() {
40
+ return createRequire(import.meta.url)("../package.json").version;
41
+ }
42
+ };
43
+ //#endregion
44
+ export { CreateFrontDoor as t };
@@ -0,0 +1,30 @@
1
+ import { CommandDef } from "citty";
2
+ import { InitCommand } from "inferative";
3
+ //#region src/front-door.d.ts
4
+ /**
5
+ * The front door of `npm create inferative`.
6
+ *
7
+ * It reuses the arguments and the `run` of {@link InitCommand}, so the two names never differ. It sets its own
8
+ * `meta`: `--help` then prints the binary that the user typed, and `--version` has a version to print.
9
+ */
10
+ export declare class CreateFrontDoor {
11
+ /** The binary name, as the usage line of `--help` shows it. */
12
+ static readonly binaryName: string;
13
+ /** The end-of-options marker that some package managers pass on to the binary. */
14
+ private static readonly optionsSeparator;
15
+ /** The command that citty runs. */
16
+ static command(): CommandDef;
17
+ /**
18
+ * The arguments that citty parses, without the first bare `--`.
19
+ *
20
+ * `npm create` removes the separator itself. `pnpm`, `yarn` and `bun` pass it on, and citty puts every
21
+ * argument after it into the positional list, where no flag reads it.
22
+ *
23
+ * @param argv - The arguments after the executable's name.
24
+ */
25
+ static rawArgs(argv: readonly string[]): readonly string[];
26
+ /** The version of this package, which `--version` prints. */
27
+ private static version;
28
+ }
29
+ //#endregion
30
+ export { InitCommand };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { t as CreateFrontDoor } from "./front-door-Blirg1zz.mjs";
2
+ import { InitCommand } from "inferative";
3
+ export { CreateFrontDoor, InitCommand };
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "create-inferative",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Create a new Inferative project: the `npm create inferative` front door of `inferative init`.",
5
+ "keywords": [
6
+ "create",
7
+ "inferative",
8
+ "scaffolding",
9
+ "starter"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/inferative/inferative.git",
14
+ "directory": "packages/create-inferative"
15
+ },
16
+ "bin": {
17
+ "create-inferative": "./dist/bin.mjs"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "type": "module",
23
+ "sideEffects": false,
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.mts",
27
+ "default": "./dist/index.mjs"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "dependencies": {
35
+ "citty": "0.1.6",
36
+ "inferative": "0.1.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^24.13.3",
40
+ "typescript": "^6.0.3",
41
+ "vite-plus": "^0.3.1",
42
+ "vitest": "^5.0.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=24"
46
+ },
47
+ "scripts": {
48
+ "build": "vp pack",
49
+ "test": "vitest run"
50
+ }
6
51
  }