Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cli/just-modules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Type overrides for just-* packages.
*
* just-* ships CJS entry points (exports.require), but its types use export default
* and "type": "module", so, in this repository (where `compilerOptions.module` is `node16`),
* TS1479 error happens.
*
* In this file, we add `export =` for these packages to fill the gap.
*/

declare module 'just-camel-case' {
function camelCase(value: string): string
export = camelCase
}

declare module 'just-kebab-case' {
function kebabCase(value: string): string
export = kebabCase
}

declare module 'just-split' {
function split<T>(arr: T[], n?: number): T[][]
export = split
}
7 changes: 3 additions & 4 deletions cli/npm_catalog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,9 @@
"@lexical/selection" = "0.21.0"
"@lexical/utils" = "0.21.0"
"lexical" = "0.21.0"
"@types/lodash" = "4.17.20"
"@types/lodash-es" = "4.17.12"
"lodash" = "4.18.1"
"lodash-es" = "4.18.1"
"just-camel-case" = "6.2.0"
"just-kebab-case" = "4.2.0"
"just-split" = "3.2.0"
"@oclif/core" = "3.27.0"
"@statsig/statsig-node-core" = "0.19.1"
"@storybook/addon-actions" = "8.5.1"
Expand Down
5 changes: 3 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@types/cross-spawn": "^6.0.6",
"@types/jest": "^29.5.13",
"@types/jsdom": "^21.1.7",
"@types/lodash": "4.17.20",
"@types/node": "22.17.2",
"@types/prettier": "2.7.3",
"@types/prompts": "^2.4.9",
Expand Down Expand Up @@ -110,7 +109,9 @@
"find-up": "^5.0.0",
"glob": "^11.0.4",
"jsdom": "^24.1.1",
"lodash": "4.18.1",
"just-camel-case": "6.2.0",
"just-kebab-case": "4.2.0",
"just-split": "3.2.0",
"minimatch": "^9.0.3",
"ora": "^5.4.1",
"parse5": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/connect/create_template.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelCase } from 'lodash'
import camelCase from 'just-camel-case'
import fs from 'fs'
import {
type ComponentPropertyDefinition,
Expand Down
4 changes: 2 additions & 2 deletions cli/src/connect/validation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as url from 'url'
import { chunk } from 'lodash'
import split from 'just-split'

import { CodeConnectJSON } from '../connect/figma_connect'
import { logger } from '../common/logging'
Expand Down Expand Up @@ -298,7 +298,7 @@ export async function validateDocs(
const nodeMap = fileKeyToNodeIds[fileKey]
const nodeIds = Object.keys(nodeMap)
logger.debug(`Validating ${nodeIds.length} nodes`)
const chunks = chunk(nodeIds, 400)
const chunks = split(nodeIds, 400)

for (let batch = 0; batch < chunks.length; batch++) {
const nodeIdsChunk = chunks[batch]
Expand Down
2 changes: 1 addition & 1 deletion cli/src/html/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import path from 'path'
import fs from 'fs'
import { generateProps } from '../react/create'
import * as prettier from 'prettier'
import { kebabCase } from 'lodash'
import kebabCase from 'just-kebab-case'
import { getOutFileName } from '../connect/create_common'

export async function createHtmlCodeConnect(
Expand Down
2 changes: 1 addition & 1 deletion cli/src/react/create.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelCase } from 'lodash'
import camelCase from 'just-camel-case'
import * as prettier from 'prettier'
import fs from 'fs'
import z from 'zod'
Expand Down