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

sync(yarn-plugin-image): dependencies, command adjustment #384

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
427 changes: 175 additions & 252 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file removed .yarn/cache/del-npm-6.1.1-9285f60bfd-563288b73b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
81 changes: 7 additions & 74 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1171,15 +1171,14 @@ __metadata:
"@atls/code-pack": "workspace:*"
"@atls/yarn-pack-utils": "workspace:*"
"@atls/yarn-run-utils": "workspace:*"
"@iarna/toml": "npm:^2.2.5"
"@yarnpkg/builder": "npm:4.1.1"
"@yarnpkg/cli": "npm:4.2.2"
"@yarnpkg/core": "npm:4.0.5"
"@iarna/toml": "npm:2.2.5"
"@yarnpkg/builder": "npm:4.1.2"
"@yarnpkg/cli": "npm:4.4.0"
"@yarnpkg/core": "npm:4.1.2"
"@yarnpkg/fslib": "npm:3.1.0"
"@yarnpkg/plugin-patch": "npm:4.0.1"
clipanion: "npm:4.0.0-rc.3"
tempy: "npm:1.0.1"
typescript: "npm:5.2.2"
typescript: "npm:5.4.2"
peerDependencies:
"@yarnpkg/cli": "*"
"@yarnpkg/core": "*"
Expand Down Expand Up @@ -2980,7 +2979,7 @@ __metadata:
languageName: node
linkType: hard

"@iarna/toml@npm:2.2.5, @iarna/toml@npm:^2.2.5":
"@iarna/toml@npm:2.2.5":
version: 2.2.5
resolution: "@iarna/toml@npm:2.2.5"
checksum: 10/b61426dc1a3297bbcb24cb8e9c638663866b4bb6f28f2c377b167e4b1f8956d8d208c484b73bb59f4232249903545cc073364c43576d2d5ad66afbd730ad24a9
Expand Down Expand Up @@ -6914,13 +6913,6 @@ __metadata:
languageName: node
linkType: hard

"crypto-random-string@npm:^2.0.0":
version: 2.0.0
resolution: "crypto-random-string@npm:2.0.0"
checksum: 10/0283879f55e7c16fdceacc181f87a0a65c53bc16ffe1d58b9d19a6277adcd71900d02bb2c4843dd55e78c51e30e89b0fec618a7f170ebcc95b33182c28f05fd6
languageName: node
linkType: hard

"css-select@npm:^5.1.0":
version: 5.1.0
resolution: "css-select@npm:5.1.0"
Expand Down Expand Up @@ -7213,22 +7205,6 @@ __metadata:
languageName: node
linkType: hard

"del@npm:^6.0.0":
version: 6.1.1
resolution: "del@npm:6.1.1"
dependencies:
globby: "npm:^11.0.1"
graceful-fs: "npm:^4.2.4"
is-glob: "npm:^4.0.1"
is-path-cwd: "npm:^2.2.0"
is-path-inside: "npm:^3.0.2"
p-map: "npm:^4.0.0"
rimraf: "npm:^3.0.2"
slash: "npm:^3.0.0"
checksum: 10/563288b73b8b19a7261c47fd21a330eeab6e2acd7c6208c49790dfd369127120dd7836cdf0c1eca216b77c94782a81507eac6b4734252d3bef2795cb366996b6
languageName: node
linkType: hard

"depd@npm:2.0.0":
version: 2.0.0
resolution: "depd@npm:2.0.0"
Expand Down Expand Up @@ -10039,14 +10015,7 @@ __metadata:
languageName: node
linkType: hard

"is-path-cwd@npm:^2.2.0":
version: 2.2.0
resolution: "is-path-cwd@npm:2.2.0"
checksum: 10/46a840921bb8cc0dc7b5b423a14220e7db338072a4495743a8230533ce78812dc152548c86f4b828411fe98c5451959f07cf841c6a19f611e46600bd699e8048
languageName: node
linkType: hard

"is-path-inside@npm:^3.0.2, is-path-inside@npm:^3.0.3":
"is-path-inside@npm:^3.0.3":
version: 3.0.3
resolution: "is-path-inside@npm:3.0.3"
checksum: 10/abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9
Expand Down Expand Up @@ -13811,26 +13780,6 @@ pem@dexus/pem:
languageName: node
linkType: hard

"temp-dir@npm:^2.0.0":
version: 2.0.0
resolution: "temp-dir@npm:2.0.0"
checksum: 10/cc4f0404bf8d6ae1a166e0e64f3f409b423f4d1274d8c02814a59a5529f07db6cd070a749664141b992b2c1af337fa9bb451a460a43bb9bcddc49f235d3115aa
languageName: node
linkType: hard

"tempy@npm:1.0.1":
version: 1.0.1
resolution: "tempy@npm:1.0.1"
dependencies:
del: "npm:^6.0.0"
is-stream: "npm:^2.0.0"
temp-dir: "npm:^2.0.0"
type-fest: "npm:^0.16.0"
unique-string: "npm:^2.0.0"
checksum: 10/e3a3857cd102db84c484b8e878203b496f0e927025b7c60dd118c0c9a0962f4589321c6b3093185d529576af5c58be65d755e72c2a6ad009ff340ab8cbbe4d33
languageName: node
linkType: hard

"terser-webpack-plugin@npm:^5.3.10":
version: 5.3.10
resolution: "terser-webpack-plugin@npm:5.3.10"
Expand Down Expand Up @@ -14080,13 +14029,6 @@ pem@dexus/pem:
languageName: node
linkType: hard

"type-fest@npm:^0.16.0":
version: 0.16.0
resolution: "type-fest@npm:0.16.0"
checksum: 10/fd8c47ccb90e9fe7bae8bfc0e116e200e096120200c1ab1737bf0bc9334b344dd4925f876ed698174ffd58cd179bb56a55467be96aedc22d5d72748eac428bc8
languageName: node
linkType: hard

"type-fest@npm:^0.20.2":
version: 0.20.2
resolution: "type-fest@npm:0.20.2"
Expand Down Expand Up @@ -14301,15 +14243,6 @@ pem@dexus/pem:
languageName: node
linkType: hard

"unique-string@npm:^2.0.0":
version: 2.0.0
resolution: "unique-string@npm:2.0.0"
dependencies:
crypto-random-string: "npm:^2.0.0"
checksum: 10/107cae65b0b618296c2c663b8e52e4d1df129e9af04ab38d53b4f2189e96da93f599c85f4589b7ffaf1a11c9327cbb8a34f04c71b8d4950d3e385c2da2a93828
languageName: node
linkType: hard

"universal-user-agent@npm:^6.0.0":
version: 6.0.1
resolution: "universal-user-agent@npm:6.0.1"
Expand Down
97 changes: 0 additions & 97 deletions yarn/plugin-image/bundles/@yarnpkg/plugin-image.js

This file was deleted.

23 changes: 15 additions & 8 deletions yarn/plugin-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
"@atls/code-pack": "workspace:*",
"@atls/yarn-pack-utils": "workspace:*",
"@atls/yarn-run-utils": "workspace:*",
"@iarna/toml": "^2.2.5",
"@iarna/toml": "2.2.5",
"@yarnpkg/plugin-patch": "4.0.1",
"clipanion": "4.0.0-rc.3",
"tempy": "1.0.1"
"clipanion": "4.0.0-rc.3"
},
"devDependencies": {
"@yarnpkg/builder": "4.1.1",
"@yarnpkg/cli": "4.2.2",
"@yarnpkg/core": "4.0.5",
"@yarnpkg/builder": "4.1.2",
"@yarnpkg/cli": "4.4.0",
"@yarnpkg/core": "4.1.2",
"@yarnpkg/fslib": "3.1.0",
"typescript": "5.2.2"
"typescript": "5.4.2"
},
"peerDependencies": {
"@yarnpkg/cli": "*",
Expand All @@ -39,7 +38,15 @@
},
"publishConfig": {
"access": "public",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"main": "dist/index.js",
"typings": "dist/index.d.ts"
"types": "dist/index.d.ts"
}
}
62 changes: 37 additions & 25 deletions yarn/plugin-image/sources/image-pack.command.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import { readFileSync } from 'node:fs'

import { BaseCommand } from '@yarnpkg/cli'
import { Workspace } from '@yarnpkg/core'
import { Configuration } from '@yarnpkg/core'
import { Project } from '@yarnpkg/core'
import { StreamReport } from '@yarnpkg/core'
import { PortablePath } from '@yarnpkg/fslib'
import { stringify } from '@iarna/toml'
import { execUtils } from '@yarnpkg/core'
import { xfs } from '@yarnpkg/fslib'
import { ppath } from '@yarnpkg/fslib'
import { Option } from 'clipanion'
import { join } from 'path'

import { TagPolicy } from '@atls/code-pack'
import { tagUtils } from '@atls/code-pack'
import { packUtils } from '@atls/yarn-pack-utils'

const forRepository = async (repo: string) => {
import type { TagPolicy } from '@atls/code-pack'
import type { Workspace } from '@yarnpkg/core'
import type { PortablePath } from '@yarnpkg/fslib'

import { readFileSync } from 'node:fs'

import { BaseCommand } from '@yarnpkg/cli'
import { Configuration } from '@yarnpkg/core'
import { Project } from '@yarnpkg/core'
import { StreamReport } from '@yarnpkg/core'
import { stringify } from '@iarna/toml'
import { structUtils } from '@yarnpkg/core'
import { execUtils } from '@yarnpkg/core'
import { xfs } from '@yarnpkg/fslib'
import { ppath } from '@yarnpkg/fslib'
import { Option } from 'clipanion'
import { join } from 'path'

import { tagUtils } from '@atls/code-pack'
import { packUtils } from '@atls/yarn-pack-utils'

const forRepository = async (repo: string): Promise<PortablePath> => {
const descriptor = {
project: {
id: repo,
Expand Down Expand Up @@ -45,12 +47,12 @@ class ImagePackCommand extends BaseCommand {

publish: boolean = Option.Boolean('-p,--publish', false)

async execute() {
async execute(): Promise<number> {
const configuration = await Configuration.find(this.context.cwd, this.context.plugins)

const { project } = await Project.find(configuration, this.context.cwd)

const workspace = project.getWorkspaceByFilePath(this.context.cwd)
const workspace: Workspace = project.getWorkspaceByFilePath(this.context.cwd)

const commandReport = await StreamReport.start(
{
Expand All @@ -63,7 +65,11 @@ class ImagePackCommand extends BaseCommand {

report.reportInfo(
null,
`Package workspace ${workspace.manifest.raw.name} to ${destination}`
`Package workspace ${
workspace.manifest.name
? structUtils.prettyIdent(configuration, workspace.manifest.name)
: workspace.relativeCwd
} to ${destination}`
)

await packUtils.pack(configuration, project, workspace, report, destination)
Expand All @@ -78,7 +84,7 @@ class ImagePackCommand extends BaseCommand {

const descriptorPath = await forRepository(repo)

const buildpackVersion = packConfiguration.buildpackVersion || '0.0.4'
const buildpackVersion = packConfiguration.buildpackVersion || '0.0.5'
const builderTag = packConfiguration.builderTag || 'buster-18.19'

const args = [
Expand Down Expand Up @@ -111,7 +117,11 @@ class ImagePackCommand extends BaseCommand {
} else {
report.reportInfo(
null,
`Workspace ${workspace.manifest.raw.name} not allowed for package.`
`Workspace ${
workspace.manifest.name
? structUtils.prettyIdent(configuration, workspace.manifest.name)
: workspace.relativeCwd
} not allowed for package.`
)
}
}
Expand All @@ -129,12 +139,14 @@ class ImagePackCommand extends BaseCommand {
'actl service build',
'actl renderer build',
'build-storybook',
'storybook build',
'next build',
'builder build library',
'app service build',
'app renderer build',
'service build',
'renderer build',
'strapi build',
].some((command) => buildCommand?.includes(command))

return hasAllowedBuildScript && Boolean(name)
Expand Down
Loading