Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dbf156311e | |||
| cd5585afea | |||
| b3138b437e | |||
| c6259cfa62 | |||
| 8ea2b560a5 | |||
| 60aef4cc01 | |||
| 692752fb30 | |||
| a5e940b003 | |||
| e9ccd5ffb0 | |||
| c57978c228 | |||
| f0aa4b92c6 | |||
| 503efc10fc | |||
| 0b80dbf999 | |||
| ce2208f1b2 | |||
| 44dd2a659a | |||
| c2b3d7dc3c |
22
.github/workflows/build.yaml
vendored
22
.github/workflows/build.yaml
vendored
@@ -16,15 +16,19 @@ jobs:
|
||||
- name: Install & Build
|
||||
run: npm i && npm run build
|
||||
|
||||
- name: Upload to Registry
|
||||
uses: ztimson/actions/npm/publish@develop
|
||||
- name: Publish Library
|
||||
run: |
|
||||
if [ "${{github.ref_name}}" = "master" ]; then
|
||||
REGISTRY="${{github.server_url}}/api/packages/${{github.repository_owner}}/npm/"
|
||||
npm set registry "$REGISTRY"
|
||||
npm set $(echo $REGISTRY | sed s%http:%% | sed s%https:%% ):_authToken "${{secrets.DEPLOY_TOKEN}}"
|
||||
npm publish || echo "Failed to publish"
|
||||
|
||||
- name: Upload to NPM
|
||||
uses: ztimson/actions/npm/publish@develop
|
||||
with:
|
||||
owner: ztimson
|
||||
registry: https://registry.npmjs.org/
|
||||
token: ${{secrets.NPM_TOKEN}}
|
||||
REGISTRY="https://registry.npmjs.org/"
|
||||
npm set registry "$REGISTRY"
|
||||
npm set $(echo $REGISTRY | sed s%http:%% | sed s%https:%% ):_authToken "${{secrets.NPM_TOKEN}}"
|
||||
npm publish || echo "Failed to publish"
|
||||
fi
|
||||
tag:
|
||||
name: Tag Version
|
||||
needs: build
|
||||
@@ -48,6 +52,6 @@ jobs:
|
||||
needs: build
|
||||
uses: ztimson/actions/.github/workflows/docker.yaml@develop
|
||||
with:
|
||||
name: ztimson/css-utils
|
||||
name: ztimson/node-utils
|
||||
repository: ${{github.server_url}}/${{github.repository}}.git
|
||||
pass: ${{secrets.DEPLOY_TOKEN}}
|
||||
|
||||
2114
package-lock.json
generated
2114
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ztimson/node-utils",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.7",
|
||||
"description": "CSS Utility Classes",
|
||||
"author": "ztimson",
|
||||
"license": "MIT",
|
||||
@@ -10,27 +10,25 @@
|
||||
"type": "git",
|
||||
"url": "git.zakscode.com:ztimson/node-utils"
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx tsc && npx vite build",
|
||||
"build": "tsc",
|
||||
"docs": "typedoc --cleanOutputDir false --out ./docs --entryPoints src/**/*.ts --readme none",
|
||||
"watch": "npx vite build --watch"
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.0.0",
|
||||
"@types/node": "^24.10.4",
|
||||
"tsx": "^4.21.0",
|
||||
"typedoc": "^0.28.5",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-dts": "^4.5.4"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {exec, execSync} from 'child_process';
|
||||
import {exec, execSync} from 'node:child_process';
|
||||
|
||||
export function $(str: TemplateStringsArray, ...args: string[]): Promise<string> {
|
||||
let cmd = str.reduce((acc, part, i) => acc + part + (args[i] || ''), '');
|
||||
return new Promise((res, rej) => exec(cmd, (err, stdout, stderr) => {
|
||||
if(err || stderr) return rej(err || stderr);
|
||||
return res(stdout);
|
||||
if(err) return rej(stderr || err);
|
||||
return res(stdout?.trim() || stderr?.trim());
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from './cli';
|
||||
export * from './input';
|
||||
export * from './cli.js';
|
||||
export * from './input.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import readline from 'node:readline';
|
||||
import readline from 'readline';
|
||||
|
||||
/**
|
||||
* Retrieve input from the CLI
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
{
|
||||
"include": ["src"],
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"lib": ["ESNext"],
|
||||
"lib": ["ES2022"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "NodeNext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"declaration": true,
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"declarationMap": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import {resolve} from 'path';
|
||||
import {defineConfig} from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(process.cwd(), 'src/index.ts'),
|
||||
name: 'node-utils',
|
||||
fileName: (format: string) => format === 'es' ? 'index.mjs' : 'index.cjs'
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [
|
||||
'child_process',
|
||||
'readline'
|
||||
],
|
||||
},
|
||||
emptyOutDir: true,
|
||||
minify: false,
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [dts()],
|
||||
});
|
||||
Reference in New Issue
Block a user