Accepting request 1200054 from devel:languages:nodejs

- New upstream release 3.2.13
  * Export a `default` property (gh#electron/asar#325)
- New upstream release 3.2.11
  * complete rewrite of the program in Typescript
  * ensure symlinks do not write unexpectedly (gh#electron/asar#322)
- Run test suite in %check

OBS-URL: https://build.opensuse.org/request/show/1200054
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/asar?expand=0&rev=10
This commit is contained in:
Ana Guerrero 2024-09-11 14:55:45 +00:00 committed by Git OBS Bridge
commit 7582ef8514
6 changed files with 51 additions and 10 deletions

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Sep 11 08:00:37 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
- New upstream release 3.2.13
* Export a `default` property (gh#electron/asar#325)
-------------------------------------------------------------------
Tue Sep 10 20:20:43 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
- New upstream release 3.2.11
* complete rewrite of the program in Typescript
* ensure symlinks do not write unexpectedly (gh#electron/asar#322)
- Run test suite in %check
-------------------------------------------------------------------
Sun May 5 15:36:24 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>

View File

@ -17,7 +17,7 @@
Name: asar
Version: 3.2.10
Version: 3.2.13
Release: 0
Summary: Creating atom-shell (electron) app packages
License: MIT and ISC
@ -38,6 +38,7 @@ BuildRequires: nodejs-npm
%else
BuildRequires: npm
%endif
BuildRequires: typescript
BuildRequires: zstd
%global __requires_exclude ^npm(.*)$
@ -50,9 +51,16 @@ having random access support.
%prep
%autosetup -p1 -a 1
# Use system typescript for building
rm -rf node_modules/typescript
rm -v node_modules/.bin/ts{c,server}
%build
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
npm rebuild --verbose --foreground-scripts
# tsc may return a non-zero exit code due to type warnings despite actually succesfully compiling the code.
# If it fails to compile, it will be catched anyway in #check.
tsc --removeComments --sourceMap false || true
%install
mkdir -pv %{buildroot}%{nodejs_sitelib}/@electron
@ -67,7 +75,15 @@ cd %{buildroot}%{nodejs_sitelib}/asar
# Correct bogus version in package.json
jq -cj '.version="%{version}"' package.json > new
mv new package.json
#remove devdependencies
jq -cj 'del(.devDependencies)' package.json > tmp
mv -v tmp package.json
npm prune --omit=dev --verbose --ignore-scripts
mv -v new package.json
#Remove development garbage
find -name example -print0 |xargs -r0 -- rm -rvf
find -name test -print0 |xargs -r0 -- rm -rvf
@ -84,17 +100,27 @@ find -name 'snapcraft*' -type f -print -delete
find -name '.git*' -type f -print -delete
find -name yarn.lock -type f -print -delete
find -name '.yarn*' -type f -print -delete
find -name '*package-lock.json' -type f -print -delete
find -name '.prettierrc*' -type f -print -delete
find -name '.releaserc*' -type f -print -delete
find -name tsconfig.json -type f -print -delete
# Remove empty directories
find . -type d -empty -print -delete
%fdupes %{buildroot}
%check
pushd %{buildroot}%{nodejs_sitelib}/asar
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/#_build_testing_in_check
%{__nodejs} -e 'require("./")'
#check that the executable starts
./bin/asar.js -h
popd
#We can't run tests, we don't have mocha available.
#the actual test suite
npx mocha -- --reporter spec --timeout 10000
%files
%defattr(-,root,root)

View File

@ -40,7 +40,7 @@ pushd "$ASAR_PATH" || cleanup_and_exit 1
echo ">>>>>> Install npm modules"
yarn install --frozen-lockfile --ignore-engines --ignore-platform --ignore-scripts --production --link-duplicates
yarn install --frozen-lockfile --ignore-engines --ignore-platform --ignore-scripts --link-duplicates
ret=$?
if [ $ret -ne 0 ]; then
echo "ERROR: yarn install failed"
@ -65,7 +65,8 @@ echo '>>>>>> Remove vendored binaries'
find . -type f| sponge |\
xargs -P"$(nproc)" -- sh -c 'file "$@" | grep -v '\'': .*script'\'' | grep '\'': .*executable'\'' | tee /dev/stderr | sed '\''s/: .*//'\'' | xargs rm -fv'
echo ">>>>>> Remove empty directories"
find . -type d -empty -print -delete
echo ">>>>>> Package vendor files"
rm -f "${ASAR_PKGDIR}/vendor.tar.zst"

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1756c31e8cd42257081b81726b1489a3923709e4cbf86f7d377fab3870b1e26
size 83884

3
v3.2.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ae3926ecbce6560d9f48948f18aee8ade7651f1ee319eb3e1538a1ffaa68ac8
size 50236

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb65f1c689dc7f1915c21590c44e95fb9d573e752c35026277e25bc0521a0a1b
size 79194
oid sha256:868bba63e9833e2434238c004473e661597c93adbe1bc40d9c0cf1897808dd9c
size 5366272