Skip to content

Commit

Permalink
Codebase Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
shoaib-jamal committed Mar 20, 2024
1 parent 83100b4 commit d74e865
Show file tree
Hide file tree
Showing 5,506 changed files with 1,245,253 additions and 8,515 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@

.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
.npmrc
!.env.example
.vscode/
build.zip
win32_rsa
win32_rsa.pub
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

Binary file removed boot/assets/logo.png
Binary file not shown.
Binary file removed boot/assets/logon.jpg
Binary file not shown.
Binary file removed boot/assets/progress.gif
Binary file not shown.
Binary file removed boot/assets/socks.png
Binary file not shown.
Binary file removed boot/assets/startup.wav
Binary file not shown.
Binary file removed boot/assets/welcome.png
Binary file not shown.
51 changes: 0 additions & 51 deletions boot/boot.css

This file was deleted.

37 changes: 0 additions & 37 deletions boot/boot.js

This file was deleted.

156 changes: 0 additions & 156 deletions boot/load.js

This file was deleted.

58 changes: 58 additions & 0 deletions gen/assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import path from 'path';
import dir from 'node-dir';
import fs from 'fs';

let excluded_source_files = ['src/routes/xp/starting.svelte'];

let source_files = [
...dir.files('./src/', {sync: true}),
'static/json/hard_drive.json',
'svelte.config.js',
'tailwind.config.cjs',
'vite.config.js'
]
.filter(el => ['.js', '.json', '.svelte', '.css', '.cjs', '.html'].includes(path.extname(el)))
.filter(el => !excluded_source_files.includes(el));


(async () => {

let remote_files = dir.files('./static/files/', {sync: true})
.filter(file => ['.png', '.jpg', '.mp3'].includes(path.extname(file)))
.filter(file => included(file))
.map(file => file.replace(/^static/i, ''));

let images = dir.files('./static/images/', {sync: true})
.filter(file => ['.png', '.jpg', '.svg', '.gif'].includes(path.extname(file)))
.filter(file => included(file))
.map(file => file.replace(/^static/i, ''));

let fonts = dir.files('./static/fonts/', {sync: true})
.filter(file => ['.ttf'].includes(path.extname(file)))
.filter(file => included(file))
.map(file => file.replace(/^static/i, ''));

let audios = dir.files('./static/audio/', {sync: true})
.filter(file => ['.mp3', '.wav'].includes(path.extname(file)))
.filter(file => included(file))
.map(file => file.replace(/^static/i, ''));

let empties = dir.files('./static/empty/', {sync: true})
.filter(file => included(file))
.map(file => file.replace(/^static/i, ''));


let assets = {remote_files, images, audios, fonts, empties};
for(let key of Object.keys(assets)){
console.log('let ' + key + ' = ' + JSON.stringify(assets[key]) + ';\n');
}
})()

function included(asset){
let basename = path.basename(asset);
for(let file of source_files){
let content = fs.readFileSync(file, 'utf-8');
if(content.includes(basename)) return true;
}
return false;
}
16 changes: 16 additions & 0 deletions gen/imports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import path from 'path';
import dir from 'node-dir';

(async () => {
let files = dir.files('./src/routes/', {sync: true}).filter(file => path.extname(file) == '.svelte');
let statements = '';
for(let file of files){
let import_path = file.split('src/routes/').join('./')
statements = statements + `
else if(url == '${import_path}'){
page = (await import('${import_path}')).default;
}`
}
console.log(statements);
})()
39 changes: 0 additions & 39 deletions index.html

This file was deleted.

Loading

0 comments on commit d74e865

Please sign in to comment.