Compare commits

...

10 commits

Author SHA1 Message Date
36414468dc 0.11.0 2024-06-10 03:17:09 +00:00
90f80a8ecd Perhaps I should add some kinda linter. 2024-06-10 03:17:04 +00:00
5f7df9e5b0 0.10.0 2024-06-10 03:03:31 +00:00
338b200246 Imagine knowing how your own tools work. 2024-06-10 03:03:24 +00:00
11bed96f9d 0.9.0 2024-06-10 03:01:05 +00:00
4d7162fea1 oh yeah right duh 2024-06-10 03:01:00 +00:00
d0c17dc7f2 0.8.0 2024-06-10 02:59:19 +00:00
299150e57a Added hasOwnProperty check. 2024-06-10 02:59:12 +00:00
e4871feca2 0.7.0 2024-06-10 02:50:59 +00:00
69d4572635 hurr 2024-06-10 02:50:56 +00:00
6 changed files with 15 additions and 9 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "@flashwave/assproc",
"version": "0.6.0",
"version": "0.11.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@flashwave/assproc",
"version": "0.6.0",
"version": "0.11.0",
"license": "BSD-3-Clause",
"dependencies": {
"@swc/core": "^1.5.25",

View file

@ -1,6 +1,6 @@
{
"name": "@flashwave/assproc",
"version": "0.6.0",
"version": "0.11.0",
"description": "Personal frontend asset processing tool",
"main": "./src/index.js",
"scripts": {

View file

@ -27,7 +27,7 @@ module.exports = function(env) {
return {
process: async (task, vars) => {
const srcPath = path.join(env.source, task.source);
const srcPath = pathJoin(env.source, task.source);
const output = await pcss.process(
await combine.folder(srcPath, {

View file

@ -22,16 +22,16 @@ module.exports = function(env) {
return {
process: async (task, vars) => {
let { stdout, stderr } = await exec(strtr(env.twig?.cmdFormat ?? ':command :path', {
':command': env.twig?.cmdPathFull ?? pathJoin(env.root, env.twig?.cmdPath ?? 'tools/render-tpl'),
':path': task.source,
let { stdout, stderr } = await exec(strtr(env.twig?.cmdFormat ?? '{command} {path}', {
'command': env.twig?.cmdPathFull ?? pathJoin(env.root, env.twig?.cmdPath ?? 'tools/render-tpl'),
'path': task.source,
}));
if(stdout.trim() === '')
throw stderr;
if(!env.debug)
stdout = await htmlminify(stdout, htmlMinifyOptions);
stdout = await htmlminify(stdout, MINIFY_OPTS);
const path = pathJoin(
task.target ?? '',

View file

@ -11,7 +11,7 @@ module.exports = function(env) {
body = { ...body, ...task.body };
if(typeof task.icons === 'string') {
const iconsDir = path.join(env.public, task.icons);
const iconsDir = pathJoin(env.public, task.icons);
if(fs.existsSync(iconsDir)) {
const files = (await fs.promises.readdir(iconsDir)).sort((a, b) => a.localeCompare(b, undefined, {

View file

@ -33,9 +33,15 @@ module.exports.process = async (env, tasks) => {
const files = {};
for(const type of order) {
if(!types.hasOwnProperty(type))
continue;
if(!(type in types))
throw `${type} is not a supported build task type`;
if(!(type in tasks))
continue;
const typeTasks = tasks[type];
if(!Array.isArray(typeTasks))
throw 'children of the tasks object must be arrays';