/packify

A build tool to allow users to just simply specify their dependencies they need and it will automatically download, install and configure them properly.

Primary LanguageJavaScriptMIT LicenseMIT

packify

Semantic Versioning 2.0.0 JavaScript Style Guide Linux Windows made-with-javascript made-with-typescript Npm package version Npm package daily downloads Npm package license Npm package dependents

It is a build tool to allow users to just simply specify their dependencies they need and it will automatically download, install and configure them properly.

Table of contents

Coding style

This project follows Javascript Standard Style. Please familiarize yourself with the rules provided in the coding style and make sure all the proposed code changes in your commits are conforming to the style before making a merge request. You can also make use of StandardJS - Javascript Standard Style which is a Visual Studio Code plugin and npm run lint command under the Lint the project section to support you.

Prerequisites

  • Windows 11 or Linux
  • Visual Studio Code with plugins:
    • EditorConfig for VS Code
    • Markdown All in One
    • StandardJS - Javascript Standard Style
    • YAML
  • Node.js 16.3.2 and later

Install dependencies

npm install

Lint the project

npm run lint

Build the project

npm run build

Test the project

npm test

Example usage

'use strict'

import { options, dependencies, zip, file, dll } from '@ii887522/packify'

const projectDirPath = 'test'

options.outDirPath = `${projectDirPath}/lib`
options.x86DllOutDirPaths = [`${projectDirPath}/Debug`, `${projectDirPath}/Release`, `${projectDirPath}/Test`]
options.x64DllOutDirPaths = [`${projectDirPath}/x64/Debug`, `${projectDirPath}/x64/Release`, `${projectDirPath}/x64/Test`]

dependencies(async () => {
  const glfwVersion = '3.3.6'
  const sdl2Version = '2.0.20'
  const sdl2ImageVersion = '2.0.5'
  const sdl2TTFVersion = '2.0.18'
  const nitroVersion = '1.4.4'
  await Promise.all([
    zip(`https://github.com/glfw/glfw/releases/download/${glfwVersion}/glfw-${glfwVersion}.bin.WIN64.zip`),
    zip(`https://www.libsdl.org/release/SDL2-devel-${sdl2Version}-VC.zip`),
    zip(`https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-${sdl2ImageVersion}-VC.zip`),
    zip(`https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${sdl2TTFVersion}-VC.zip`),
    file('https://raw.githubusercontent.com/nothings/stb/master/stb_image.h'),
    zip('https://github.com/ubawurinna/freetype-windows-binaries/archive/refs/tags/v2.11.1.zip'),
    zip(`https://github.com/ii887522/nitro/releases/download/v${nitroVersion}/nitro-${nitroVersion}.zip`),
    file('https://github.com/catchorg/Catch2/releases/download/v2.13.8/catch.hpp')
  ])
  dll('x86', `SDL2-${sdl2Version}/lib/x86/SDL2.dll`)
  dll('x64', `SDL2-${sdl2Version}/lib/x64/SDL2.dll`)
  dll('x86', `SDL2_image-${sdl2ImageVersion}/lib/x86/libpng16-16.dll`)
  dll('x86', `SDL2_image-${sdl2ImageVersion}/lib/x86/SDL2_image.dll`)
  dll('x86', `SDL2_image-${sdl2ImageVersion}/lib/x86/zlib1.dll`)
  dll('x64', `SDL2_image-${sdl2ImageVersion}/lib/x64/libpng16-16.dll`)
  dll('x64', `SDL2_image-${sdl2ImageVersion}/lib/x64/SDL2_image.dll`)
  dll('x64', `SDL2_image-${sdl2ImageVersion}/lib/x64/zlib1.dll`)
  dll('x86', `SDL2_ttf-${sdl2TTFVersion}/lib/x86/SDL2_ttf.dll`)
  dll('x64', `SDL2_ttf-${sdl2TTFVersion}/lib/x64/SDL2_ttf.dll`)
})