Skip to content

Commit 2db545d

Browse files
committed
fix: correct imports
1 parent f0a344a commit 2db545d

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,21 @@ COPY ./ ./
2121
RUN pnpm install --offline
2222

2323

24-
FROM node:20.12.2-alpine@sha256:ec0c413b1d84f3f7f67ec986ba885930c57b5318d2eb3abc6960ee05d4f2eb28 AS build
25-
26-
WORKDIR /srv/app/
27-
28-
COPY --from=prepare /srv/app/ ./
24+
FROM prepare AS build
2925

3026
ENV NODE_ENV=production
3127

3228
RUN corepack enable && \
3329
pnpm install --offline --ignore-scripts
3430

3531

36-
FROM node:20.12.2-alpine@sha256:ec0c413b1d84f3f7f67ec986ba885930c57b5318d2eb3abc6960ee05d4f2eb28 AS test
37-
38-
WORKDIR /srv/app/
39-
40-
COPY --from=prepare /srv/app/ ./
32+
FROM prepare AS test
4133

4234
RUN corepack enable && \
4335
pnpm run test
4436

4537

46-
FROM node:20.12.2-alpine@sha256:ec0c413b1d84f3f7f67ec986ba885930c57b5318d2eb3abc6960ee05d4f2eb28 AS collect
47-
48-
WORKDIR /srv/app/
38+
FROM prepare AS collect
4939

5040
COPY --from=build /srv/app/ /srv/app/
5141
COPY --from=test /srv/app/package.json /tmp/package.json

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"devDependencies": {
1515
"@commitlint/cli": "19.2.2",
1616
"@commitlint/config-conventional": "19.2.2",
17+
"@types/diff": "5.0.9",
18+
"@types/json2md": "1.5.4",
19+
"@types/yargs": "17.0.32",
1720
"eslint": "9.0.0",
1821
"eslint-config-prettier": "9.1.0",
1922
"eslint-plugin-prettier": "5.1.3",

pnpm-lock.yaml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/generator.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ import fs from 'node:fs'
22
import path from 'node:path'
33

44
import deepMerge from 'deepmerge'
5-
import diff from 'diff'
5+
import { diffLines } from 'diff'
66
import json2md from 'json2md'
77
import yaml from 'yaml'
88
import yargs from 'yargs'
9+
import { hideBin } from 'yargs/helpers'
910

1011
const DEVELOPMENT_ONLY_REGEX = /^\s*DARGSTACK-REMOVE\s*$/
1112

1213
json2md.converters.vanilla = function (input, _json2md) {
1314
return input
1415
}
1516

16-
const argv = yargs
17+
const argv = yargs(hideBin(process.argv))
1718
.option('path', {
1819
alias: 'p',
1920
description: 'Path to a DargStack stack project',
@@ -25,7 +26,8 @@ const argv = yargs
2526
type: 'boolean',
2627
})
2728
.help()
28-
.alias('help', 'h').argv
29+
.alias('help', 'h')
30+
.parse()
2931

3032
const projectPath = argv.path || process.cwd()
3133
const validate = argv.validate || false
@@ -252,7 +254,7 @@ if (validate) {
252254
throw new Error('README.md file not found!')
253255
}
254256

255-
const difference = diff.diffLines(md + '\n', readme)
257+
const difference = diffLines(md + '\n', readme)
256258

257259
if (difference.length > 1) {
258260
console.error(

0 commit comments

Comments
 (0)