@@ -1,19 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
const alias = {
|
||||
'^@polkadot/api-(augment|base|derive)(.*)': './packages/api-\\1/src\\2',
|
||||
'^@polkadot/api(.*)': './packages/api/src/\\1',
|
||||
'^@polkadot/rpc-(augment|core|provider)(.*)': './packages/rpc-\\1/src\\2',
|
||||
'^@polkadot/types-(augment-lookup|augment-registry|augment|codec|create|known|metadata|support)(.*)': './packages/types-\\1/src\\2',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
};
|
||||
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', { alias }]
|
||||
]
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = function (file) {
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require(`../${file}.cjs`).main;
|
||||
} catch (error) {
|
||||
// required for dev-only setups
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
// register aliases
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/api-(augment|base|derive)(.*)': './packages/api-\\1/src\\2',
|
||||
// eslint-disable-next-line sort-keys
|
||||
'^@polkadot/api(.*)': './packages/api/src/\\1',
|
||||
'^@polkadot/rpc-(augment|core|provider)(.*)': './packages/rpc-\\1/src\\2',
|
||||
'^@polkadot/types-(augment-lookup|augment-registry|augment|codec|create|known|metadata|support)(.*)': './packages/types-\\1/src\\2',
|
||||
// eslint-disable-next-line sort-keys
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
// get ts source
|
||||
main = require(`../src/${file}.ts`).main;
|
||||
}
|
||||
|
||||
main();
|
||||
};
|
||||
@@ -2,16 +2,4 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../extractChain.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('./aliases.cjs');
|
||||
|
||||
main = require('../src/extractChain.ts').main;
|
||||
}
|
||||
|
||||
main();
|
||||
require('./execWithSrc.cjs')('extractChain');
|
||||
|
||||
@@ -2,16 +2,4 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromChain.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('./aliases.cjs');
|
||||
|
||||
main = require('../src/fromChain').main;
|
||||
}
|
||||
|
||||
main();
|
||||
require('./execWithSrc.cjs')('fromChain');
|
||||
|
||||
@@ -2,16 +2,4 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromDefs.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('./aliases.cjs');
|
||||
|
||||
main = require('../src/fromDefs.ts').main;
|
||||
}
|
||||
|
||||
main();
|
||||
require('./execWithSrc.cjs')('fromDefs');
|
||||
|
||||
@@ -2,16 +2,4 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../interfacesTs.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('./aliases.cjs');
|
||||
|
||||
main = require('../src/interfacesTs.ts').main;
|
||||
}
|
||||
|
||||
main();
|
||||
require('./execWithSrc.cjs')('interfacesTs');
|
||||
|
||||
@@ -2,16 +2,4 @@
|
||||
// Copyright 2017-2021 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../metadataMd.cjs').main;
|
||||
} catch (error) {
|
||||
process.env.JEST_WORKER_ID = '123';
|
||||
|
||||
require('./aliases.cjs');
|
||||
|
||||
main = require('../src/metadataMd.ts').main;
|
||||
}
|
||||
|
||||
main();
|
||||
require('./execWithSrc.cjs')('metadataMd');
|
||||
|
||||
Reference in New Issue
Block a user