Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(yarn-plugin-renderer): dependencies, command adjustment #389

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
586 changes: 293 additions & 293 deletions .yarn/releases/yarn.cjs

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1262,16 +1262,16 @@ __metadata:
dependencies:
"@atls/yarn-run-utils": "workspace:*"
"@atls/yarn-test-utils": "workspace:*"
"@jest/globals": "npm:^29.6.1"
"@types/cross-spawn": "npm:^6.0.2"
"@types/localtunnel": "npm:^2.0.1"
"@yarnpkg/builder": "npm:^4.1.1"
"@yarnpkg/cli": "npm:^4.2.2"
"@yarnpkg/core": "npm:^4.0.5"
"@yarnpkg/fslib": "npm:^3.1.0"
clipanion: "npm:^4.0.0-rc.3"
cross-spawn: "npm:^7.0.3"
localtunnel: "npm:^2.0.2"
"@jest/globals": "npm:29.7.0"
"@types/cross-spawn": "npm:6.0.6"
"@types/localtunnel": "npm:2.0.4"
"@yarnpkg/builder": "npm:4.1.2"
"@yarnpkg/cli": "npm:4.4.0"
"@yarnpkg/core": "npm:4.1.2"
"@yarnpkg/fslib": "npm:3.1.0"
clipanion: "npm:4.0.0-rc.3"
cross-spawn: "npm:7.0.3"
localtunnel: "npm:2.0.2"
peerDependencies:
"@yarnpkg/cli": ^4
"@yarnpkg/core": ^4
Expand Down Expand Up @@ -4212,7 +4212,7 @@ __metadata:
languageName: node
linkType: hard

"@types/cross-spawn@npm:^6.0.2":
"@types/cross-spawn@npm:6.0.6":
version: 6.0.6
resolution: "@types/cross-spawn@npm:6.0.6"
dependencies:
Expand Down Expand Up @@ -4355,7 +4355,7 @@ __metadata:
languageName: node
linkType: hard

"@types/localtunnel@npm:^2.0.1":
"@types/localtunnel@npm:2.0.4":
version: 2.0.4
resolution: "@types/localtunnel@npm:2.0.4"
dependencies:
Expand Down Expand Up @@ -11003,7 +11003,7 @@ __metadata:
languageName: node
linkType: hard

"localtunnel@npm:^2.0.2":
"localtunnel@npm:2.0.2":
version: 2.0.2
resolution: "localtunnel@npm:2.0.2"
dependencies:
Expand Down
20 changes: 10 additions & 10 deletions yarn/plugin-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
"postpack": "rm -rf dist"
},
"dependencies": {
"clipanion": "^4.0.0-rc.3",
"cross-spawn": "^7.0.3",
"localtunnel": "^2.0.2"
"clipanion": "4.0.0-rc.3",
"cross-spawn": "7.0.3",
"localtunnel": "2.0.2"
},
"devDependencies": {
"@atls/yarn-run-utils": "workspace:*",
"@atls/yarn-test-utils": "workspace:*",
"@jest/globals": "^29.6.1",
"@types/cross-spawn": "^6.0.2",
"@types/localtunnel": "^2.0.1",
"@yarnpkg/builder": "^4.1.1",
"@yarnpkg/cli": "^4.2.2",
"@yarnpkg/core": "^4.0.5",
"@yarnpkg/fslib": "^3.1.0"
"@jest/globals": "29.7.0",
"@types/cross-spawn": "6.0.6",
"@types/localtunnel": "2.0.4",
"@yarnpkg/builder": "4.1.2",
"@yarnpkg/cli": "4.4.0",
"@yarnpkg/core": "4.1.2",
"@yarnpkg/fslib": "3.1.0"
},
"peerDependencies": {
"@yarnpkg/cli": "^4",
Expand Down
22 changes: 20 additions & 2 deletions yarn/plugin-renderer/src/commands/renderer-dev.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export class RendererDevCommand extends BaseCommand {

tunnel = Option.Boolean('--tunnel')

#tunnel: Tunnel
https = Option.Boolean('--https')

#tunnel!: Tunnel

async runTunnel(host: string, port: number): Promise<void> {
if (this.#tunnel) {
Expand All @@ -39,7 +41,23 @@ export class RendererDevCommand extends BaseCommand {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins)
const { project } = await Project.find(configuration, this.context.cwd)

spawn('yarn', ['next', 'dev', 'src'], { stdio: 'inherit', cwd: this.context.cwd })
const args = ['next', 'dev', 'src']

if (this.https) {
if (!(await xfs.existsPromise(ppath.join(project.cwd, '.config/certs/local/dev.key')))) {
throw new Error('Https key not found')
}

if (!(await xfs.existsPromise(ppath.join(project.cwd, '.config/certs/local/dev.crt')))) {
throw new Error('Https cert not found')
}

args.push('--experimental-https')
args.push('--experimental-https-key', ppath.join(project.cwd, '.config/certs/local/dev.key'))
args.push('--experimental-https-cert', ppath.join(project.cwd, '.config/certs/local/dev.crt'))
}

spawn('yarn', args, { stdio: 'inherit', cwd: this.context.cwd })

if (this.tunnel) {
const workspace = project.getWorkspaceByCwd(this.context.cwd)
Expand Down
Loading