# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit yarn

DESCRIPTION="VS Code extensions manager for extension developers."
HOMEPAGE="https://code.visualstudio.com"
NPM_P="@${P/-/\/}"
NPM_PN="@${PN/-/\/}"
YARN_PKGS=(
	@azure/abort-controller-1.1.0
	@azure/abort-controller-2.1.2
	@azure/core-auth-1.8.0
	@azure/core-client-1.9.2
	@azure/core-rest-pipeline-1.17.0
	@azure/core-tracing-1.2.0
	@azure/core-util-1.10.0
	@azure/identity-4.4.1
	@azure/logger-1.1.4
	@azure/msal-browser-3.26.1
	@azure/msal-common-14.15.0
	@azure/msal-node-2.15.0
	@isaacs/cliui-8.0.2
	@vscode/vsce-3.2.1
	@vscode/vsce-sign-2.0.4
	@vscode/vsce-sign-alpine-arm64-2.0.2
	@vscode/vsce-sign-alpine-x64-2.0.2
	@vscode/vsce-sign-darwin-arm64-2.0.2
	@vscode/vsce-sign-darwin-x64-2.0.2
	@vscode/vsce-sign-linux-arm-2.0.2
	@vscode/vsce-sign-linux-arm64-2.0.2
	@vscode/vsce-sign-linux-x64-2.0.2
	@vscode/vsce-sign-win32-arm64-2.0.2
	@vscode/vsce-sign-win32-x64-2.0.2
	agent-base-7.1.1
	ansi-regex-5.0.1
	ansi-regex-6.1.0
	ansi-styles-3.2.1
	ansi-styles-4.3.0
	ansi-styles-6.2.1
	argparse-2.0.1
	asynckit-0.4.0
	azure-devops-node-api-12.5.0
	balanced-match-1.0.2
	base64-js-1.5.1
	bl-4.1.0
	boolbase-1.0.0
	brace-expansion-1.1.11
	brace-expansion-2.0.1
	buffer-5.7.1
	buffer-crc32-0.2.13
	buffer-equal-constant-time-1.0.1
	call-bind-1.0.7
	chalk-2.4.2
	cheerio-1.0.0
	cheerio-select-2.1.0
	chownr-1.1.4
	cockatiel-3.2.1
	color-convert-1.9.3
	color-convert-2.0.1
	color-name-1.1.3
	color-name-1.1.4
	combined-stream-1.0.8
	commander-6.2.1
	concat-map-0.0.1
	cross-spawn-7.0.3
	css-select-5.1.0
	css-what-6.1.0
	debug-4.3.7
	decompress-response-6.0.0
	deep-extend-0.6.0
	define-data-property-1.1.4
	define-lazy-prop-2.0.0
	delayed-stream-1.0.0
	detect-libc-2.0.3
	dom-serializer-2.0.0
	domelementtype-2.3.0
	domhandler-5.0.3
	domutils-3.1.0
	eastasianwidth-0.2.0
	ecdsa-sig-formatter-1.0.11
	emoji-regex-8.0.0
	emoji-regex-9.2.2
	encoding-sniffer-0.2.0
	end-of-stream-1.4.4
	entities-4.5.0
	es-define-property-1.0.0
	es-errors-1.3.0
	escape-string-regexp-1.0.5
	events-3.3.0
	expand-template-2.0.3
	fd-slicer-1.1.0
	foreground-child-3.3.0
	form-data-4.0.1
	fs-constants-1.0.0
	function-bind-1.1.2
	get-intrinsic-1.2.4
	github-from-package-0.0.0
	glob-11.0.0
	gopd-1.0.1
	has-flag-3.0.0
	has-property-descriptors-1.0.2
	has-proto-1.0.3
	has-symbols-1.0.3
	hasown-2.0.2
	hosted-git-info-4.1.0
	htmlparser2-9.1.0
	http-proxy-agent-7.0.2
	https-proxy-agent-7.0.5
	iconv-lite-0.6.3
	ieee754-1.2.1
	inherits-2.0.4
	ini-1.3.8
	is-docker-2.2.1
	is-fullwidth-code-point-3.0.0
	is-wsl-2.2.0
	isexe-2.0.0
	jackspeak-4.0.2
	jsonc-parser-3.3.1
	jsonwebtoken-9.0.2
	jwa-1.4.1
	jwa-2.0.0
	jws-3.2.2
	jws-4.0.0
	keytar-7.9.0
	leven-3.1.0
	linkify-it-5.0.0
	lodash.includes-4.3.0
	lodash.isboolean-3.0.3
	lodash.isinteger-4.0.4
	lodash.isnumber-3.0.3
	lodash.isplainobject-4.0.6
	lodash.isstring-4.0.1
	lodash.once-4.1.1
	lru-cache-11.0.1
	lru-cache-6.0.0
	markdown-it-14.1.0
	mdurl-2.0.0
	mime-1.6.0
	mime-db-1.52.0
	mime-types-2.1.35
	mimic-response-3.1.0
	minimatch-10.0.1
	minimatch-3.1.2
	minimist-1.2.8
	minipass-7.1.2
	mkdirp-classic-0.5.3
	ms-2.1.3
	mute-stream-0.0.8
	napi-build-utils-1.0.2
	node-abi-3.69.0
	node-addon-api-4.3.0
	nth-check-2.1.1
	object-inspect-1.13.2
	once-1.4.0
	open-8.4.2
	package-json-from-dist-1.0.1
	parse-semver-1.1.1
	parse5-7.2.0
	parse5-htmlparser2-tree-adapter-7.1.0
	parse5-parser-stream-7.1.2
	path-key-3.1.1
	path-scurry-2.0.0
	pend-1.2.0
	prebuild-install-7.1.2
	pump-3.0.2
	punycode.js-2.3.1
	qs-6.13.0
	rc-1.2.8
	read-1.0.7
	readable-stream-3.6.2
	safe-buffer-5.2.1
	safer-buffer-2.1.2
	sax-1.4.1
	semver-5.7.2
	semver-7.6.3
	set-function-length-1.2.2
	shebang-command-2.0.0
	shebang-regex-3.0.0
	side-channel-1.0.6
	signal-exit-4.1.0
	simple-concat-1.0.1
	simple-get-4.0.1
	stoppable-1.1.0
	string-width-4.2.3
	string-width-5.1.2
	string_decoder-1.3.0
	strip-ansi-6.0.1
	strip-ansi-7.1.0
	strip-json-comments-2.0.1
	supports-color-5.5.0
	tar-fs-2.1.1
	tar-stream-2.2.0
	tmp-0.2.3
	tslib-2.7.0
	tunnel-0.0.6
	tunnel-agent-0.6.0
	typed-rest-client-1.8.11
	uc.micro-2.1.0
	underscore-1.13.7
	undici-6.20.1
	url-join-4.0.1
	util-deprecate-1.0.2
	uuid-8.3.2
	whatwg-encoding-3.1.1
	whatwg-mimetype-4.0.0
	which-2.0.2
	wrap-ansi-7.0.0
	wrap-ansi-8.1.0
	wrappy-1.0.2
	xml2js-0.5.0
	xmlbuilder-11.0.1
	yallist-4.0.0
	yauzl-2.10.0
	yazl-2.5.1
)
yarn_set_globals
SRC_URI="${YARN_SRC_URI}"

BDEPEND="dev-libs/glib"
LICENSE="BSD-2 MIT Apache-2 ISC MIT PSF-2"
KEYWORDS="~amd64"

S="${WORKDIR}"

src_install() {
	yarn_src_install
	fperms 0755 "/usr/$(get_libdir)/${PN}/node_modules/${NPM_PN}/vsce"
	dosym "../$(get_libdir)/${PN}/node_modules/${NPM_PN}/vsce" "/usr/bin/vsce"
}