First commit

This commit is contained in:
2025-12-25 11:16:59 +01:00
commit 0c5ca09a63
720 changed files with 329234 additions and 0 deletions

142
framework/node_modules/fs-extra/index.js generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import fs from "fs";
import path from "path";
import tools from "../../unify/tools.js";
function copyRecursiveSync(src, dest) {
var exists = fs.existsSync(src);
var stats = exists && fs.statSync(src);
var isDirectory = exists && stats.isDirectory();
if (isDirectory) {
fs.mkdirSync(dest);
fs.readdirSync(src).forEach(function(childItemName) {
copyRecursiveSync(path.join(src, childItemName),
path.join(dest, childItemName));
});
} else {
fs.copyFileSync(src, dest);
}
};
const deleteFolderRecursive = function (directoryPath) {
if (fs.existsSync(directoryPath)) {
fs.readdirSync(directoryPath).forEach((file, index) => {
const curPath = path.join(directoryPath, file);
if (fs.lstatSync(curPath).isDirectory()) {
// recurse
deleteFolderRecursive(curPath);
} else {
// delete file
fs.unlinkSync(curPath);
}
});
fs.rmdirSync(directoryPath);
}
};
class fsExtra{
dirLower( parts, partsOriginal, level = 0 ) {
var absolutePath = path.resolve( parts.join("/") );
if ( !fs.existsSync( absolutePath ) ) {
parts.pop();
return this.dirLower( parts, partsOriginal, ++level );
} else {
return level;
}
}
async ensureDirSync( dir ) {
dir = tools.slash( dir );
var parts = dir.split("/")
var partsCopy = parts.slice();
var depth = this.dirLower( parts, parts )
if( depth == 0 ) {
return true;
}
for (var i = 0; i < depth; i++) {
var negative = depth - i - 1;
var pathToDir = partsCopy.slice( 0, partsCopy.length - negative );
fs.mkdirSync(pathToDir.join("/"));
}
}
copyFileSync( source, target ) {
var targetFile = target;
// If target is a directory, a new file with the same name will be created
if ( fs.existsSync( target ) ) {
if ( fs.lstatSync( target ).isDirectory() ) {
targetFile = path.join( target, path.basename( source ) );
}
}
fs.writeFileSync(targetFile, fs.readFileSync(source));
}
copySync( source, target ) {
var isDirectory = fs.lstatSync( source ).isDirectory();
if ( fs.existsSync( target ) ) {
deleteFolderRecursive( target );
}
if( isDirectory ){
copyRecursiveSync( source, target );
} else {
this.copyFileSync( source, target )
}
// console.log("isDirectory", isDirectory);
}
}
var a = new fsExtra();
fs.dirLower = a.dirLower;
fs.ensureDirSync = a.ensureDirSync;
fs.copySync = a.copySync;
export default fs;

5
framework/node_modules/fs-extra/package.json generated vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"type": "module",
"name": "fs-extra",
"main": "./index.js"
}