Skip to content

Commit

Permalink
Merge pull request #229 from oneblink/ON-34238
Browse files Browse the repository at this point in the history
ON-34238 # Removed @blinkmobile/blinkmrc dependency
  • Loading branch information
Zaxist authored Aug 23, 2023
2 parents 9fb34ae + 8a1b8d1 commit 333d149
Show file tree
Hide file tree
Showing 18 changed files with 161 additions and 283 deletions.
228 changes: 11 additions & 217 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.379.1",
"@aws-sdk/lib-storage": "^3.379.1",
"@blinkmobile/blinkmrc": "^2.0.0",
"@hapi/boom": "^10.0.1",
"appdirectory": "^0.1.0",
"archiver": "^5.3.1",
"base64url": "^3.0.1",
"chalk": "^5.3.0",
Expand All @@ -29,6 +29,7 @@
"glob": "^10.3.1",
"inquirer": "^9.2.7",
"jsonwebtoken": "^9.0.1",
"load-json-file": "^7.0.1",
"log-symbols": "^5.1.0",
"meow": "^12.0.1",
"mime-types": "^2.1.35",
Expand Down
5 changes: 0 additions & 5 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ export type LambdaEvent =

export type MapObject = Record<string, any>

export type ProjectConfig = {
load: () => Promise<BlinkMRC>
update: (fn: (config: BlinkMRC) => BlinkMRC) => Promise<BlinkMRC>
}

export type Protocol = OneBlinkAPIHostingRequest['url']['protocol']

export type RouteConfiguration = APITypes.APIEnvironmentRoute & {
Expand Down
22 changes: 11 additions & 11 deletions src/api/utils/project-meta.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { BlinkMRC, ProjectConfig } from '../types.js'
import type { BlinkMRC } from '../types.js'

import configLoader from '@blinkmobile/blinkmrc'
import pkg from '../../package.js'
import * as configLoader from '../../blinkmrc.js'

function projectConfig(cwd: string): ProjectConfig {
return configLoader.projectConfig({
name: pkg.name,
cwd: cwd,
function projectConfig(cwd: string) {
return configLoader.projectConfig<BlinkMRC>({
cwd,
})
}

function read(cwd: string): Promise<BlinkMRC> {
return projectConfig(cwd)
.load()
.catch(() => ({}))
async function read(cwd: string): Promise<BlinkMRC> {
try {
return await projectConfig(cwd).load()
} catch {
return {}
}
}

async function write(
Expand Down
Loading

0 comments on commit 333d149

Please sign in to comment.