[go: up one dir, main page]

Skip to content

Commit

Permalink
fix: reenable & deprecate YAML module extra assets
Browse files Browse the repository at this point in the history
closes google#870
  • Loading branch information
antongolub committed Aug 27, 2024
1 parent bec7b4c commit 3c582f6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@
{
"name": "zx/index",
"path": "build/*.{js,cjs}",
"limit": "781 kB",
"limit": "795 kB",
"brotli": false,
"gzip": false
},
{
"name": "dts libdefs",
"path": "build/*.d.ts",
"limit": "34 kB",
"limit": "35 kB",
"brotli": false,
"gzip": false
},
{
"name": "vendor",
"path": "build/vendor-*",
"limit": "745 kB",
"limit": "760 kB",
"brotli": false,
"gzip": false
},
{
"name": "all",
"path": "build/*",
"limit": "815 kB",
"limit": "830 kB",
"brotli": false,
"gzip": false
}
Expand Down
57 changes: 52 additions & 5 deletions src/vendor-extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
isDynamicPattern,
type Options as GlobbyOptions,
} from 'globby'
import { parse as yamlParse, stringify as yamlStringify } from 'yaml'
import * as _yaml from 'yaml'
import * as _fs from 'fs-extra'
import _createRequire from 'create-require'
import { AbortController } from 'node-fetch-native'
Expand Down Expand Up @@ -57,12 +57,59 @@ export const glob = Object.assign(function globby(
return globbyModule.globby(patterns, options)
}, globbyModule) as (typeof globbyModule)['globby'] & typeof globbyModule

export const YAML: {
export const YAML: YAML = _yaml

export interface YAML {
parse(text: string): any
stringify(object: any): string
} = {
parse: yamlParse,
stringify: yamlStringify,
/** @deprecated */
parseAllDocuments(s: string, opts?: any): any[]
/** @deprecated */
parseDocument(s: string, opts?: any): any
/** @deprecated */
isAlias(v: any): boolean
/** @deprecated */
isCollection(v: any): boolean
/** @deprecated */
isDocument(v: any): boolean
/** @deprecated */
isMap(v: any): boolean
/** @deprecated */
isNode(v: any): boolean
/** @deprecated */
isPair(v: any): boolean
/** @deprecated */
isScalar(v: any): boolean
/** @deprecated */
isSeq(v: any): boolean
/** @deprecated */
Alias: any
/** @deprecated */
Composer: any
/** @deprecated */
Document: any
/** @deprecated */
Schema: any
/** @deprecated */
YAMLSeq: any
/** @deprecated */
YAMLMap: any
/** @deprecated */
YAMLError: any
/** @deprecated */
YAMLParseError: any
/** @deprecated */
YAMLWarning: any
/** @deprecated */
Pair: any
/** @deprecated */
Scalar: any
/** @deprecated */
Lexer: any
/** @deprecated */
LineCounter: any
/** @deprecated */
Parser: any
}

export const fs: typeof import('fs-extra') = _fs
Expand Down

0 comments on commit 3c582f6

Please sign in to comment.