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

chore: Adjust post-build script to add license files for sourcemaps on build #45832

Merged
merged 4 commits into from
Jun 14, 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
29 changes: 29 additions & 0 deletions build/npm-post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

set -e

# Build CSS files from SCSS
npm run sass
# Build icons
npm run sass:icons

# Add licenses for source maps
if [ -d "dist" ]; then
for f in dist/*.js; do
# If license file and source map exists copy license for the source map
if [ -f "$f.license" ] && [ -f "$f.map" ]; then
# Remove existing link
[ -e "$f.map.license" ] || [ -L "$f.map.license" ] && rm "$f.map.license"
# Create a new link
ln -s "$(basename "$f.license")" "$f.map.license"
fi
done
echo "Copying licenses for sourcemaps done"
else
echo "This script needs to be executed from the root of the repository"
exit 1
fi

1 change: 1 addition & 0 deletions dist/1110-1110.js.map.license
1 change: 1 addition & 0 deletions dist/1439-1439.js.map.license
1 change: 1 addition & 0 deletions dist/5390-5390.js.map.license
1 change: 1 addition & 0 deletions dist/5455-5455.js.map.license
1 change: 1 addition & 0 deletions dist/7462-7462.js.map.license
1 change: 1 addition & 0 deletions dist/7883-7883.js.map.license
1 change: 1 addition & 0 deletions dist/8377-8377.js.map.license
1 change: 1 addition & 0 deletions dist/8821-8821.js.map.license
1 change: 1 addition & 0 deletions dist/comments-comments-app.js.map.license
1 change: 1 addition & 0 deletions dist/comments-comments-tab.js.map.license
1 change: 1 addition & 0 deletions dist/comments-init.js.map.license
1 change: 1 addition & 0 deletions dist/core-common.js.map.license
1 change: 1 addition & 0 deletions dist/core-files_client.js.map.license
1 change: 1 addition & 0 deletions dist/core-files_fileinfo.js.map.license
1 change: 1 addition & 0 deletions dist/core-install.js.map.license
1 change: 1 addition & 0 deletions dist/core-legacy-unified-search.js.map.license
1 change: 1 addition & 0 deletions dist/core-login.js.map.license
1 change: 1 addition & 0 deletions dist/core-main.js.map.license
1 change: 1 addition & 0 deletions dist/core-maintenance.js.map.license
1 change: 1 addition & 0 deletions dist/core-profile.js.map.license
1 change: 1 addition & 0 deletions dist/core-recommendedapps.js.map.license
1 change: 1 addition & 0 deletions dist/core-systemtags.js.map.license
1 change: 1 addition & 0 deletions dist/core-unified-search.js.map.license
1 change: 1 addition & 0 deletions dist/core-unsupported-browser-redirect.js.map.license
1 change: 1 addition & 0 deletions dist/core-unsupported-browser.js.map.license
1 change: 1 addition & 0 deletions dist/dashboard-main.js.map.license
1 change: 1 addition & 0 deletions dist/dav-settings-admin-caldav.js.map.license
1 change: 1 addition & 0 deletions dist/dav-settings-personal-availability.js.map.license
1 change: 1 addition & 0 deletions dist/federatedfilesharing-external.js.map.license
1 change: 1 addition & 0 deletions dist/files-init.js.map.license
1 change: 1 addition & 0 deletions dist/files-main.js.map.license
1 change: 1 addition & 0 deletions dist/files-personal-settings.js.map.license
1 change: 1 addition & 0 deletions dist/files-reference-files.js.map.license
1 change: 1 addition & 0 deletions dist/files-search.js.map.license
1 change: 1 addition & 0 deletions dist/files-sidebar.js.map.license
1 change: 1 addition & 0 deletions dist/files_external-init.js.map.license
1 change: 1 addition & 0 deletions dist/files_reminders-init.js.map.license
1 change: 1 addition & 0 deletions dist/files_sharing-additionalScripts.js.map.license
1 change: 1 addition & 0 deletions dist/files_sharing-files_sharing_tab.js.map.license
1 change: 1 addition & 0 deletions dist/files_sharing-init.js.map.license
1 change: 1 addition & 0 deletions dist/files_sharing-main.js.map.license
1 change: 1 addition & 0 deletions dist/files_sharing-personal-settings.js.map.license
1 change: 1 addition & 0 deletions dist/files_trashbin-main.js.map.license
1 change: 1 addition & 0 deletions dist/files_versions-files_versions.js.map.license
1 change: 1 addition & 0 deletions dist/oauth2-oauth2.js.map.license
1 change: 1 addition & 0 deletions dist/settings-apps-view-4529.js.map.license
1 change: 1 addition & 0 deletions dist/settings-apps.js.map.license
1 change: 1 addition & 0 deletions dist/settings-declarative-settings-forms.js.map.license
1 change: 1 addition & 0 deletions dist/settings-legacy-admin.js.map.license
1 change: 1 addition & 0 deletions dist/settings-users-3239.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-admin-ai.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-admin-delegation.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-admin-security.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-admin-sharing.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-nextcloud-pdf.js.map.license
1 change: 1 addition & 0 deletions dist/settings-vue-settings-personal-info.js.map.license
1 change: 1 addition & 0 deletions dist/systemtags-admin.js.map.license
1 change: 1 addition & 0 deletions dist/systemtags-init.js.map.license
1 change: 1 addition & 0 deletions dist/theming-admin-theming.js.map.license
1 change: 1 addition & 0 deletions dist/theming-personal-theming.js.map.license
1 change: 1 addition & 0 deletions dist/twofactor_backupcodes-settings.js.map.license
1 change: 1 addition & 0 deletions dist/updatenotification-init.js.map.license
1 change: 1 addition & 0 deletions dist/updatenotification-updatenotification.js.map.license
1 change: 1 addition & 0 deletions dist/user-status-modal-5133.js.map.license
1 change: 1 addition & 0 deletions dist/user_status-menu.js.map.license
1 change: 1 addition & 0 deletions dist/weather_status-weather-status.js.map.license
1 change: 1 addition & 0 deletions dist/workflowengine-workflowengine.js.map.license
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"build": "webpack --node-env production --progress",
"postbuild": "npm run sass && npm run sass:icons",
"postbuild": "build/npm-post-build.sh",
"dev": "webpack --node-env development --progress",
"watch": "webpack --node-env development --progress --watch",
"lint": "eslint $(for appdir in $(ls apps); do if ! $(git check-ignore -q $appdir); then printf \"$appdir \"; fi; done) core --no-error-on-unmatched-pattern",
Expand Down
Loading