Skip to content

Commit

Permalink
fix(release): ci (#31)
Browse files Browse the repository at this point in the history
* chore(deps): update npm dependency to latest stable version

* refactor: update clean-sourcemap.command.ts to improve error handling and file parsing

* chore: update ci_install script permissions

* build: add build step to workflow for npm package
  • Loading branch information
devlegacy authored Aug 4, 2024
1 parent f400356 commit ca88a40
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 41 deletions.
5 changes: 0 additions & 5 deletions .etc/bin/ci_install
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#!/usr/bin/env bash

# sudo apt-get update && \
# sudo apt-get install -y \
# build-essential \
# libpng-dev

chmod +x ./.etc/bin/*
4 changes: 4 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
run: |
pnpm install --frozen-lockfile
- name: Build 🏗️
run: |
node --run build
- name: Publish to npm 🚀
if: ${{ steps.release.outputs.release_created }}
run: |
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@
"frontend"
],
"files": [
"assets/icons",
"bin",
"README.md"
],
"directories": {
"bin": "bin"
"bin": "bin",
"assets/icons": "assets/icons"
},
"author": "Samuel R. <[email protected]>",
"private": false,
"devDependencies": {
"@swc-node/register": "1.10.9",
"@swc/cli": "0.4.0",
"@swc/core": "1.7.5",
"@types/fs-extra": "11.0.4",
"@types/htmlhint": "1.1.5",
"@types/imagemin": "9.0.0",
"@types/imagemin-jpegtran": "5.0.4",
Expand Down
18 changes: 0 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/commands/files/clean-sourcemap.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class CleanSourcemap extends YargsCommand {
(files: File[], { info: { absolutePath } }) =>
files.concat(
...File.sync('**/*.css', {
nodir: true,
cwd: absolutePath,
absolute: true,
}).map((file) => File.find(file)),
Expand Down
13 changes: 3 additions & 10 deletions src/dvx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Argv } from 'yargs'
import yargs from 'yargs/yargs'
import { hideBin } from 'yargs/helpers'
import type { Class } from 'type-fest'

import { version, epilogue, usage, scriptName } from '#@/src/commands/version.js'
import type { YargsCommand } from './shared/yargs-command.js'
Expand Down Expand Up @@ -44,15 +43,9 @@ export class DvxCLI {
const keys = Object.keys(entities)
for (const key of keys) {
const entity = entities[`${key}`]
if (!isConstructor(entity)) continue
const command = entity as Class<YargsCommand>
const cmd = new command() as YargsCommand

try {
this.#yargs.command(cmd.command, cmd.description, cmd.builder, cmd.handler.bind(cmd))
} catch (err) {
this.#onError(cmd.command, err)
}
if (!isConstructor<YargsCommand>(entity)) continue
const cmd = new entity()
this.#yargs.command(cmd.command, cmd.description, cmd.builder, cmd.handler.bind(cmd))
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/shared/yargs-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ export abstract class YargsCommand {
return options
}

abstract handler(
args: ArgumentsCamelCase<InferredOptionTypes<typeof this.builder>>,
): Promise<void>
abstract handler(args: ArgumentsCamelCase<InferredOptionTypes<typeof this.builder>>): void
}

0 comments on commit ca88a40

Please sign in to comment.