Browse Source

feat(tauricon): remove from cli (#3293)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
nothingismagick 3 years ago
parent
commit
58030172ed

+ 5 - 0
.changes/remove-tauricon.md

@@ -0,0 +1,5 @@
+---
+"cli.js": patch
+---
+
+Removed the `icon` command, now exposed as a separate package, see https://github.com/tauri-apps/tauricon.

+ 0 - 61
tooling/cli.js/bin/tauri-icon.js

@@ -1,61 +0,0 @@
-// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
-// SPDX-License-Identifier: Apache-2.0
-// SPDX-License-Identifier: MIT
-
-import parseArgs from 'minimist'
-import tauricon from '../dist/api/tauricon.js'
-
-/**
- * @type {object}
- * @property {boolean} h
- * @property {boolean} help
- * @property {string|boolean} f
- * @property {string|boolean} force
- * @property {boolean} l
- * @property {boolean} log
- * @property {boolean} c
- * @property {boolean} config
- * @property {boolean} s
- * @property {boolean} source
- * @property {boolean} t
- * @property {boolean} target
- */
-const argv = parseArgs(process.argv.slice(2), {
-  alias: {
-    h: 'help',
-    l: 'log',
-    c: 'config',
-    t: 'target'
-  },
-  boolean: ['h', 'l']
-})
-
-if (argv.help) {
-  console.log(`
-  Description
-    Create all the icons you need for your Tauri app.
-    The icon path is the source icon (png, 1240x1240 with transparency).
-
-  Usage
-    $ tauri icon [ICON-PATH]
-
-  Options
-    --help, -h          Displays this message
-    --log, l            Logging [boolean]
-    --target, t         Target folder (default: 'src-tauri/icons')
-    --compression, c    Compression type [optipng|zopfli]
-    --ci                Runs the script in CI mode
-    `)
-  process.exit(0)
-}
-
-tauricon
-  .make(argv._[0], argv.t, argv.c || 'optipng')
-  .then(() => {
-    // TODO: use logger module for prettier output
-    console.log('app:tauri (tauricon) Completed')
-  })
-  .catch((e) => {
-    // TODO: use logger module for prettier output
-    console.error('app:tauri (icon)', e)
-  })

+ 1 - 1
tooling/cli.js/bin/tauri.js

@@ -12,7 +12,7 @@ import { createRequire } from 'module'
 const require = createRequire(import.meta.url)
 const pkg = require('../package.json')
 
-const cmds = ['icon', 'deps']
+const cmds = ['deps']
 const rustCliCmds = ['dev', 'build', 'init', 'info', 'sign']
 
 const cmd = process.argv[2]

+ 0 - 16
tooling/cli.js/package.json

@@ -59,18 +59,8 @@
     "glob": "7.2.0",
     "global-agent": "3.0.0",
     "got": "11.8.3",
-    "imagemin": "8.0.1",
-    "imagemin-optipng": "8.0.0",
-    "imagemin-zopfli": "7.0.0",
     "inquirer": "8.2.0",
-    "is-png": "3.0.1",
-    "minimist": "1.2.5",
     "ms": "2.1.3",
-    "png-to-ico": "2.1.2",
-    "png2icons": "2.0.1",
-    "read-chunk": "4.0.2",
-    "semver": "7.3.5",
-    "sharp": "0.29.3",
     "update-notifier": "5.1.0"
   },
   "devDependencies": {
@@ -84,15 +74,10 @@
     "@rollup/plugin-replace": "3.0.1",
     "@rollup/plugin-typescript": "8.3.0",
     "@types/cross-spawn": "6.0.2",
-    "@types/fs-extra": "9.0.13",
     "@types/glob": "7.2.0",
     "@types/global-agent": "2.1.1",
-    "@types/imagemin": "8.0.0",
-    "@types/imagemin-optipng": "5.2.1",
     "@types/inquirer": "8.1.3",
     "@types/ms": "0.7.31",
-    "@types/semver": "7.3.9",
-    "@types/sharp": "0.29.5",
     "@typescript-eslint/eslint-plugin": "5.9.1",
     "@typescript-eslint/parser": "5.9.1",
     "babel-jest": "27.4.6",
@@ -109,7 +94,6 @@
     "jest-transform-toml": "1.0.0",
     "lockfile-lint": "4.6.2",
     "prettier": "2.5.1",
-    "promise": "8.1.0",
     "rimraf": "3.0.2",
     "rollup": "2.63.0",
     "rollup-plugin-terser": "7.0.2",

+ 0 - 1
tooling/cli.js/rollup.config.js

@@ -19,7 +19,6 @@ const cliManifest = TOML.parse(cliManifestContents)
 export default {
   input: {
     'api/cli': './src/api/cli.ts',
-    'api/tauricon': './src/api/tauricon.ts',
     'api/dependency-manager': './src/api/dependency-manager/index.ts',
     'helpers/spawn': './src/helpers/spawn.ts',
     'helpers/rust-cli': './src/helpers/rust-cli.ts',

+ 0 - 536
tooling/cli.js/src/api/tauricon.ts

@@ -1,536 +0,0 @@
-// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
-// SPDX-License-Identifier: Apache-2.0
-// SPDX-License-Identifier: MIT
-
-'use strict'
-
-/* eslint-disable @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call */
-
-/**
- * This is a module that takes an original image and resizes
- * it to common icon sizes and will put them in a folder.
- * It will retain transparency and can make special file
- * types. You can control the settings.
- *
- * @module tauricon
- * @exports tauricon
- * @author Daniel Thompson-Yvetot
- * @license MIT
- */
-
-import * as fsExtra from 'fs-extra'
-import imagemin, { Plugin } from 'imagemin'
-import optipng from 'imagemin-optipng'
-import zopfli from 'imagemin-zopfli'
-import isPng from 'is-png'
-import path from 'path'
-import * as png2icons from 'png2icons'
-import { readChunk } from 'read-chunk'
-import sharp from 'sharp'
-import { appDir, tauriDir } from '../helpers/app-paths'
-import logger from '../helpers/logger'
-import * as settings from '../helpers/tauricon.config'
-import chalk from 'chalk'
-import { createRequire } from 'module'
-
-// @ts-expect-error
-const { access, ensureDir, ensureFileSync, writeFileSync } = fsExtra.default
-
-const require = createRequire(import.meta.url)
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-const { version } = require('../../package.json')
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-const pngToIco = require('png-to-ico')
-
-const log = logger('app:spawn')
-const warn = logger('app:spawn', chalk.red)
-
-let image: boolean | sharp.Sharp = false
-let spinnerInterval: NodeJS.Timeout | null = null
-
-const exists = async function (file: string | Buffer): Promise<boolean> {
-  try {
-    await access(file)
-    return true
-  } catch (err) {
-    return false
-  }
-}
-
-/**
- * This is the first call that attempts to memoize the sharp(src).
- * If the source image cannot be found or if it is not a png, it
- * is a failsafe that will exit or throw.
- *
- * @param {string} src - a folder to target
- * @exits {error} if not a png, if not an image
- */
-const checkSrc = async (src: string): Promise<boolean | sharp.Sharp> => {
-  if (image !== false) {
-    return image
-  } else {
-    const srcExists = await exists(src)
-    if (!srcExists) {
-      image = false
-      if (spinnerInterval) clearInterval(spinnerInterval)
-      warn('[ERROR] Source image for tauricon not found')
-      process.exit(1)
-    } else {
-      const buffer = await readChunk(src, { startPosition: 0, length: 8 })
-      if (isPng(buffer)) {
-        image = sharp(src)
-        const meta = await image.metadata()
-        if (!meta.hasAlpha || meta.channels !== 4) {
-          if (spinnerInterval) clearInterval(spinnerInterval)
-          warn('[ERROR] Source png for tauricon is not transparent')
-          process.exit(1)
-        }
-
-        // just because PNG is sneaky, lets look at the
-        // individual pixels for something weird
-        const stats = await image.stats()
-        if (stats.isOpaque) {
-          if (spinnerInterval) clearInterval(spinnerInterval)
-          warn(
-            '[ERROR] Source png for tauricon could not be detected as transparent'
-          )
-          process.exit(1)
-        }
-
-        return image
-      } else {
-        image = false
-        if (spinnerInterval) clearInterval(spinnerInterval)
-        warn('[ERROR] Source image for tauricon is not a png')
-        process.exit(1)
-      }
-    }
-  }
-}
-
-/**
- * Sort the folders in the current job for unique folders.
- *
- * @param {object} options - a subset of the settings
- * @returns {array} folders
- */
-// TODO: proper type of options and folders
-const uniqueFolders = (options: { [index: string]: any }): any[] => {
-  let folders = []
-  for (const type in options) {
-    const option = options[String(type)]
-    if (option.folder) {
-      folders.push(option.folder)
-    }
-  }
-  // TODO: is compare argument required?
-  // eslint-disable-next-line @typescript-eslint/require-array-sort-compare
-  folders = folders.sort().filter((x, i, a) => !i || x !== a[i - 1])
-  return folders
-}
-
-/**
- * Turn a hex color (like #212342) into r,g,b values
- *
- * @param {string} hex - hex colour
- * @returns {array} r,g,b
- */
-const hexToRgb = (
-  hex: string
-): { r: number; g: number; b: number } | undefined => {
-  // https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
-  // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
-  const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i
-  hex = hex.replace(
-    shorthandRegex,
-    function (m: string, r: string, g: string, b: string) {
-      return r + r + g + g + b + b
-    }
-  )
-
-  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
-  return result
-    ? {
-        r: parseInt(result[1], 16),
-        g: parseInt(result[2], 16),
-        b: parseInt(result[3], 16)
-      }
-    : undefined
-}
-
-/**
- * validate image and directory
- */
-const validate = async (
-  src: string,
-  target: string
-): Promise<boolean | sharp.Sharp> => {
-  if (target !== undefined) {
-    await ensureDir(target)
-  }
-  const res = await checkSrc(src)
-  return res
-}
-
-// TODO: should take end param?
-/**
- * Log progress in the command line
- *
- * @param {boolean} end
- */
-const progress = (msg: string): void => {
-  process.stdout.write(`  ${msg}                       \r`)
-}
-
-/**
- * Create a spinner on the command line
- *
- * @example
- *
- *     const spinnerInterval = spinner()
- *     // later
- *     clearInterval(spinnerInterval)
- */
-const spinner = (): NodeJS.Timeout | null => {
-  if ('CI' in process.env || process.argv.some((arg) => arg === '--ci')) {
-    return null
-  }
-  return setInterval(() => {
-    process.stdout.write('/ \r')
-    setTimeout(() => {
-      process.stdout.write('- \r')
-      setTimeout(() => {
-        process.stdout.write('\\ \r')
-        setTimeout(() => {
-          process.stdout.write('| \r')
-        }, 100)
-      }, 100)
-    }, 100)
-  }, 500)
-}
-
-const tauricon = {
-  validate: async function (src: string, target: string) {
-    await validate(src, target)
-    return typeof image === 'object'
-  },
-  version: function () {
-    return version
-  },
-  make: async function (
-    src: string | undefined,
-    target: string = path.resolve(tauriDir, 'icons'),
-    strategy: string,
-    // TODO: proper type for options
-    options: { [index: string]: any }
-  ) {
-    if (!src) {
-      src = path.resolve(appDir, 'app-icon.png')
-    }
-    spinnerInterval = spinner()
-    options = options || settings.options.tauri
-    progress(`Building Tauri icns and ico from "${src}"`)
-    await this.validate(src, target)
-    await this.icns(src, target, options, strategy)
-    progress('Building Tauri png icons')
-    await this.build(src, target, options)
-    if (strategy) {
-      progress(`Minifying assets with ${strategy}`)
-      await this.minify(target, options, strategy, 'batch')
-    } else {
-      log('no minify strategy')
-    }
-    progress('Tauricon Finished')
-    if (spinnerInterval) clearInterval(spinnerInterval)
-    return true
-  },
-
-  /**
-   * Creates a set of images according to the subset of options it knows about.
-   *
-   * @param {string} src - image location
-   * @param {string} target - where to drop the images
-   * @param {object} options - js object that defines path and sizes
-   */
-  build: async function (
-    src: string,
-    target: string,
-    // TODO: proper type for options
-    options: { [index: string]: any }
-  ) {
-    await this.validate(src, target)
-    const sharpSrc = sharp(src) // creates the image object
-    const buildify2 = async function (
-      pvar: [string, number, number]
-    ): Promise<void> {
-      try {
-        const pngImage = sharpSrc.resize(pvar[1], pvar[1])
-        if (pvar[2]) {
-          // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-unsafe-argument
-          const rgb = hexToRgb(options.background_color) || {
-            r: undefined,
-            g: undefined,
-            b: undefined
-          }
-          pngImage.flatten({
-            background: { r: rgb.r, g: rgb.g, b: rgb.b, alpha: 1 }
-          })
-        }
-        pngImage.png()
-        await pngImage.toFile(pvar[0])
-      } catch (err) {
-        warn(err)
-      }
-    }
-
-    let output
-    const folders = uniqueFolders(options)
-    // eslint-disable-next-line @typescript-eslint/no-for-in-array
-    for (const n in folders) {
-      const folder = folders[Number(n)]
-      // make the folders first
-      // TODO: should this be ensureDirSync?
-      // eslint-disable-next-line @typescript-eslint/no-floating-promises
-      ensureDir(`${target}${path.sep}${folder}`)
-    }
-    for (const optionKey in options) {
-      const option = options[String(optionKey)]
-      // chain up the transforms
-      for (const sizeKey in option.sizes) {
-        const size = option.sizes[String(sizeKey)]
-        if (!option.splash) {
-          const dest = `${target}/${option.folder}`
-          if (option.infix === true) {
-            output = `${dest}${path.sep}${option.prefix}${size}x${size}${option.suffix}`
-          } else {
-            output = `${dest}${path.sep}${option.prefix}${option.suffix}`
-          }
-          const pvar: [string, number, number] = [
-            output,
-            size,
-            option.background
-          ]
-          await buildify2(pvar)
-        }
-      }
-    }
-  },
-  /**
-   * Creates a set of splash images (COMING SOON!!!)
-   *
-   * @param {string} src - icon location
-   * @param {string} splashSrc - splashscreen location
-   * @param {string} target - where to drop the images
-   * @param {object} options - js object that defines path and sizes
-   */
-  splash: async function (
-    src: string,
-    splashSrc: string,
-    target: string,
-    // TODO: proper type for options
-    options: { [index: string]: any }
-  ) {
-    let output
-    let block = false
-    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-unsafe-argument
-    const rgb = hexToRgb(options.background_color) || {
-      r: undefined,
-      g: undefined,
-      b: undefined
-    }
-
-    // three options
-    // options: splashscreen_type [generate | overlay | pure]
-    //          - generate (icon + background color) DEFAULT
-    //          - overlay (icon + splashscreen)
-    //          - pure (only splashscreen)
-
-    let sharpSrc
-    if (splashSrc === src) {
-      // prevent overlay or pure
-      block = true
-    }
-    if (block || options.splashscreen_type === 'generate') {
-      await this.validate(src, target)
-      if (!image) {
-        process.exit(1)
-      }
-      sharpSrc = sharp(src)
-      sharpSrc
-        .extend({
-          top: 726,
-          bottom: 726,
-          left: 726,
-          right: 726,
-          background: {
-            r: rgb.r,
-            g: rgb.g,
-            b: rgb.b,
-            alpha: 1
-          }
-        })
-        .flatten({ background: { r: rgb.r, g: rgb.g, b: rgb.b, alpha: 1 } })
-    } else if (options.splashscreen_type === 'overlay') {
-      sharpSrc = sharp(splashSrc)
-        .flatten({ background: { r: rgb.r, g: rgb.g, b: rgb.b, alpha: 1 } })
-        .composite([
-          {
-            input: src
-            // blend: 'multiply' <= future work, maybe just a gag
-          }
-        ])
-    } else if (options.splashscreen_type === 'pure') {
-      sharpSrc = sharp(splashSrc).flatten({
-        background: { r: rgb.r, g: rgb.g, b: rgb.b, alpha: 1 }
-      })
-    } else {
-      throw new Error(
-        `unknown options.splashscreen_type: ${options.splashscreen_type}`
-      )
-    }
-    const data = await sharpSrc.toBuffer()
-
-    for (const optionKey in options) {
-      const option = options[String(optionKey)]
-      for (const sizeKey in option.sizes) {
-        const size = option.sizes[String(sizeKey)]
-        if (option.splash) {
-          const dest = `${target}${path.sep}${option.folder}`
-          await ensureDir(dest)
-
-          if (option.infix === true) {
-            output = `${dest}${path.sep}${option.prefix}${size}x${size}${option.suffix}`
-          } else {
-            output = `${dest}${path.sep}${option.prefix}${option.suffix}`
-          }
-          const pvar = [output, size]
-          let sharpData = sharp(data)
-          // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-          sharpData = sharpData.resize(pvar[1][0], pvar[1][1])
-          // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
-          await sharpData.toFile(pvar[0])
-        }
-      }
-    }
-  },
-
-  /**
-   * Minifies a set of images
-   *
-   * @param {string} target - image location
-   * @param {object} options - where to drop the images
-   * @param {string} strategy - which minify strategy to use
-   * @param {string} mode - singlefile or batch
-   */
-  minify: async function (
-    target: string,
-    // TODO: proper type for options
-    options: { [index: string]: any },
-    strategy: string,
-    mode: string
-  ) {
-    let cmd: Plugin
-    const minify = settings.options.minify
-    if (!minify.available.find((x) => x === strategy)) {
-      strategy = minify.type
-    }
-    switch (strategy) {
-      case 'optipng':
-        cmd = optipng(minify.optipngOptions)
-        break
-      case 'zopfli':
-        cmd = zopfli(minify.zopfliOptions)
-        break
-      default:
-        throw new Error('unknown strategy' + strategy)
-    }
-
-    const minifier = async (pvar: string[], cmd: Plugin): Promise<void> => {
-      await imagemin([pvar[0]], {
-        destination: pvar[1],
-        plugins: [cmd]
-      }).catch((err: string) => {
-        warn(err)
-      })
-    }
-
-    switch (mode) {
-      case 'singlefile':
-        await minifier([target, path.dirname(target)], cmd)
-        break
-      case 'batch':
-        // eslint-disable-next-line no-case-declarations
-        const folders = uniqueFolders(options)
-        // eslint-disable-next-line @typescript-eslint/no-for-in-array
-        for (const n in folders) {
-          const folder = folders[Number(n)]
-          log('batch minify:' + String(folder))
-          await minifier(
-            [
-              `${target}${path.sep}${folder}${path.sep}*.png`,
-              `${target}${path.sep}${folder}`
-            ],
-            cmd
-          )
-        }
-        break
-      default:
-        warn('[ERROR] Minify mode must be one of [ singlefile | batch]')
-        process.exit(1)
-    }
-    return 'minified'
-  },
-
-  /**
-   * Creates special icns and ico filetypes
-   *
-   * @param {string} src - image location
-   * @param {string} target - where to drop the images
-   * @param {object} options
-   * @param {string} strategy
-   */
-  icns: async function (
-    src: string,
-    target: string,
-    // TODO: proper type for options
-    options: { [index: string]: any },
-    strategy: string
-  ) {
-    try {
-      if (!image) {
-        process.exit(1)
-      }
-      await this.validate(src, target)
-
-      const s = sharp(src)
-      const metadata = await s.metadata()
-      const buf = await s.toBuffer()
-      let icoBuf
-      if (metadata.width !== metadata.height) {
-        const size = Math.min(metadata.width ?? 256, metadata.height ?? 256)
-        icoBuf = await s.resize(size, size).toBuffer()
-      } else {
-        icoBuf = await s.toBuffer()
-      }
-
-      const out = png2icons.createICNS(buf, png2icons.BICUBIC, 0)
-      if (out === null) {
-        throw new Error('Failed to create icon.icns')
-      }
-      ensureFileSync(path.join(target, '/icon.icns'))
-      writeFileSync(path.join(target, '/icon.icns'), out)
-
-      const out2 = await pngToIco(icoBuf)
-      if (out2 === null) {
-        throw new Error('Failed to create icon.ico')
-      }
-      ensureFileSync(path.join(target, '/icon.ico'))
-      writeFileSync(path.join(target, '/icon.ico'), out2)
-    } catch (err) {
-      console.error(err)
-      throw err
-    }
-  }
-}
-
-export default tauricon

+ 0 - 68
tooling/cli.js/src/helpers/tauricon.config.ts

@@ -1,68 +0,0 @@
-// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
-// SPDX-License-Identifier: Apache-2.0
-// SPDX-License-Identifier: MIT
-
-export const options = {
-  // folder determines in which path to drop the generated file
-  // prefix is the first part of the generated file's name
-  // infix adds e.g. '44x44' based on the size in sizes to the generated file's name
-  // suffix adds a file-ending to the generated file's name
-  // sizes determines the pixel width and height to use
-  background_color: '#000074',
-  theme_color: '#02aa9b',
-  sharp: 'kernel: sharp.kernel.lanczos3', // one of [nearest|cubic|lanczos2|lanczos3]
-  minify: {
-    batch: false,
-    overwrite: true,
-    available: ['optipng', 'zopfli'],
-    type: 'optipng',
-    optipngOptions: {
-      optimizationLevel: 4,
-      paletteReduction: true
-    },
-    zopfliOptions: {
-      transparent: true,
-      more: true
-    }
-  },
-  splash_type: 'generate',
-  tauri: {
-    linux: {
-      folder: '.',
-      prefix: '',
-      infix: true,
-      suffix: '.png',
-      sizes: [32, 128]
-    },
-    linux_2x: {
-      folder: '.',
-      prefix: '128x128@2x',
-      infix: false,
-      suffix: '.png',
-      sizes: [256]
-    },
-    defaults: {
-      folder: '.',
-      prefix: 'icon',
-      infix: false,
-      suffix: '.png',
-      sizes: [512]
-    },
-    appx_logo: {
-      folder: '.',
-      prefix: 'StoreLogo',
-      infix: false,
-      suffix: '.png',
-      sizes: [50]
-    },
-    appx_square: {
-      folder: '.',
-      prefix: 'Square',
-      infix: true,
-      suffix: 'Logo.png',
-      sizes: [30, 44, 71, 89, 107, 142, 150, 284, 310]
-    }
-    // todo: look at capacitor and cordova for insight into what icons
-    // we need for those distribution targets
-  }
-}

+ 0 - 2
tooling/cli.js/src/types/modules.d.ts

@@ -2,7 +2,5 @@
 // SPDX-License-Identifier: Apache-2.0
 // SPDX-License-Identifier: MIT
 
-declare module 'imagemin-zopfli'
-
 // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
 declare const __non_webpack_require__: Function

+ 0 - 54
tooling/cli.js/test/jest/__tests__/tauricon.spec.js

@@ -1,54 +0,0 @@
-import * as appTestSetup from '../fixtures/app-test-setup.js'
-appTestSetup.initJest('app')
-
-describe('[CLI] tauri-icon internals', () => {
-  it('tells you the version', async () => {
-    const tauricon = (await import('api/tauricon')).default
-    const version = tauricon.version()
-    expect(!!version).toBe(true)
-  })
-})
-
-describe('[CLI] tauri-icon builder', () => {
-  it('will still use default compression if missing compression chosen', async () => {
-    const tauricon = (await import('api/tauricon')).default
-    const valid = await tauricon.make(
-      'test/jest/fixtures/tauri-logo.png',
-      'test/jest/tmp/missing',
-      'missing'
-    )
-    expect(valid).toBe(true)
-  })
-
-  it('will not validate a non-file', async () => {
-    try {
-      const tauricon = (await import('api/tauricon')).default
-      await tauricon.make(
-        'test/jest/fixtures/tauri-foo-not-found.png',
-        'test/jest/tmp/optipng',
-        'optipng'
-      )
-    } catch (e) {
-      expect(e.message).toBe('Input file is missing')
-    }
-  })
-
-  it('makes a set of icons with optipng', async () => {
-    const tauricon = (await import('api/tauricon')).default
-    const valid = await tauricon.make(
-      'test/jest/fixtures/tauri-logo.png',
-      'test/jest/tmp/optipng',
-      'optipng'
-    )
-    expect(valid).toBe(true)
-  })
-
-  /*
-  TURNED OFF BECAUSE IT TAKES FOREVER
-  it('makes a set of icons with zopfli', async () => {
-    jest.setTimeout(120000)
-    const valid = await tauricon.make('test/jest/fixtures/tauri-logo.png', 'test/jest/tmp/zopfli', 'zopfli')
-    expect(valid).toBe(true)
-  })
-  */
-})

File diff suppressed because it is too large
+ 6 - 750
tooling/cli.js/yarn.lock


Some files were not shown because too many files changed in this diff