Updates for typesBundle (#8996)
* Updates for typesBundle * comment chunk rationale
This commit is contained in:
parent
a24445d8de
commit
acad8d7dad
@ -1,8 +1,6 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Since this libary includes augmented definitions, we inmport it via
|
||||
// a CJS bridge ... which hopefully just short-circuits all of that
|
||||
import { typesBundleForPolkadotApps } from '../../cjs/mangata.js';
|
||||
import { typesBundleForPolkadotApps } from '@mangata-finance/types';
|
||||
|
||||
export default typesBundleForPolkadotApps;
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const { typesBundleForPolkadotApps } = require('../mangata.js');
|
||||
|
||||
module.exports = { typesBundleForPolkadotApps };
|
||||
6
packages/apps-config/src/cjs/mangata.d.ts
vendored
6
packages/apps-config/src/cjs/mangata.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { OverrideBundleDefinition } from '@polkadot/types/types';
|
||||
|
||||
declare const typesBundleForPolkadotApps: OverrideBundleDefinition;
|
||||
@ -1,6 +0,0 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const { typesBundleForPolkadotApps } = require('@mangata-finance/types');
|
||||
|
||||
module.exports = { typesBundleForPolkadotApps };
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"module": "commonjs"
|
||||
}
|
||||
@ -1,10 +1,9 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TFunction } from '../types';
|
||||
import type { TFunction, TOptions } from '../types';
|
||||
import type { LinkOption } from './types';
|
||||
|
||||
import { defaultT } from '../util';
|
||||
import { createCustom, createDev, createOwn } from './development';
|
||||
import { prodChains, prodRelayKusama, prodRelayPolkadot } from './production';
|
||||
import { testChains, testRelayRococo, testRelayWestend } from './testing';
|
||||
@ -14,6 +13,18 @@ export { CUSTOM_ENDPOINT_KEY } from './development';
|
||||
export * from './production';
|
||||
export * from './testing';
|
||||
|
||||
function defaultT (keyOrText: string, text?: string, options?: TOptions): string {
|
||||
return (
|
||||
(
|
||||
options &&
|
||||
options.replace &&
|
||||
options.replace.host
|
||||
) ||
|
||||
text ||
|
||||
keyOrText
|
||||
);
|
||||
}
|
||||
|
||||
export function createWsEndpoints (t: TFunction = defaultT, firstOnly = false, withSort = true): LinkOption[] {
|
||||
return [
|
||||
...createCustom(t),
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TOptions } from './types';
|
||||
|
||||
import { u8aToString } from '@polkadot/util';
|
||||
import { base64Decode, unzlibSync } from '@polkadot/wasm-util';
|
||||
|
||||
const HDR = ';base64,';
|
||||
|
||||
export function defaultT (keyOrText: string, text?: string, options?: TOptions): string {
|
||||
return (
|
||||
(
|
||||
options &&
|
||||
options.replace &&
|
||||
options.replace.host
|
||||
) ||
|
||||
text ||
|
||||
keyOrText
|
||||
);
|
||||
}
|
||||
|
||||
export function unz (base64: string, lenIn: number, lenOut: number): string {
|
||||
return u8aToString(
|
||||
unzlibSync(
|
||||
base64Decode(
|
||||
base64.substring(HDR.length),
|
||||
new Uint8Array(lenIn)
|
||||
),
|
||||
new Uint8Array(lenOut)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -78,11 +78,19 @@ function createWebpack (context, mode = 'production') {
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
cacheGroups: [
|
||||
// this one is massive (less-frequently updated, alongside deps)
|
||||
['type', /[\\/]packages[\\/]apps-config[\\/]src[\\/]api[\\/]typesBundle/],
|
||||
// should just change when totally new teams are onboarded
|
||||
['logo', /[\\/]packages[\\/]apps-config[\\/]src[\\/]ui[\\/]logos/],
|
||||
// config cannot go in main - it has multiple users
|
||||
['conf', /[\\/]packages[\\/]apps-config[\\/]src[\\/]/],
|
||||
// exceptionally large - should not change at all
|
||||
['robo', /[\\/]packages[\\/]react-components[\\/]src[\\/]IdentityIcon[\\/]RoboHash/],
|
||||
// library split (although it probably changes alongside pages)
|
||||
['comm', /[\\/]packages[\\/]react-.*[\\/]src[\\/]/],
|
||||
// pages are seperated out (non-perfect, but indv. too small)
|
||||
['page', /[\\/]packages[\\/]page-.*[\\/]src[\\/]/],
|
||||
// all other modules
|
||||
['modu', /[\\/]node_modules[\\/]/]
|
||||
].reduce((result, [name, test], index) => ({
|
||||
...result,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user