From 945ae039ebb7605da13178cb2a98b109bc2d01e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Thu, 27 Jul 2023 18:14:43 +0000 Subject: [PATCH] feat: nix flake for development --- .gitignore | 5 + flake.lock | 27 ++++ flake.nix | 73 ++++++++++ frontend/app/.prettierrc.js | 1 + frontend/app/ICONS.md | 11 +- .../src/main/assets/capacitor.plugins.json | 136 +++++++++--------- .../app/android/capacitor.settings.gradle | 36 ++--- frontend/app/android/gradlew | 0 frontend/app/ios/App/Podfile | 38 ++--- frontend/app/package.json | 4 +- frontend/app/requirements.txt | 7 + frontend/app/scripts/minify-icon-font.ts | 8 +- 12 files changed, 229 insertions(+), 117 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix mode change 100644 => 100755 frontend/app/android/gradlew create mode 100644 frontend/app/requirements.txt diff --git a/.gitignore b/.gitignore index d4c7b811..f9869fa4 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,11 @@ www/ coverage.xml report-junit.xml .deploy/ +.venv/ + +# NixOS flake +result +hsperfdata_root # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..8395d915 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1689752456, + "narHash": "sha256-VOChdECcEI8ixz8QY+YC4JaNEFwQd1V8bA0G4B28Ki0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7f256d7da238cb627ef189d56ed590739f42f13b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..b5f90bee --- /dev/null +++ b/flake.nix @@ -0,0 +1,73 @@ +{ + description = "A Nix-flake-based development environment for OpenStApps"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + outputs = { self, nixpkgs }: + let + buildToolsVersion = "30.0.3"; + overlays = [ + (final: prev: rec { + nodejs = prev.nodejs-18_x; + pnpm = prev.nodePackages.pnpm; + chrome = prev.google-chrome; + firefox = prev.firefox; + webkit = prev.epiphany; # Safari-ish browser + android = prev.androidenv.composeAndroidPackages { + buildToolsVersions = [ "${buildToolsVersion}" ]; + platformVersions = [ "32" ]; + }; + cypress = prev.cypress.overrideAttrs(prev: { + version = "12.17.1"; + }); + }) + ]; + # TODO: aarch64-linux, x68_64-darwin, aarch64-darwin + supportedSystems = [ "x86_64-linux" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { + inherit overlays system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: + let + python = (pkgs.python311.withPackages(ps: with ps; [ brotli fonttools ] ++ (with fonttools.optional-dependencies; [ ufo lxml unicode woff ]))); + in + { + default = (pkgs.buildFHSUserEnv { + name = "StApps Dev"; + targetPkgs = pkgs: with pkgs; [ + nodejs + pnpm + python + docker + # tools + curl + jq + # browsers + firefox + chrome + webkit + cypress + # android + jdk17 + android.androidsdk + musl + ]; + runScript = "bash"; + profile = '' + export CYPRESS_INSTALL_BINARY=0 + export CYPRESS_RUN_BINARY=${pkgs.cypress}/bin/Cypress + export ANDROID_SDK_ROOT=${pkgs.android.androidsdk}/libexec/android-sdk + export ANDROID_JAVA_HOME=${pkgs.jdk.home} + export DOCKER_HOST=unix:///run/user/1000/docker.sock + { dockerd-rootless & } 2>/dev/null + ''; + }).env; + }); + }; +} diff --git a/frontend/app/.prettierrc.js b/frontend/app/.prettierrc.js index 12d764a6..98114568 100644 --- a/frontend/app/.prettierrc.js +++ b/frontend/app/.prettierrc.js @@ -23,4 +23,5 @@ module.exports = { }, }, ], + ignorePath: ['.prettierignore', '../../.gitignore'], }; diff --git a/frontend/app/ICONS.md b/frontend/app/ICONS.md index c46227c6..f55bda34 100644 --- a/frontend/app/ICONS.md +++ b/frontend/app/ICONS.md @@ -2,6 +2,14 @@ A few notes to our icon set, for users and future maintainers. +You will need to setup fonttools with python + +```shell +python -m venv .venv && .venv/bin/python -m pip install -r requirements.txt +``` + +Alternatively, anything that puts `fonttools` within your path will do as well. + ## Usage To find icon names, visit the @@ -73,6 +81,3 @@ npm run minify-icons Unfortunately, I was unable to find a JS package that could to the job, and had to rely on the Python module [fonttools](https://github.com/fonttools/fonttools). - -That means that you might run into additional issues when running the -above-mentioned command. diff --git a/frontend/app/android/app/src/main/assets/capacitor.plugins.json b/frontend/app/android/app/src/main/assets/capacitor.plugins.json index 15c7ce3a..91bf9943 100644 --- a/frontend/app/android/app/src/main/assets/capacitor.plugins.json +++ b/frontend/app/android/app/src/main/assets/capacitor.plugins.json @@ -1,70 +1,70 @@ [ - { - "pkg": "@capacitor/app", - "classpath": "com.capacitorjs.plugins.app.AppPlugin" - }, - { - "pkg": "@capacitor/browser", - "classpath": "com.capacitorjs.plugins.browser.BrowserPlugin" - }, - { - "pkg": "@capacitor/device", - "classpath": "com.capacitorjs.plugins.device.DevicePlugin" - }, - { - "pkg": "@capacitor/dialog", - "classpath": "com.capacitorjs.plugins.dialog.DialogPlugin" - }, - { - "pkg": "@capacitor/filesystem", - "classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin" - }, - { - "pkg": "@capacitor/geolocation", - "classpath": "com.capacitorjs.plugins.geolocation.GeolocationPlugin" - }, - { - "pkg": "@capacitor/haptics", - "classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin" - }, - { - "pkg": "@capacitor/keyboard", - "classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin" - }, - { - "pkg": "@capacitor/local-notifications", - "classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin" - }, - { - "pkg": "@capacitor/network", - "classpath": "com.capacitorjs.plugins.network.NetworkPlugin" - }, - { - "pkg": "@capacitor/preferences", - "classpath": "com.capacitorjs.plugins.preferences.PreferencesPlugin" - }, - { - "pkg": "@capacitor/share", - "classpath": "com.capacitorjs.plugins.share.SharePlugin" - }, - { - "pkg": "@capacitor/splash-screen", - "classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin" - }, - { - "pkg": "@capacitor/status-bar", - "classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin" - }, - { - "pkg": "@hugotomazi/capacitor-navigation-bar", - "classpath": "br.com.tombus.capacitor.plugin.navigationbar.NavigationBarPlugin" - }, - { - "pkg": "@transistorsoft/capacitor-background-fetch", - "classpath": "com.transistorsoft.bgfetch.capacitor.BackgroundFetchPlugin" - }, - { - "pkg": "capacitor-secure-storage-plugin", - "classpath": "com.whitestein.securestorage.SecureStoragePluginPlugin" - } + { + "pkg": "@capacitor/app", + "classpath": "com.capacitorjs.plugins.app.AppPlugin" + }, + { + "pkg": "@capacitor/browser", + "classpath": "com.capacitorjs.plugins.browser.BrowserPlugin" + }, + { + "pkg": "@capacitor/device", + "classpath": "com.capacitorjs.plugins.device.DevicePlugin" + }, + { + "pkg": "@capacitor/dialog", + "classpath": "com.capacitorjs.plugins.dialog.DialogPlugin" + }, + { + "pkg": "@capacitor/filesystem", + "classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin" + }, + { + "pkg": "@capacitor/geolocation", + "classpath": "com.capacitorjs.plugins.geolocation.GeolocationPlugin" + }, + { + "pkg": "@capacitor/haptics", + "classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin" + }, + { + "pkg": "@capacitor/keyboard", + "classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin" + }, + { + "pkg": "@capacitor/local-notifications", + "classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin" + }, + { + "pkg": "@capacitor/network", + "classpath": "com.capacitorjs.plugins.network.NetworkPlugin" + }, + { + "pkg": "@capacitor/preferences", + "classpath": "com.capacitorjs.plugins.preferences.PreferencesPlugin" + }, + { + "pkg": "@capacitor/share", + "classpath": "com.capacitorjs.plugins.share.SharePlugin" + }, + { + "pkg": "@capacitor/splash-screen", + "classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin" + }, + { + "pkg": "@capacitor/status-bar", + "classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin" + }, + { + "pkg": "@hugotomazi/capacitor-navigation-bar", + "classpath": "br.com.tombus.capacitor.plugin.navigationbar.NavigationBarPlugin" + }, + { + "pkg": "@transistorsoft/capacitor-background-fetch", + "classpath": "com.transistorsoft.bgfetch.capacitor.BackgroundFetchPlugin" + }, + { + "pkg": "capacitor-secure-storage-plugin", + "classpath": "com.whitestein.securestorage.SecureStoragePluginPlugin" + } ] diff --git a/frontend/app/android/capacitor.settings.gradle b/frontend/app/android/capacitor.settings.gradle index e6ea0f3d..d525c86e 100644 --- a/frontend/app/android/capacitor.settings.gradle +++ b/frontend/app/android/capacitor.settings.gradle @@ -1,54 +1,54 @@ // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') +project(':capacitor-android').projectDir = new File('../../../node_modules/.pnpm/@capacitor+android@4.6.1_@capacitor+core@4.6.1/node_modules/@capacitor/android/capacitor') include ':capacitor-app' -project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android') +project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@4.1.1_@capacitor+core@4.6.1/node_modules/@capacitor/app/android') include ':capacitor-browser' -project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android') +project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/browser/android') include ':capacitor-device' -project(':capacitor-device').projectDir = new File('../node_modules/@capacitor/device/android') +project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/device/android') include ':capacitor-dialog' -project(':capacitor-dialog').projectDir = new File('../node_modules/@capacitor/dialog/android') +project(':capacitor-dialog').projectDir = new File('../../../node_modules/.pnpm/@capacitor+dialog@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/dialog/android') include ':capacitor-filesystem' -project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android') +project(':capacitor-filesystem').projectDir = new File('../../../node_modules/.pnpm/@capacitor+filesystem@4.1.4_@capacitor+core@4.6.1/node_modules/@capacitor/filesystem/android') include ':capacitor-geolocation' -project(':capacitor-geolocation').projectDir = new File('../node_modules/@capacitor/geolocation/android') +project(':capacitor-geolocation').projectDir = new File('../../../node_modules/.pnpm/@capacitor+geolocation@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/geolocation/android') include ':capacitor-haptics' -project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android') +project(':capacitor-haptics').projectDir = new File('../../../node_modules/.pnpm/@capacitor+haptics@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/haptics/android') include ':capacitor-keyboard' -project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android') +project(':capacitor-keyboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+keyboard@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/keyboard/android') include ':capacitor-local-notifications' -project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android') +project(':capacitor-local-notifications').projectDir = new File('../../../node_modules/.pnpm/@capacitor+local-notifications@4.1.4_@capacitor+core@4.6.1/node_modules/@capacitor/local-notifications/android') include ':capacitor-network' -project(':capacitor-network').projectDir = new File('../node_modules/@capacitor/network/android') +project(':capacitor-network').projectDir = new File('../../../node_modules/.pnpm/@capacitor+network@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/network/android') include ':capacitor-preferences' -project(':capacitor-preferences').projectDir = new File('../node_modules/@capacitor/preferences/android') +project(':capacitor-preferences').projectDir = new File('../../../node_modules/.pnpm/@capacitor+preferences@4.0.2_@capacitor+core@4.6.1/node_modules/@capacitor/preferences/android') include ':capacitor-share' -project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android') +project(':capacitor-share').projectDir = new File('../../../node_modules/.pnpm/@capacitor+share@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/share/android') include ':capacitor-splash-screen' -project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android') +project(':capacitor-splash-screen').projectDir = new File('../../../node_modules/.pnpm/@capacitor+splash-screen@4.1.2_@capacitor+core@4.6.1/node_modules/@capacitor/splash-screen/android') include ':capacitor-status-bar' -project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android') +project(':capacitor-status-bar').projectDir = new File('../../../node_modules/.pnpm/@capacitor+status-bar@4.1.1_@capacitor+core@4.6.1/node_modules/@capacitor/status-bar/android') include ':hugotomazi-capacitor-navigation-bar' -project(':hugotomazi-capacitor-navigation-bar').projectDir = new File('../node_modules/@hugotomazi/capacitor-navigation-bar/android') +project(':hugotomazi-capacitor-navigation-bar').projectDir = new File('../../../node_modules/.pnpm/@hugotomazi+capacitor-navigation-bar@2.0.0_@capacitor+core@4.6.1/node_modules/@hugotomazi/capacitor-navigation-bar/android') include ':transistorsoft-capacitor-background-fetch' -project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../node_modules/@transistorsoft/capacitor-background-fetch/android') +project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@4.6.1/node_modules/@transistorsoft/capacitor-background-fetch/android') include ':capacitor-secure-storage-plugin' -project(':capacitor-secure-storage-plugin').projectDir = new File('../node_modules/capacitor-secure-storage-plugin/android') +project(':capacitor-secure-storage-plugin').projectDir = new File('../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.8.1_@capacitor+core@4.6.1/node_modules/capacitor-secure-storage-plugin/android') diff --git a/frontend/app/android/gradlew b/frontend/app/android/gradlew old mode 100644 new mode 100755 diff --git a/frontend/app/ios/App/Podfile b/frontend/app/ios/App/Podfile index a20e073c..b0c14626 100644 --- a/frontend/app/ios/App/Podfile +++ b/frontend/app/ios/App/Podfile @@ -9,25 +9,25 @@ use_frameworks! install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods - pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' - pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser' - pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device' - pod 'CapacitorDialog', :path => '../../node_modules/@capacitor/dialog' - pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem' - pod 'CapacitorGeolocation', :path => '../../node_modules/@capacitor/geolocation' - pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' - pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' - pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications' - pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network' - pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences' - pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share' - pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen' - pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' - pod 'HugotomaziCapacitorNavigationBar', :path => '../../node_modules/@hugotomazi/capacitor-navigation-bar' - pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../node_modules/@transistorsoft/capacitor-background-fetch' - pod 'CapacitorSecureStoragePlugin', :path => '../../node_modules/capacitor-secure-storage-plugin' + pod 'Capacitor', :path => '../../../../node_modules/.pnpm/@capacitor+ios@4.6.1_@capacitor+core@4.6.1/node_modules/@capacitor/ios' + pod 'CapacitorCordova', :path => '../../../../node_modules/.pnpm/@capacitor+ios@4.6.1_@capacitor+core@4.6.1/node_modules/@capacitor/ios' + pod 'CapacitorApp', :path => '../../../../node_modules/.pnpm/@capacitor+app@4.1.1_@capacitor+core@4.6.1/node_modules/@capacitor/app' + pod 'CapacitorBrowser', :path => '../../../../node_modules/.pnpm/@capacitor+browser@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/browser' + pod 'CapacitorDevice', :path => '../../../../node_modules/.pnpm/@capacitor+device@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/device' + pod 'CapacitorDialog', :path => '../../../../node_modules/.pnpm/@capacitor+dialog@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/dialog' + pod 'CapacitorFilesystem', :path => '../../../../node_modules/.pnpm/@capacitor+filesystem@4.1.4_@capacitor+core@4.6.1/node_modules/@capacitor/filesystem' + pod 'CapacitorGeolocation', :path => '../../../../node_modules/.pnpm/@capacitor+geolocation@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/geolocation' + pod 'CapacitorHaptics', :path => '../../../../node_modules/.pnpm/@capacitor+haptics@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/haptics' + pod 'CapacitorKeyboard', :path => '../../../../node_modules/.pnpm/@capacitor+keyboard@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/keyboard' + pod 'CapacitorLocalNotifications', :path => '../../../../node_modules/.pnpm/@capacitor+local-notifications@4.1.4_@capacitor+core@4.6.1/node_modules/@capacitor/local-notifications' + pod 'CapacitorNetwork', :path => '../../../../node_modules/.pnpm/@capacitor+network@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/network' + pod 'CapacitorPreferences', :path => '../../../../node_modules/.pnpm/@capacitor+preferences@4.0.2_@capacitor+core@4.6.1/node_modules/@capacitor/preferences' + pod 'CapacitorShare', :path => '../../../../node_modules/.pnpm/@capacitor+share@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/share' + pod 'CapacitorSplashScreen', :path => '../../../../node_modules/.pnpm/@capacitor+splash-screen@4.1.2_@capacitor+core@4.6.1/node_modules/@capacitor/splash-screen' + pod 'CapacitorStatusBar', :path => '../../../../node_modules/.pnpm/@capacitor+status-bar@4.1.1_@capacitor+core@4.6.1/node_modules/@capacitor/status-bar' + pod 'HugotomaziCapacitorNavigationBar', :path => '../../../../node_modules/.pnpm/@hugotomazi+capacitor-navigation-bar@2.0.0_@capacitor+core@4.6.1/node_modules/@hugotomazi/capacitor-navigation-bar' + pod 'TransistorsoftCapacitorBackgroundFetch', :path => '../../../../node_modules/.pnpm/@transistorsoft+capacitor-background-fetch@1.0.2_@capacitor+core@4.6.1/node_modules/@transistorsoft/capacitor-background-fetch' + pod 'CapacitorSecureStoragePlugin', :path => '../../../../node_modules/.pnpm/capacitor-secure-storage-plugin@0.8.1_@capacitor+core@4.6.1/node_modules/capacitor-secure-storage-plugin' pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins' end diff --git a/frontend/app/package.json b/frontend/app/package.json index e676eec1..8d40a5ab 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -31,8 +31,8 @@ "docker:run:android": "sudo docker run -v $PWD:/app --privileged -v /dev/bus/usb:/dev/bus/usb --net=host -it registry.gitlab.com/openstapps/app bash -c \"npm run run:android\"", "docker:serve": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm run start:external\"", "e2e": "ng e2e", - "format": "prettier . -c --ignore-path ../../.gitignore", - "format:fix": "prettier --write . --ignore-path ../../.gitignore", + "format": "prettier . -c", + "format:fix": "prettier --write .", "licenses": "license-checker --json > src/assets/about/licenses.json && ts-node ./scripts/accumulate-licenses.ts && git add src/assets/about/licenses.json", "lint": "ng lint && stylelint \"**/*.scss\"", "lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/ && stylelint --fix \"**/*.scss\"", diff --git a/frontend/app/requirements.txt b/frontend/app/requirements.txt new file mode 100644 index 00000000..facab8d9 --- /dev/null +++ b/frontend/app/requirements.txt @@ -0,0 +1,7 @@ +appdirs==1.4.4 +Brotli==1.0.9 +fonttools==4.41.0 +fs==2.4.16 +lxml==4.9.3 +six==1.16.0 +zopfli==0.2.2 diff --git a/frontend/app/scripts/minify-icon-font.ts b/frontend/app/scripts/minify-icon-font.ts index a8a44bf4..d2626681 100644 --- a/frontend/app/scripts/minify-icon-font.ts +++ b/frontend/app/scripts/minify-icon-font.ts @@ -86,15 +86,9 @@ async function minifyIconFont() { } glyphs.sort(); - const pythonPath = `"${await run('npm config get python')}"`; - console.log(`Using python from npm config ${pythonPath}`); - console.log(await run(`${pythonPath} --version`)); - console.log(await run([pythonPath, '-m', 'pip', 'install', 'fonttools[ufo,lxml,unicode,woff]'])); - console.log( await run([ - pythonPath, - '-m fontTools.subset', + 'pyftsubset', `"${config.inputPath}"`, `--unicodes=${glyphs.join(',')}`, '--no-layout-closure',