@porulle/cli 0.5.0 → 0.6.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 +21 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +31 -0
- package/dist/index.js +0 -0
- package/package.json +15 -15
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 unified-commerce-engine contributors
|
|
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/dist/commands/init.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
interface PackageJsonShape {
|
|
2
|
+
name?: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare function pinPorulleDependencies(pkg: PackageJsonShape, version: string): void;
|
|
1
7
|
export declare const initCommand: import("citty").CommandDef<{
|
|
2
8
|
projectName: {
|
|
3
9
|
type: "positional";
|
|
@@ -9,4 +15,5 @@ export declare const initCommand: import("citty").CommandDef<{
|
|
|
9
15
|
default: string;
|
|
10
16
|
};
|
|
11
17
|
}>;
|
|
18
|
+
export {};
|
|
12
19
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAUA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAaD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,MAAM,GACd,IAAI,CAWN;AASD,eAAO,MAAM,WAAW;;;;;;;;;;EAmDtB,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -6,6 +6,33 @@ import consola from "consola";
|
|
|
6
6
|
import { downloadTemplate } from "giget";
|
|
7
7
|
import { copyDir, readJson, writeJson } from "../utils.js";
|
|
8
8
|
const currentDir = fileURLToPath(new URL(".", import.meta.url));
|
|
9
|
+
const DEP_SECTIONS = [
|
|
10
|
+
"dependencies",
|
|
11
|
+
"devDependencies",
|
|
12
|
+
"peerDependencies",
|
|
13
|
+
"optionalDependencies",
|
|
14
|
+
];
|
|
15
|
+
// Scaffolded projects must pin @porulle/* to the version of the CLI that
|
|
16
|
+
// created them: the packages are a fixed-version group, so the running CLI's
|
|
17
|
+
// own version is the correct, coherent target. A literal range baked into the
|
|
18
|
+
// template would go stale on every release.
|
|
19
|
+
export function pinPorulleDependencies(pkg, version) {
|
|
20
|
+
for (const section of DEP_SECTIONS) {
|
|
21
|
+
const deps = pkg[section];
|
|
22
|
+
if (!deps || typeof deps !== "object")
|
|
23
|
+
continue;
|
|
24
|
+
const record = deps;
|
|
25
|
+
for (const name of Object.keys(record)) {
|
|
26
|
+
if (name.startsWith("@porulle/")) {
|
|
27
|
+
record[name] = `^${version}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function readCliVersion() {
|
|
33
|
+
const pkg = await readJson(resolve(currentDir, "../../package.json"));
|
|
34
|
+
return pkg.version;
|
|
35
|
+
}
|
|
9
36
|
export const initCommand = defineCommand({
|
|
10
37
|
meta: {
|
|
11
38
|
name: "init",
|
|
@@ -41,6 +68,10 @@ export const initCommand = defineCommand({
|
|
|
41
68
|
if (existsSync(packageJsonPath)) {
|
|
42
69
|
const pkg = await readJson(packageJsonPath);
|
|
43
70
|
pkg.name = projectName;
|
|
71
|
+
const cliVersion = await readCliVersion();
|
|
72
|
+
if (cliVersion) {
|
|
73
|
+
pinPorulleDependencies(pkg, cliVersion);
|
|
74
|
+
}
|
|
44
75
|
await writeJson(packageJsonPath, pkg);
|
|
45
76
|
}
|
|
46
77
|
consola.success(`Project created at ${destination}`);
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porulle/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"unifiedcommerce": "./dist/index.js"
|
|
8
8
|
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "rm -rf dist tsconfig.build.tsbuildinfo && tsc -p tsconfig.build.json",
|
|
11
|
-
"check-types": "tsc --noEmit",
|
|
12
|
-
"lint": "eslint . --max-warnings 1000",
|
|
13
|
-
"test": "vitest run"
|
|
14
|
-
},
|
|
15
9
|
"dependencies": {
|
|
16
10
|
"postgres": "^3.4.7",
|
|
17
11
|
"citty": "^0.1.6",
|
|
@@ -19,20 +13,20 @@
|
|
|
19
13
|
"giget": "^2.0.0"
|
|
20
14
|
},
|
|
21
15
|
"optionalDependencies": {
|
|
22
|
-
"@porulle/import-
|
|
23
|
-
"@porulle/import-shopify": "
|
|
24
|
-
"@porulle/import-
|
|
16
|
+
"@porulle/import-woocommerce": "0.6.0",
|
|
17
|
+
"@porulle/import-shopify": "0.6.0",
|
|
18
|
+
"@porulle/import-flat": "0.6.0"
|
|
25
19
|
},
|
|
26
20
|
"devDependencies": {
|
|
27
21
|
"@electric-sql/pglite": "0.4.5",
|
|
28
22
|
"@electric-sql/pglite-socket": "^0.1.5",
|
|
29
|
-
"@porulle/eslint-config": "*",
|
|
30
|
-
"@porulle/typescript-config": "*",
|
|
31
23
|
"@types/node": "^24.5.2",
|
|
32
24
|
"drizzle-kit": "^0.31.9",
|
|
33
25
|
"eslint": "^9.39.1",
|
|
34
26
|
"typescript": "5.9.2",
|
|
35
|
-
"vitest": "^3.2.4"
|
|
27
|
+
"vitest": "^3.2.4",
|
|
28
|
+
"@porulle/eslint-config": "0.1.0",
|
|
29
|
+
"@porulle/typescript-config": "0.1.0"
|
|
36
30
|
},
|
|
37
31
|
"publishConfig": {
|
|
38
32
|
"access": "public"
|
|
@@ -51,5 +45,11 @@
|
|
|
51
45
|
"url": "git+https://github.com/asyncdotengineering/porulle.git",
|
|
52
46
|
"directory": "packages/cli"
|
|
53
47
|
},
|
|
54
|
-
"author": "Porulle contributors"
|
|
55
|
-
|
|
48
|
+
"author": "Porulle contributors",
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "rm -rf dist tsconfig.build.tsbuildinfo && tsc -p tsconfig.build.json",
|
|
51
|
+
"check-types": "tsc --noEmit",
|
|
52
|
+
"lint": "eslint . --max-warnings 1000",
|
|
53
|
+
"test": "vitest run"
|
|
54
|
+
}
|
|
55
|
+
}
|