@pikku/cli 0.6.8 → 0.6.9
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 +6 -0
- package/bin/pikku-fetch.ts +2 -2
- package/bin/pikku-websocket.ts +5 -2
- package/dist/bin/pikku-fetch.js +2 -2
- package/dist/bin/pikku-websocket.js +5 -2
- package/dist/package.json +43 -0
- package/dist/src/utils.js +5 -4
- package/package.json +1 -1
- package/src/utils.ts +5 -4
package/CHANGELOG.md
CHANGED
package/bin/pikku-fetch.ts
CHANGED
|
@@ -17,10 +17,10 @@ export const pikkuFetch = async ({
|
|
|
17
17
|
await logCommandInfoAndTime(
|
|
18
18
|
'Generating fetch wrapper',
|
|
19
19
|
'Generated fetch wrapper',
|
|
20
|
-
[fetchFile === undefined,
|
|
20
|
+
[fetchFile === undefined, "fetchFile isn't set in the pikku config"],
|
|
21
21
|
async () => {
|
|
22
22
|
if (!fetchFile) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error("fetchFile is isn't set in the pikku config")
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const routesMapDeclarationPath = getFileImportRelativePath(
|
package/bin/pikku-websocket.ts
CHANGED
|
@@ -17,10 +17,13 @@ export const pikkuWebSocket = async ({
|
|
|
17
17
|
await logCommandInfoAndTime(
|
|
18
18
|
'Generating websocket wrapper',
|
|
19
19
|
'Generated websocket wrapper',
|
|
20
|
-
[
|
|
20
|
+
[
|
|
21
|
+
websocketFile === undefined,
|
|
22
|
+
"websocketFile isn't set in the pikku config",
|
|
23
|
+
],
|
|
21
24
|
async () => {
|
|
22
25
|
if (!websocketFile) {
|
|
23
|
-
throw new Error(
|
|
26
|
+
throw new Error("fetchFile is isn't set in the pikku config")
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
const channelsMapDeclarationPath = getFileImportRelativePath(
|
package/dist/bin/pikku-fetch.js
CHANGED
|
@@ -2,9 +2,9 @@ import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFi
|
|
|
2
2
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
3
|
import { serializeFetchWrapper } from '../src/http/serialize-fetch-wrapper.js';
|
|
4
4
|
export const pikkuFetch = async ({ fetchFile, routesMapDeclarationFile, packageMappings, }) => {
|
|
5
|
-
await logCommandInfoAndTime('Generating fetch wrapper', 'Generated fetch wrapper', [fetchFile === undefined,
|
|
5
|
+
await logCommandInfoAndTime('Generating fetch wrapper', 'Generated fetch wrapper', [fetchFile === undefined, "fetchFile isn't set in the pikku config"], async () => {
|
|
6
6
|
if (!fetchFile) {
|
|
7
|
-
throw new Error(
|
|
7
|
+
throw new Error("fetchFile is isn't set in the pikku config");
|
|
8
8
|
}
|
|
9
9
|
const routesMapDeclarationPath = getFileImportRelativePath(fetchFile, routesMapDeclarationFile, packageMappings);
|
|
10
10
|
const content = [serializeFetchWrapper(routesMapDeclarationPath)];
|
|
@@ -2,9 +2,12 @@ import { getFileImportRelativePath, logCommandInfoAndTime, logPikkuLogo, writeFi
|
|
|
2
2
|
import { getPikkuCLIConfig } from '../src/pikku-cli-config.js';
|
|
3
3
|
import { serializeWebsocketWrapper } from '../src/channels/serialize-websocket-wrapper.js';
|
|
4
4
|
export const pikkuWebSocket = async ({ websocketFile, channelsMapDeclarationFile, packageMappings, }) => {
|
|
5
|
-
await logCommandInfoAndTime('Generating websocket wrapper', 'Generated websocket wrapper', [
|
|
5
|
+
await logCommandInfoAndTime('Generating websocket wrapper', 'Generated websocket wrapper', [
|
|
6
|
+
websocketFile === undefined,
|
|
7
|
+
"websocketFile isn't set in the pikku config",
|
|
8
|
+
], async () => {
|
|
6
9
|
if (!websocketFile) {
|
|
7
|
-
throw new Error(
|
|
10
|
+
throw new Error("fetchFile is isn't set in the pikku config");
|
|
8
11
|
}
|
|
9
12
|
const channelsMapDeclarationPath = getFileImportRelativePath(websocketFile, channelsMapDeclarationFile, packageMappings);
|
|
10
13
|
const content = [serializeWebsocketWrapper(channelsMapDeclarationPath)];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pikku/cli",
|
|
3
|
+
"version": "0.6.9",
|
|
4
|
+
"author": "yasser.fadl@gmail.com",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"pikku": "dist/bin/pikku.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/bin/pikku.js",
|
|
11
|
+
"module": "dist/bin/pikku.js",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"tsc": "tsc",
|
|
14
|
+
"build:esm": "tsc -b",
|
|
15
|
+
"schema": "ts-json-schema-generator -o cli.schema.json --path 'src/pikku-cli-config.ts' --type 'PikkuCLIConfig'",
|
|
16
|
+
"build": "yarn build:esm && yarn schema",
|
|
17
|
+
"ncu": "npx npm-check-updates -x '/.*glob.*/'",
|
|
18
|
+
"release": "yarn build && npm test",
|
|
19
|
+
"test": "bash run-tests.sh",
|
|
20
|
+
"test:watch": "bash run-tests.sh --watch",
|
|
21
|
+
"test:coverage": "bash run-tests.sh --coverage"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@openapi-contrib/json-schema-to-openapi-schema": "^3.0.2",
|
|
25
|
+
"@pikku/core": "^0.6.11",
|
|
26
|
+
"@pikku/inspector": "^0.6.2",
|
|
27
|
+
"@types/cookie": "^0.6.0",
|
|
28
|
+
"@types/uuid": "^10.0.0",
|
|
29
|
+
"chalk": "^5.4.1",
|
|
30
|
+
"commander": "^12",
|
|
31
|
+
"glob": "^10",
|
|
32
|
+
"path-to-regexp": "^8.2.0",
|
|
33
|
+
"ts-json-schema-generator": "^2.3.0",
|
|
34
|
+
"typescript": "^5.6",
|
|
35
|
+
"yaml": "^2.6.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^22.7.8"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/dist/src/utils.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { relative, dirname } from 'path';
|
|
3
3
|
import { mkdir, writeFile } from 'fs/promises';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
+
import packageJson from '../package.json';
|
|
5
6
|
export const logPrimary = (message) => {
|
|
6
|
-
console.log(chalk.green(
|
|
7
|
+
console.log(chalk.green(message));
|
|
7
8
|
};
|
|
8
9
|
export const logSuccess = (message) => {
|
|
9
|
-
console.log(chalk.green(
|
|
10
|
+
console.log(chalk.green(message));
|
|
10
11
|
};
|
|
11
12
|
export const logInfo = (message) => {
|
|
12
|
-
console.log(chalk.blue(
|
|
13
|
+
console.log(chalk.blue(message));
|
|
13
14
|
};
|
|
14
15
|
export const getFileImportRelativePath = (from, to, packageMappings) => {
|
|
15
16
|
let filePath = relative(dirname(from), to);
|
|
@@ -119,7 +120,7 @@ const logo = `
|
|
|
119
120
|
`;
|
|
120
121
|
export const logPikkuLogo = () => {
|
|
121
122
|
logPrimary(logo);
|
|
122
|
-
logPrimary(
|
|
123
|
+
logPrimary(`⚙️ Welcome to the Pikku CLI (v${packageJson})\n`);
|
|
123
124
|
};
|
|
124
125
|
// TODO: add version back in once the ESM dust settles
|
|
125
126
|
export const DO_NOT_MODIFY_COMMENT = `/**
|
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -3,17 +3,18 @@ import { relative, dirname } from 'path'
|
|
|
3
3
|
import { PathToNameAndType, InspectorState } from '@pikku/inspector'
|
|
4
4
|
import { mkdir, writeFile } from 'fs/promises'
|
|
5
5
|
import chalk from 'chalk'
|
|
6
|
+
import packageJson from '../package.json'
|
|
6
7
|
|
|
7
8
|
export const logPrimary = (message: string) => {
|
|
8
|
-
console.log(chalk.green(
|
|
9
|
+
console.log(chalk.green(message))
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const logSuccess = (message: string) => {
|
|
12
|
-
console.log(chalk.green(
|
|
13
|
+
console.log(chalk.green(message))
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const logInfo = (message: string) => {
|
|
16
|
-
console.log(chalk.blue(
|
|
17
|
+
console.log(chalk.blue(message))
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const getFileImportRelativePath = (
|
|
@@ -230,7 +231,7 @@ const logo = `
|
|
|
230
231
|
|
|
231
232
|
export const logPikkuLogo = () => {
|
|
232
233
|
logPrimary(logo)
|
|
233
|
-
logPrimary(
|
|
234
|
+
logPrimary(`⚙️ Welcome to the Pikku CLI (v${packageJson})\n`)
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
// TODO: add version back in once the ESM dust settles
|