@codama/renderers-js 1.5.4 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +55 -19
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +55 -20
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.cjs +54 -18
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +55 -20
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.react-native.mjs +55 -20
- package/dist/index.react-native.mjs.map +1 -1
- package/dist/types/fragments/programInstructions.d.ts.map +1 -1
- package/dist/types/utils/formatCode.d.ts +4 -4
- package/dist/types/utils/formatCode.d.ts.map +1 -1
- package/dist/types/utils/nameTransformers.d.ts +1 -1
- package/dist/types/utils/nameTransformers.d.ts.map +1 -1
- package/dist/types/utils/packageJson.d.ts +3 -2
- package/dist/types/utils/packageJson.d.ts.map +1 -1
- package/dist/types/visitors/renderVisitor.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programInstructions.d.ts","sourceRoot":"","sources":["../../../src/fragments/programInstructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,WAAW,EAEd,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAsB,QAAQ,EAA4B,WAAW,EAAO,MAAM,UAAU,CAAC;AAGpG,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,0BAA0B,GAAG,qBAAqB,CAAC,GAAG;IACvF,WAAW,EAAE,WAAW,CAAC;CAC5B,GACF,QAAQ,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"programInstructions.d.ts","sourceRoot":"","sources":["../../../src/fragments/programInstructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,WAAW,EAEd,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAsB,QAAQ,EAA4B,WAAW,EAAO,MAAM,UAAU,CAAC;AAGpG,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,0BAA0B,GAAG,qBAAqB,CAAC,GAAG;IACvF,WAAW,EAAE,WAAW,CAAC;CAC5B,GACF,QAAQ,GAAG,SAAS,CAiBtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { format } from 'prettier';
|
|
3
|
-
import { Fragment } from './fragment';
|
|
1
|
+
import { Path } from '@codama/renderers-core';
|
|
2
|
+
import { format } from 'prettier/standalone';
|
|
4
3
|
import { RenderOptions } from './options';
|
|
5
4
|
export type PrettierOptions = Parameters<typeof format>[1];
|
|
6
|
-
export
|
|
5
|
+
export type CodeFormatter = (code: string, path: Path) => Promise<string>;
|
|
6
|
+
export declare function getCodeFormatter(options: Pick<RenderOptions, 'formatCode' | 'packageFolder' | 'prettierOptions'>): Promise<CodeFormatter>;
|
|
7
7
|
//# sourceMappingURL=formatCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/utils/formatCode.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/utils/formatCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAKxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAM3D,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAE1E,wBAAsB,gBAAgB,CAClC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,eAAe,GAAG,iBAAiB,CAAC,GACjF,OAAO,CAAC,aAAa,CAAC,CAWxB"}
|
|
@@ -7,7 +7,7 @@ export type NameTransformerHelpers = {
|
|
|
7
7
|
titleCase: (name: string) => string;
|
|
8
8
|
};
|
|
9
9
|
export type NameTransformer = (name: string, helpers: NameTransformerHelpers) => string;
|
|
10
|
-
export type NameTransformerKey = 'accountDecodeFunction' | 'accountFetchAllFunction' | 'accountFetchAllMaybeFunction' | 'accountFetchFromSeedsFunction' | 'accountFetchFunction' | 'accountFetchMaybeFromSeedsFunction' | 'accountFetchMaybeFunction' | 'accountGetSizeFunction' | 'codecFunction' | 'constant' | 'constantFunction' | 'dataArgsType' | 'dataType' | 'decoderFunction' | 'discriminatedUnionDiscriminator' | 'discriminatedUnionFunction' | 'discriminatedUnionVariant' | 'encoderFunction' | 'enumVariant' | 'instructionAsyncFunction' | 'instructionAsyncInputType' | 'instructionDataType' | 'instructionExtraType' | 'instructionParsedType' | 'instructionParseFunction' | 'instructionSyncFunction' | 'instructionSyncInputType' | 'instructionType' | 'isDiscriminatedUnionFunction' | 'pdaFindFunction' | 'pdaSeedsType' | 'programAccountsEnum' | 'programAccountsEnumVariant' | 'programAccountsIdentifierFunction' | 'programAddressConstant' | 'programErrorConstant' | 'programErrorConstantPrefix' | 'programErrorMessagesMap' | 'programErrorUnion' | 'programGetErrorMessageFunction' | 'programInstructionsEnum' | 'programInstructionsEnumVariant' | 'programInstructionsIdentifierFunction' | 'programInstructionsParsedUnionType' | 'programIsErrorFunction' | 'resolverFunction';
|
|
10
|
+
export type NameTransformerKey = 'accountDecodeFunction' | 'accountFetchAllFunction' | 'accountFetchAllMaybeFunction' | 'accountFetchFromSeedsFunction' | 'accountFetchFunction' | 'accountFetchMaybeFromSeedsFunction' | 'accountFetchMaybeFunction' | 'accountGetSizeFunction' | 'codecFunction' | 'constant' | 'constantFunction' | 'dataArgsType' | 'dataType' | 'decoderFunction' | 'discriminatedUnionDiscriminator' | 'discriminatedUnionFunction' | 'discriminatedUnionVariant' | 'encoderFunction' | 'enumVariant' | 'instructionAsyncFunction' | 'instructionAsyncInputType' | 'instructionDataType' | 'instructionExtraType' | 'instructionParsedType' | 'instructionParseFunction' | 'instructionSyncFunction' | 'instructionSyncInputType' | 'instructionType' | 'isDiscriminatedUnionFunction' | 'pdaFindFunction' | 'pdaSeedsType' | 'programAccountsEnum' | 'programAccountsEnumVariant' | 'programAccountsIdentifierFunction' | 'programAddressConstant' | 'programErrorConstant' | 'programErrorConstantPrefix' | 'programErrorMessagesMap' | 'programErrorUnion' | 'programGetErrorMessageFunction' | 'programInstructionsEnum' | 'programInstructionsEnumVariant' | 'programInstructionsIdentifierFunction' | 'programInstructionsParsedUnionType' | 'programInstructionsParseFunction' | 'programIsErrorFunction' | 'resolverFunction';
|
|
11
11
|
export type NameTransformers = Record<NameTransformerKey, NameTransformer>;
|
|
12
12
|
export type NameApi = Record<NameTransformerKey, (name: string) => string>;
|
|
13
13
|
export declare function getNameApi(transformers: NameTransformers): NameApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nameTransformers.d.ts","sourceRoot":"","sources":["../../../src/utils/nameTransformers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACjC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,KAAK,MAAM,CAAC;AAExF,MAAM,MAAM,kBAAkB,GACxB,uBAAuB,GACvB,yBAAyB,GACzB,8BAA8B,GAC9B,+BAA+B,GAC/B,sBAAsB,GACtB,oCAAoC,GACpC,2BAA2B,GAC3B,wBAAwB,GACxB,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,iCAAiC,GACjC,4BAA4B,GAC5B,2BAA2B,GAC3B,iBAAiB,GACjB,aAAa,GACb,0BAA0B,GAC1B,2BAA2B,GAC3B,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,0BAA0B,GAC1B,yBAAyB,GACzB,0BAA0B,GAC1B,iBAAiB,GACjB,8BAA8B,GAC9B,iBAAiB,GACjB,cAAc,GACd,qBAAqB,GACrB,4BAA4B,GAC5B,mCAAmC,GACnC,wBAAwB,GACxB,sBAAsB,GACtB,4BAA4B,GAC5B,yBAAyB,GACzB,mBAAmB,GACnB,gCAAgC,GAChC,yBAAyB,GACzB,gCAAgC,GAChC,uCAAuC,GACvC,oCAAoC,GACpC,wBAAwB,GACxB,kBAAkB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;AAE3E,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAE3E,wBAAgB,UAAU,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAYlE;AAED,eAAO,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"nameTransformers.d.ts","sourceRoot":"","sources":["../../../src/utils/nameTransformers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACjC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,UAAU,EAAE,CAAC,I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IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AAE3E,wBAAgB,UAAU,CAAC,YAAY,EAAE,gBAAgB,GAAG,OAAO,CAYlE;AAED,eAAO,MAAM,yBAAyB,EAAE,gBAgDvC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RenderMap } from '@codama/renderers-core';
|
|
2
|
-
import {
|
|
2
|
+
import type { CodeFormatter } from './formatCode';
|
|
3
3
|
import { Fragment } from './fragment';
|
|
4
|
+
import { RenderOptions } from './options';
|
|
4
5
|
type DependencyVersions = Record<string, string>;
|
|
5
6
|
type PackageJson = {
|
|
6
7
|
author?: string;
|
|
@@ -15,7 +16,7 @@ type PackageJson = {
|
|
|
15
16
|
version?: string;
|
|
16
17
|
};
|
|
17
18
|
export declare const DEFAULT_DEPENDENCY_VERSIONS: DependencyVersions;
|
|
18
|
-
export declare function syncPackageJson(renderMap: RenderMap<Fragment>, options: Pick<RenderOptions, 'dependencyMap' | 'dependencyVersions' | 'packageFolder' | 'syncPackageJson' | 'useGranularImports'>): void
|
|
19
|
+
export declare function syncPackageJson(renderMap: RenderMap<Fragment>, formatCode: CodeFormatter, options: Pick<RenderOptions, 'dependencyMap' | 'dependencyVersions' | 'packageFolder' | 'syncPackageJson' | 'useGranularImports'>): Promise<void>;
|
|
19
20
|
export declare function createNewPackageJson(dependencyVersions: DependencyVersions): PackageJson;
|
|
20
21
|
export declare function updateExistingPackageJson(packageJson: PackageJson, dependencyVersions: DependencyVersions): PackageJson;
|
|
21
22
|
export declare function checkExistingPackageJson(packageJson: PackageJson, dependencyVersions: DependencyVersions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../src/utils/packageJson.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,SAAS,EAAa,MAAM,wBAAwB,CAAC;AAG9F,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"packageJson.d.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AwB,CAAC,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CA0B/G;AAED,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC9B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1C,kBAAkB,EAAE,OAAO,GAC5B,kBAAkB,CA8BpB;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,WA8BhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderVisitor.d.ts","sourceRoot":"","sources":["../../../src/visitors/renderVisitor.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"renderVisitor.d.ts","sourceRoot":"","sources":["../../../src/visitors/renderVisitor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,aAAa,EAAmB,MAAM,UAAU,CAAC;AAG5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,sEAoBtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codama/renderers-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "JavaScript renderer compatible with the Solana Kit library",
|
|
5
5
|
"exports": {
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@codama/errors": "^1.4.4",
|
|
41
41
|
"@codama/nodes": "^1.4.4",
|
|
42
|
-
"@codama/renderers-core": "^1.3.
|
|
42
|
+
"@codama/renderers-core": "^1.3.4",
|
|
43
43
|
"@codama/visitors-core": "^1.4.4",
|
|
44
44
|
"@solana/codecs-strings": "^5.0.0",
|
|
45
45
|
"prettier": "^3.6.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@codama/nodes-from-anchor": "^1.3.6",
|
|
52
52
|
"@solana/eslint-config-solana": "^5.0.0",
|
|
53
53
|
"@solana/prettier-config-solana": "0.0.5",
|
|
54
|
-
"@types/node": "^
|
|
54
|
+
"@types/node": "^25",
|
|
55
55
|
"@types/semver": "^7.7.1",
|
|
56
56
|
"agadoo": "^3.0.0",
|
|
57
57
|
"eslint": "^9.35.0",
|