Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Oct 9, 2023
1 parent 0667e44 commit 47a36a7
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0667e44428be97bc3f5c7aac0def6bb0b9083ab8:.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs:agora-appid:433
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ nodeLinker: node-modules
nmHoistingLimits: workspaces

plugins:
- path: scripts/bootstrap.cjs
- path: scripts/pod-install.cjs
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
Expand Down
1 change: 1 addition & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');

const pak = require('../package.json');

module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const escape = require('escape-string-regexp');
const exclusionList = require('metro-config/src/defaults/exclusionList');

const pak = require('../package.json');

const root = path.resolve(__dirname, '..');
Expand Down
1 change: 1 addition & 0 deletions example/react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');

const pak = require('../package.json');

module.exports = {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
"example": "yarn workspace react-native-agora-example",
"test": "jest",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"lint": "eslint \"**/*.{cjs,js,ts,tsx}\"",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
"prepare": "bob build",
"release": "release-it",
"ts_interface_builder": "yarn ts-interface-builder src/*.ts -o src/ti/",
"doc": "typedoc src --out ./docs --exclude \"example/**\""
},
"keywords": [
Expand Down
52 changes: 52 additions & 0 deletions scripts/bootstrap.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const child_process = require('child_process');

module.exports = {
name: 'bootstrap',
factory() {
return {
hooks: {
afterAllInstalled(project, options) {
if (process.env.POD_INSTALL === '0') {
return;
}

if (
options &&
(options.mode === 'update-lockfile' ||
options.mode === 'skip-build')
) {
return;
}

if (
child_process.spawnSync('yarn', ['patch-package'], {
cwd: project.cwd,
env: process.env,
stdio: 'inherit',
encoding: 'utf-8',
shell: true,
}).status !== 0
) {
throw new Error('Failed to run patch-package');
}

if (
child_process.spawnSync(
'yarn',
['ts-interface-builder', 'src/*.ts', '-o', 'src/ti/'],
{
cwd: project.cwd,
env: process.env,
stdio: 'inherit',
encoding: 'utf-8',
shell: true,
}
).status !== 0
) {
throw new Error('Failed to run pod-install');
}
},
},
};
},
};
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"noStrictGenericChecks": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedParameters": false,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"verbatimModuleSyntax": true
"verbatimModuleSyntax": false
}
}

0 comments on commit 47a36a7

Please sign in to comment.