Skip to content

Commit 361ae51

Browse files
committed
Use helpers and getHandlebarsPartials from smith
1 parent 3a5f2b3 commit 361ae51

7 files changed

Lines changed: 18 additions & 46 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@prettier/plugin-php": "^0.22.2",
3535
"@prettier/plugin-ruby": "^4.0.4",
3636
"@seamapi/blueprint": "^0.43.1",
37-
"@seamapi/smith": "^0.2.0",
37+
"@seamapi/smith": "^0.3.3",
3838
"@seamapi/types": "1.399.1",
3939
"change-case": "^5.4.4",
4040
"command-exists": "^1.2.9",

src/lib/handlebars-helpers.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1 @@
1-
import { capitalCase } from 'change-case'
2-
3-
export const eq = (v1: unknown, v2: unknown): boolean => {
4-
return v1 === v2
5-
}
6-
7-
export const or = (...args: unknown[]): boolean => {
8-
// remove the last argument, which is the Handlebars options object
9-
args.pop()
10-
11-
return args.some(Boolean)
12-
}
13-
14-
export const add = (v1: number, v2: number): number => {
15-
return v1 + v2
16-
}
17-
18-
export const toCapitalCase = (str: string): string => {
19-
return capitalCase(str)
20-
}
1+
export const identity = (x: unknown): unknown => x

src/lib/handlebars-partials.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/lib/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
import { handlebarsHelpers } from '@seamapi/smith'
2+
3+
import * as customHelpers from './handlebars-helpers.js'
4+
5+
export const helpers = { ...handlebarsHelpers, ...customHelpers }
6+
17
export * from './blueprint.js'
2-
export * as helpers from './handlebars-helpers.js'
3-
export * from './handlebars-partials.js'
48
export * from './postprocess.js'
59
export * from './reference.js'
610
export * from './report.js'

src/metalsmith.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { dirname } from 'node:path'
22
import { env } from 'node:process'
33
import { fileURLToPath } from 'node:url'
44

5+
import { getHandlebarsPartials } from '@seamapi/smith'
56
import layouts from '@metalsmith/layouts'
67
import metadata from '@metalsmith/metadata'
78
import { deleteAsync } from 'del'
89
import Metalsmith from 'metalsmith'
910

1011
import {
1112
blueprint,
12-
getHandlebarsPartials,
1313
helpers,
1414
postprocess,
1515
reference,

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
3-
"extends": "./node_modules/@seamapi/smith/tsconfig.json",
3+
"extends": "./node_modules/@seamapi/smith/tsconfig.base.json",
44
"files": ["src/index.ts"],
5-
"include": ["src/**/*"]
5+
"include": ["src/**/*"],
66
}

0 commit comments

Comments
 (0)