@sandro-sikic/maker 1.0.0 → 1.0.2
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/.github/workflows/publish.yml +49 -0
- package/index.d.ts +23 -0
- package/index.js +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: publish-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish package
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
id-token: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout repository
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Use Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 'lts/*'
|
|
28
|
+
cache: npm
|
|
29
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: npm ci
|
|
33
|
+
|
|
34
|
+
- name: Check if version already published
|
|
35
|
+
id: check
|
|
36
|
+
run: |
|
|
37
|
+
name=$(node -p "require('./package.json').name")
|
|
38
|
+
version=$(node -p "require('./package.json').version")
|
|
39
|
+
echo "package_name=$name" >> $GITHUB_OUTPUT
|
|
40
|
+
echo "version=$version" >> $GITHUB_OUTPUT
|
|
41
|
+
if npm view "${name}@${version}" >/dev/null 2>&1; then
|
|
42
|
+
echo "already_published=true" >> $GITHUB_OUTPUT
|
|
43
|
+
else
|
|
44
|
+
echo "already_published=false" >> $GITHUB_OUTPUT
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
- name: Publish to npm
|
|
48
|
+
if: steps.check.outputs.already_published == 'false'
|
|
49
|
+
run: npm publish --provenance --access public
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function init(): void;
|
|
2
|
+
|
|
3
|
+
export type RunResult = {
|
|
4
|
+
output: string;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
code: number | null;
|
|
8
|
+
isError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function run(
|
|
13
|
+
command: string,
|
|
14
|
+
opts?: { maxLines?: number },
|
|
15
|
+
): Promise<RunResult>;
|
|
16
|
+
|
|
17
|
+
// runtime-forwarded objects (exported as values in JS)
|
|
18
|
+
export const prompt: typeof import('@inquirer/prompts');
|
|
19
|
+
export const spinner: typeof import('ora');
|
|
20
|
+
|
|
21
|
+
// type forwarding for downstream consumers
|
|
22
|
+
export type { Ora } from 'ora';
|
|
23
|
+
export * from '@inquirer/prompts';
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandro-sikic/maker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A library to create dev cli",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"author": "sandro-sikic",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/sandro-sikic/maker"
|
|
11
|
+
},
|
|
7
12
|
"license": "ISC",
|
|
8
13
|
"dependencies": {
|
|
9
14
|
"@inquirer/prompts": "^8.2.0",
|