{"version":3,"sources":["jsdelivr-header.js","/npm/@aptuitiv/website-build-tools@1.35.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;OCAS,QAAS,WAAc,mBACzB,OAAQ,kBACN,YAAe,cACf,kBAAqB,aAGvB,WAAY,yBACV,gBAAmB,uBACnB,cAAiB,qBACjB,eAAkB,sBAClB,eAAkB,sBACpB,kBAAmB,yBACjB,gBAAmB,uBACrB,cAAe,sBACf,uBAAwB,+BACtB,gBAAmB,wBACnB,iBAAoB,wBACpB,qBAAwB,6BACxB,cAAiB,6BACjB,uBAA0B,+BAE/B,YACA,WACA,cACA,oBACG,uBACE,kBAAqB,2BACrB,gBAAiB,cAAiB,wBACpC,iBAAkB,wBAChB,aAAgB,4BAChB,QAAS,WAAY,eAAkB,mBAIhD,MAAM,UAAY,QAAQ,0BAA0B,MAG9C,gBAAkB,GAAG,aAAa,GAAG,0BAGrC,QAAU,IAAI,QACpB,QAAQ,YAAY,gBAAgB,aACpC,QAAQ,QAAQ,gBAAgB,SAGhC,MAAM,iBAAmB,IAAI,OACzB,0BACA,kDAEE,WAAa,IAAI,OACnB,sBACA,kCAQE,SAAW,MAAO,IACpB,MAAM,EAAU,GAAQ,CAAC,QACnB,YAAY,SACZ,WAAW,MAAO,SAClB,YAAY,cACZ,YAAY,SACZ,qBACA,UAAU,UAAW,SACrB,sBACA,WAAW,EAMrB,QACK,QAAQ,SACR,YAAY,6CACZ,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,UAAU,IAGlB,QACK,QAAQ,SACR,YAAY,6CACZ,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,WAAW,MAAK,KACZ,cAAc,GAChB,IAMV,QACK,QAAQ,QACR,YAAY,kDACZ,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,aAAa,IAMrB,QACK,QAAQ,OACR,YAAY,kCACZ,OAAO,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R,YACG,kEAEH,UAAU,YACV,OACG,0BACA,oGAEH,QAAO,MAAO,IACX,mBAAmB,EAAM,UAAU,IAM3C,QACK,QAAQ,kBACR,YACG,kFAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,eAAe,IAMvB,QACK,QAAQ,QACR,YAAY,+DACZ,UAAU,kBACV,UAAU,YACV,eACG,wBACA,6GAEH,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,YAAY,EAAK,IAGzB,QACK,QAAQ,eACR,YACG,gFAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,YAAY,IAEpB,QACK,QAAQ,kBACR,YACG,kFAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,eAAe,IAEvB,QACK,QAAQ,qBACR,YACG,gFAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,iBAAiB,IAMzB,QACK,QAAQ,qBACR,YAAY,4CACZ,OACG,wBACA,2DAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,gBAAgB,EAAK,KAAK,IAGlC,QACK,QAAQ,qBACR,YACG,gFAEH,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,WAAW,IAMnB,QACK,QAAQ,SACR,YAAY,0DACZ,UAAU,kBACV,UAAU,YACV,QAAO,MAAO,UACL,OAAO,KAAK,GAClB,cAAc,IAItB,QAAQ","file":"/npm/@aptuitiv/website-build-tools@1.35.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@aptuitiv/website-build-tools@1.35.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#! /usr/bin/env node\n\n/**\n * npx aptuitiv-build template --pulld\n */\n\nimport { Command, Option } from 'commander';\nimport fs from 'fs-extra';\nimport { dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\n// Build scripts\nimport config from './src/config.js';\nimport { copyHandler } from './src/copy.js';\nimport { aiHandler } from './src/ai.js';\nimport { cssHandler } from './src/css.js';\nimport { envHandler } from './src/env.js';\nimport exportHandler from './src/export.js';\nimport { fontHandler } from './src/font.js';\nimport ftpHander from './src/ftp.js';\nimport gulpConvertHandler from './src/gulp-convert.js';\nimport { iconHandler } from './src/icons.js';\nimport { imageHandler } from './src/image.js';\nimport { initiaizeHandler } from './src/initialize.js';\nimport { jsHandler } from './src/javascript.js';\nimport { packageJsonHandler } from './src/package-json.js';\nimport {\n    pullHandler,\n    pullImages,\n    pullTemplates,\n    pullThemeConfig,\n} from './src/pull.js';\nimport { pushTemplates } from './src/template.js';\nimport { formatThemeJson, pushTheme } from './src/theme.js';\nimport watchHandler from './src/watch.js';\nimport { hasFiles } from './src/lib/files.js';\nimport { logInfo, logMessage, logSuccess } from './src/lib/log.js';\n\n// Get the directory name of the current module\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n// Get the current package.json information\nconst thisPackageJson = fs.readJsonSync(`${__dirname}/package.json`);\n\n// Set up the command line options\nconst program = new Command();\nprogram.description(thisPackageJson.description);\nprogram.version(thisPackageJson.version);\n\n// Set up shared options\nconst configFileOption = new Option(\n    '-c, --config <fileName>',\n    'The configuration file name for aptuitiv-build',\n);\nconst rootOption = new Option(\n    '--root <folderPath>',\n    'The root folder of the project',\n);\n\n/**\n * Run the build process\n *\n * @param {object} args The command line arguments\n */\nconst runBuild = async (args) => {\n    const argsObj = args || {};\n    await copyHandler(argsObj);\n    await cssHandler('css', argsObj);\n    await fontHandler('push');\n    await iconHandler(argsObj);\n    await imageHandler();\n    await jsHandler('process', argsObj);\n    await pushTemplates();\n    await pushTheme();\n};\n\n/**\n * Build and start commands\n */\nprogram\n    .command('build')\n    .description('Build and process all of the source files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        runBuild();\n    });\n\nprogram\n    .command('start')\n    .description('Run the build and start the watch process')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        runBuild().then(() => {\n            watchHandler();\n        });\n    });\n\n/**\n * Copy commands\n */\nprogram\n    .command('copy')\n    .description('Copy files from the source to the build folder')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        copyHandler();\n    });\n\n/**\n * CSS commands\n */\nprogram\n    .command('css')\n    .description('Process and lint the CSS files')\n    .option('-f, --file <filePath>', 'Process a specific file')\n    .option('--no-lint', 'Whether to lint the CSS files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        cssHandler('css', args);\n    });\nprogram\n    .command('stylelint')\n    .description('Lint the CSS files')\n    .alias('css-lint')\n    .alias('csslint')\n    .option(\n        '-p, --path <fileGlob>',\n        'The glob of files to lint. By default it lints all files. If you pass a file glob then only those files will be linted.',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        cssHandler('lint', args);\n    });\n\n/**\n * Environment commands\n */\nprogram\n    .command('env')\n    .description('Set up the environment file')\n    .addOption(rootOption)\n    .action(async (args) => {\n        await envHandler(args);\n    });\n\n/**\n * AI commands\n */\nconst aiCommand = program\n    .command('ai')\n    .description('Commands to set up AI tools');\naiCommand\n    .command('cursor')\n    .description('Copy cursor AI rules to the project')\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        aiHandler(args, 'cursor');\n    });\n\n/**\n * Export command\n */\nprogram\n    .command('export')\n    .description('Export the theme files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        exportHandler();\n    });\n\n/**\n * Font commands\n */\nprogram\n    .command('push-fonts')\n    .description(\n        'Copy the font files from the source directory to the build directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        fontHandler('push');\n    });\nprogram\n    .command('pull-fonts')\n    .description(\n        'Copy the font files from the build directory to the source directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        fontHandler('pull');\n    });\n\n/**\n * FTP commands\n */\nprogram\n    .command('upload')\n    .alias('deploy')\n    .description('Upload a file, a folder, or a glob')\n    .option('-p, --path <filePath>', 'Upload a file, a folder, or a glob')\n    .option('-t --theme', 'Upload all theme files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        ftpHander('upload', args);\n    });\n\nprogram\n    .command('download')\n    .description('Download a file, a folder, or a glob')\n    .option('-p, --path <filePath>', 'Download a file, a folder, or a glob')\n    .option('-t --theme', 'Download all theme files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        ftpHander('download', args);\n    });\n\nprogram\n    .command('delete')\n    .description('Delete a file, a folder, or a glob')\n    .option('-p, --path <filePath>', 'Delete a file, a folder, or a glob')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        ftpHander('delete', args);\n    });\n\n/**\n * Gulp convert command\n */\nprogram\n    .command('gulp-convert')\n    .alias('convert-gulp')\n    .alias('upgrade-gulp')\n    .alias('gulp-upgrade')\n    .description('Convert the old Gulp build process to use the build tools')\n    .option(\n        '-l, --license <license>',\n        'The license for the project. https://docs.npmjs.com/cli/v10/configuring-npm/package-json#license',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        gulpConvertHandler(args);\n    });\n\n/**\n * Icon commands\n */\nprogram\n    .command('icon-sprite')\n    .description('Create an icon sprite')\n    .alias('icons')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .option(\n        '-p, --path <folderPath>',\n        'Path to the icon folder. For example, \"icons\".',\n    )\n    .option(\n        '-o, --output <filePath>',\n        `The path, including the file name,\n        for the output Twig file within the \"templates\" folder. For example, \"snippets/svg-icons.twig\".`,\n    )\n    .action(async (args) => {\n        await config.init(args);\n        iconHandler(args);\n    });\n\n/**\n * Image commands\n */\nprogram\n    .command('images')\n    .description('Optimize the image files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        imageHandler();\n    });\n\n/**\n * Initialize command\n */\nprogram\n    .command('initialize')\n    .alias('init')\n    .description('Initialize the project')\n    .option(\n        '--no-build',\n        'Do not run the build process after initializing the project',\n    )\n    .option('-n, --name <name>', 'The name of the project')\n    .option('-t, --type <name>', 'The type of project')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        const success = await initiaizeHandler(args);\n        if (success) {\n            if (args.build) {\n                if (hasFiles('src')) {\n                    logMessage(\n                        'The project has been initialized. Running the build process.',\n                    );\n                    await runBuild(args);\n                    logSuccess('The build process has completed.');\n                    logInfo(\n                        'You can now run \"npm run watch\" to start the watch process. Or run \"npm run deploy\" to upload files to the server.',\n                    );\n                } else {\n                    logMessage(\n                        'The project has been initialized. You can add your source files to the \"src\" folder.',\n                    );\n                }\n            } else {\n                logMessage(\n                    'The project has been initialized. You can now run \"npm run build\" to build the project.',\n                );\n            }\n        }\n    });\n\n/**\n * Javascript commands\n */\nprogram\n    .command('js')\n    .alias('javascript')\n    .description('Process and lint the Javascript files')\n    .alias('scripts')\n    .option('-f, --file <filePath>', 'Process a specific file')\n    .option('--no-lint', 'Whether to lint the Javascript files')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        jsHandler('process', args);\n    });\nprogram\n    .command('jslint')\n    .description('Lint the Javascript files')\n    .alias('js-lint')\n    .alias('javascript-lint')\n    .alias('scripts-lint')\n    .option(\n        '-p, --path [fileGlob]',\n        'The glob of files to lint. By default it lints all files. If you pass a file glob then only those files will be linted.',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        jsHandler('lint', args);\n    });\n\n/**\n * Package.json command\n */\nconst packageJsonCommand = program\n    .command('package-json')\n    .description('Process the package.json file');\npackageJsonCommand\n    .command('format')\n    .description('Format the package.json file')\n    .addOption(rootOption)\n    .option(\n        '-l, --license <license>',\n        'The license for the project. https://docs.npmjs.com/cli/v10/configuring-npm/package-json#license',\n    )\n    .option(\n        '-t, --theme <themeName>',\n        'Set the theme name. This sets the path to download and upload theme files. Defaults to \"custom\".',\n    )\n    .action(async (args) => {\n        packageJsonHandler(args, 'format');\n    });\n\npackageJsonCommand\n    .command('scripts')\n    .description(\n        'Update the scripts in the package.json to the recommended ones',\n    )\n    .addOption(rootOption)\n    .option(\n        '-t, --theme <themeName>',\n        'Set the theme name. This sets the path to download and upload theme files. Defaults to \"custom\".',\n    )\n    .action(async (args) => {\n        packageJsonHandler(args, 'scripts');\n    });\n\n/**\n * Template related commands\n */\nprogram\n    .command('push-templates')\n    .description(\n        'Push the theme twig templates from the source directory to the build directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        pushTemplates();\n    });\n\n/**\n * Pull commands to pull files from the build directory to the source directory\n */\nprogram\n    .command('pull')\n    .description('Pull files from the build directory to the source directory')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .requiredOption(\n        '-p, --path <filePath>',\n        'The path to the files to pull. For example, \"theme/custom/templates\", \"theme/custom/config\", or \"images\".',\n    )\n    .action(async (args) => {\n        await config.init(args);\n        pullHandler(args);\n    });\n\nprogram\n    .command('pull-images')\n    .description(\n        'Pull the images from the build theme directory to the source theme directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        pullImages();\n    });\nprogram\n    .command('pull-templates')\n    .description(\n        'Pull the theme twig templates from the build directory to the source directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        pullTemplates();\n    });\nprogram\n    .command('pull-theme-config')\n    .description(\n        'Pull the theme config files from the build directory to the source directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        pullThemeConfig();\n    });\n\n/**\n * Theme related commands\n */\nprogram\n    .command('format-theme-json')\n    .description('Format the theme configuration JSON file')\n    .option(\n        '-f, --file <fileName>',\n        'The name of the theme configuration JSON file to format',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        formatThemeJson(args.file);\n    });\n\nprogram\n    .command('push-theme-config')\n    .description(\n        'Push the theme config files from the source directory to the build directory',\n    )\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        pushTheme();\n    });\n\n/**\n * Watch command\n */\nprogram\n    .command('watch')\n    .description('Watch the source files and process them as they change')\n    .addOption(configFileOption)\n    .addOption(rootOption)\n    .action(async (args) => {\n        await config.init(args);\n        watchHandler();\n    });\n\n// Parse the command line arguments\nprogram.parse();\n"]}