Skip to content

Commit

Permalink
feat: rename packages and add lerna
Browse files Browse the repository at this point in the history
  • Loading branch information
rams23 committed Oct 15, 2023
1 parent fb86537 commit f1b378c
Show file tree
Hide file tree
Showing 9 changed files with 1,596 additions and 194 deletions.
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0",
"npmClient": "pnpm"
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "rnbuildhub",
"name": "@rn-buildhub/workspace",
"devDependencies": {
"husky": "^8.0.0",
"lint-staged": "^13.1.2"
},
"scripts": {
"prepare": "husky install",
"autoformat:staged": "pnpm dlx lint-staged"
"autoformat:staged": "pnpm dlx lint-staged",
"build": "lerna run build"
},
"dependencies": {
"lerna": "^7.3.1"
}
}
11 changes: 6 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@xtreamsrl/react-native-incremental-cli",
"name": "@rn-buildhub/cli",
"version": "0.2.0",
"description": "React Native CLI that caches native builds and speedup your development and release cycle",
"author": "Luca Micieli",
Expand Down Expand Up @@ -31,7 +31,7 @@
"@react-native-community/cli-platform-android": "10.2.0",
"@react-native-community/cli-platform-ios": "10.2.0",
"@react-native-community/cli-tools": "10.1.1",
"@rnbh/hub-interface": "workspace:^",
"@rn-buildhub/storage-interface": "workspace:^",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.0",
Expand All @@ -53,6 +53,7 @@
"@oclif/test": "^2.3.7",
"@react-native-community/cli": "^10.2.0",
"@react-native-community/cli-config": "^10.1.1",
"@rn-buildhub/azure-storage": "workspace:^",
"@types/chai": "^4",
"@types/mocha": "^9.0.0",
"@types/node": "^18.18.4",
Expand All @@ -75,10 +76,10 @@
"typescript": "^4.9.5"
},
"peerDependencies": {
"@rnbh/azure-blob-storage-hub": "workspace:^"
"@rn-buildhub/azure-storage": "workspace:^"
},
"peerDependenciesMeta": {
"@rnbh/azure-blob-storage-hub": {
"@rn-buildhub/azure-storage": {
"optional": true
}
},
Expand All @@ -99,7 +100,7 @@
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "pnpm run lint",
"typecheck": "tsc --noEmit",
"prepack": "pnpm run build && oclif manifest && oclif readme",
"prepack": "pnpm run build && oclif manifest",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif readme && git add README.md",
"run": "./bin/dev run -a",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/application/cloud/buildsManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { capitalize, getAdapter, getBuildFolderByBuildId, getRootDestinationFold
import logger from '../logger';
import { iosBuildPlatforms } from '../iosUtils';
import { ProjectConfiguration } from './projectsManagement';
import { Build, HubAdapter } from '@rnbh/hub-interface';
import { Build, HubAdapter } from '@rn-buildhub/storage-interface';

async function zipFolder(folderPath: string, outputZipPath: string) {
if (!fs.existsSync(folderPath)) {
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/application/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fs from 'fs';
import path from 'path';
import { execSync, ExecSyncOptions, ExecSyncOptionsWithBufferEncoding } from 'child_process';
import { ProjectConfiguration } from './cloud/projectsManagement';
import { Build, HubAdapter } from '@rn-buildhub/storage-interface';

const util = require('util');
const execAsync = util.promisify(require('child_process').exec);
Expand Down Expand Up @@ -64,7 +65,7 @@ export function capitalize(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}

export function getAdapter(config: ProjectConfiguration) {
export function getAdapter(config: ProjectConfiguration): HubAdapter {
if (!config.remoteAdapter.name) {
throw new Error('Remote adapter name is required');
}
Expand Down
4 changes: 2 additions & 2 deletions packages/hub-azure-blob-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@rnbh/azure-blob-storage-hub",
"name": "@rn-buildhub/azure-storage",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
Expand All @@ -14,7 +14,7 @@
"dependencies": {
"@azure/identity": "^3.3.1",
"@azure/storage-blob": "^12.16.0",
"@rnbh/hub-interface": "workspace:^",
"@rn-buildhub/storage-interface": "workspace:^",
"@types/node": "^18.18.4",
"dotenv": "^16.3.1",
"typescript": "^4.9.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/hub-azure-blob-storage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BlobServiceClient, BlockBlobClient, ContainerClient, StorageSharedKeyCredential } from "@azure/storage-blob";
import { DefaultAzureCredential } from "@azure/identity";

import { Build, HubAdapter, ProjectBuildInfo } from "@rnbh/hub-interface";
import { Build, HubAdapter, ProjectBuildInfo } from "@rn-buildhub/storage-interface";
import path from "path";
import process from "process";

Expand Down Expand Up @@ -113,7 +113,7 @@ class AzureHubAdapter extends HubAdapter {
version: 1,
id: buildId
};
await this.blob(`${buildpath}/info.json`).uploadData(Buffer.from(JSON.stringify(info), "utf-8"));
await this.blob(`${buildpath}/info.json`).uploadData(Buffer.from(JSON.stringify(infoToSave), "utf-8"));
}

async getBuildInfo(buildId: string): Promise<ProjectBuildInfo> {
Expand Down
2 changes: 1 addition & 1 deletion packages/hub-interface/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@rnbh/hub-interface",
"name": "@rn-buildhub/storage-interface",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
Expand Down
Loading

0 comments on commit f1b378c

Please sign in to comment.