-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CU-86dt279a1- Fix WalletConnectSdk Examples Build
- Loading branch information
1 parent
d9368e3
commit 337b343
Showing
12 changed files
with
193 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as fs from 'fs' | ||
import { execSync } from 'child_process' | ||
import * as path from 'path' | ||
import { EXAMPLES_PATH } from '../constants/PathsDefinitions' | ||
|
||
const examplesPath = path.posix.normalize(EXAMPLES_PATH) | ||
|
||
function getAllExamples(): string[] { | ||
return fs.readdirSync(examplesPath) | ||
} | ||
export function runCommandInEachExampleProj(cmd: string) { | ||
let error = false | ||
const packages = getAllExamples() | ||
for (const lib of packages) { | ||
try { | ||
const pathLib = path.posix.join(examplesPath, lib) | ||
execSync(`${cmd}`, { cwd: pathLib, stdio: 'inherit' }) | ||
} catch { | ||
error = true | ||
} | ||
} | ||
if (error) { | ||
console.error('\nPlease, check the errors above before committing/pushing!\n') | ||
process.exitCode = 1 | ||
} | ||
} | ||
|
||
export function removeLibsCash() { | ||
let error = false | ||
const packages = getAllExamples() | ||
for (const lib of packages) { | ||
try { | ||
console.log(`Cleaning libs cash from ${lib}\n`) | ||
const pathLib = path.posix.join(examplesPath, lib) | ||
const nodeModules = path.posix.join(pathLib, 'node_modules') | ||
const packageManagerLock = path.posix.join(pathLib, 'pnpm-lock.yaml') | ||
if (fs.existsSync(nodeModules)) fs.rmSync(nodeModules, { recursive: true }) | ||
if (fs.existsSync(packageManagerLock)) fs.rmSync(packageManagerLock) | ||
} catch { | ||
error = true | ||
} | ||
} | ||
if (error) { | ||
console.error('\nPlease, check the errors above before committing/pushing!\n') | ||
process.exitCode = 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { runCommandInEachExampleProj } from '../helpers/CommandsHelper' | ||
|
||
runCommandInEachExampleProj('pnpm build') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { removeLibsCash } from '../helpers/CommandsHelper' | ||
|
||
removeLibsCash() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { runCommandInEachExampleProj } from '../helpers/CommandsHelper' | ||
|
||
runCommandInEachExampleProj('pnpm i') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { execSync } from 'child_process' | ||
import { RUN_CONCURRENTLY_COMMAND } from '../constants/DevConstants' | ||
|
||
execSync(RUN_CONCURRENTLY_COMMAND, { stdio: 'inherit' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"lib": ["ESNext"], | ||
"outDir": "./dist" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters