Skip to content

Commit

Permalink
refactor(scripts/template/initialize): migrate to TypeScript (#35990)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #35990

Changelog: [Internal]

Differential Revision: D42781211

fbshipit-source-id: cd30389ca17f7d217df305bba23d92d06e3ec295
  • Loading branch information
hoxyq authored and facebook-github-bot committed Jan 30, 2023
1 parent c083c0a commit 2cb0f79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ jobs:
command: |
REPO_ROOT=$(pwd)
node ./scripts/set-rn-template-version.js "file:$REPO_ROOT/build/$(cat build/react-native-package-version)"
node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
npm run initialize-template -- --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
- run:
name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
command: |
Expand Down Expand Up @@ -885,7 +885,7 @@ jobs:
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
npm run initialize-template -- --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
- run:
name: Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.architecture >>; JS Engine << parameters.jsengine>>; Flipper << parameters.flipper >>
command: |
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"test-typescript-type-definitions-offline": "dtslint --localTs node_modules/typescript/lib types",
"bump-all-updated-packages": "ts-node ./scripts/monorepo/bump-all-updated-packages",
"align-package-versions": "ts-node ./scripts/monorepo/align-package-versions",
"initialize-template": "ts-node ./scripts/template/initialize",
"test-typescript": "tsc --noEmit",
"prepack": "tsc"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* @format
*/

'use strict';

const yargs = require('yargs');
const {execSync, spawnSync} = require('child_process');

const forEachPackage = require('../monorepo/for-each-package');
const setupVerdaccio = require('../setup-verdaccio');

import {PackageManifest} from '../../types/private/PackageManifest';

const {argv} = yargs
.option('r', {
alias: 'reactNativeRootPath',
Expand Down Expand Up @@ -51,7 +51,11 @@ function install() {

process.stdout.write('Starting to publish every package...\n');
forEachPackage(
(packageAbsolutePath, packageRelativePathFromRoot, packageManifest) => {
(
packageAbsolutePath: string,
packageRelativePathFromRoot: string,
packageManifest: PackageManifest,
) => {
if (packageManifest.private) {
return;
}
Expand Down

0 comments on commit 2cb0f79

Please sign in to comment.