Split generation scripts into @polkadot/typegen (#1875)
* Split generation scripts into @polkadot/typegen * Remove moved files * CC overrides * interfaces typo * Cleanup imports * Some import combinations * Updates * Generation updates * Cleanups, split js wrapper & ts logic * Rename jiggle 1 * Rename jiggle 2 * Style cleanups * Expose enry function for scripts * Typo * Update script copy & include locations * CC exclude location * Minor adjustments * argv parsing into main
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2017-2020 @polkadot/typegen authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../extractChain').default;
|
||||
} catch (error) {
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/api-derive(.*)': './packages/api-derive/src\\1',
|
||||
'^@polkadot/metadata(.*)': './packages/metadata/src\\1',
|
||||
'^@polkadot/api(.*)': './packages/api/src/\\1',
|
||||
'^@polkadot/jsonrpc(.*)': './packages/jsonrpc/src\\1',
|
||||
'^@polkadot/rpc-core(.*)': './packages/rpc-core/src\\1',
|
||||
'^@polkadot/rpc-provider(.*)': './packages/rpc-provider/src\\1',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
main = require('../src/extractChain.ts').default;
|
||||
}
|
||||
|
||||
main();
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2017-2020 @polkadot/typegen authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromChain').default;
|
||||
} catch (error) {
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/metadata(.*)': './packages/metadata/src\\1',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
main = require('../src/fromChain').default;
|
||||
}
|
||||
|
||||
main();
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2017-2020 @polkadot/typegen authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../fromDefs').default;
|
||||
} catch (error) {
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/metadata(.*)': './packages/metadata/src\\1',
|
||||
'^@polkadot/typegen(.*)': './packages/typegen/src\\1',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
main = require('../sr/fromDefs.ts').default;
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2017-2020 @polkadot/typegen authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../interfacesTs').default;
|
||||
} catch (error) {
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/jsonrpc(.*)': './packages/jsonrpc/src\\1',
|
||||
'^@polkadot/metadata(.*)': './packages/metadata/src\\1',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
main = require('../src/interfacesTs.ts').default;
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2017-2020 @polkadot/typegen authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
let main;
|
||||
|
||||
try {
|
||||
main = require('../metadataMd').default;
|
||||
} catch (error) {
|
||||
require('@babel/register')({
|
||||
extensions: ['.js', '.ts'],
|
||||
plugins: [
|
||||
['module-resolver', {
|
||||
alias: {
|
||||
'^@polkadot/jsonrpc(.*)': './packages/jsonrpc/src\\1',
|
||||
'^@polkadot/metadata(.*)': './packages/metadata/src\\1',
|
||||
'^@polkadot/types(.*)': './packages/types/src\\1'
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
main = require('../src/metadataMd.ts').default;
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user