Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Clean Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Oct 12, 2023
1 parent a947b79 commit 4f24b1f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
2 changes: 0 additions & 2 deletions scripts/compiler/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ async function run() {

const promises = filesToTranspile.map((file) => transpileFile(file));
await Promise.all(promises);

console.log(`Compiled: ${filesToTranspile.length} || Copied: ${filesToCopy.length}`);
}

run();
1 change: 0 additions & 1 deletion scripts/plugins/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function run() {

writeServerImports(serverImports);
writeClientImports(clientImports);
console.log(`Plugin(s): ${enabledPlugins.length}`);
}

run();
1 change: 0 additions & 1 deletion scripts/plugins/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function moveAssetsToWebview(folderName, extensions) {
const filePath = allFiles[i];
const regExp = new RegExp(`.*\/${folderName}\/`);
const finalPath = sanitizePath(filePath.replace(regExp, `src-webviews/public/plugins/`));
console.log(finalPath);
const folderPath = sanitizePath(path.dirname(finalPath));
if (!fs.existsSync(folderPath)) {
fs.mkdirSync(folderPath, { recursive: true });
Expand Down
22 changes: 10 additions & 12 deletions scripts/plugins/update-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { globSync } from '../shared/fileHelpers.js';

const viablePluginDisablers = ['disable.plugin', 'disabled.plugin', 'disable'];

let dependencies = [];
let devDependencies = [];

function getInstalledDependencies() {
const packageJsonPath = sanitizePath(path.join(process.cwd(), 'package.json'));

Expand All @@ -17,38 +20,34 @@ function getInstalledDependencies() {
process.exit(1);
}

const dependencies = [];
for (const dependency in contents.dependencies) {
dependencies.push(dependency);
}

const devDependencies = [];
for (const dependency in contents.devDependencies) {
devDependencies.push(dependency);
}

return { dependencies, devDependencies };
}

function getPluginDependencies(pluginName) {
const pluginPath = sanitizePath(path.join(process.cwd(), 'src/core/plugins', pluginName));

const dependencies = {
const pluginDependencies = {
dependencies: [],
devDependencies: [],
};

for (const disabler of viablePluginDisablers) {
const disabledPath = sanitizePath(path.join(pluginPath, disabler));
if (fs.existsSync(disabledPath)) {
return dependencies;
return pluginDependencies;
}
}

const dependencyPath = sanitizePath(path.join(pluginPath, 'dependencies.json'));

if (!fs.existsSync(dependencyPath)) {
return dependencies;
return pluginDependencies;
}

let contents;
Expand All @@ -60,22 +59,21 @@ function getPluginDependencies(pluginName) {
}

if (!contents) {
return dependencies;
return pluginDependencies;
}

for (const name of contents.dependencies ?? []) {
dependencies.dependencies.push(name);
pluginDependencies.dependencies.push(name);
}

for (const name of contents.devDependencies ?? []) {
dependencies.devDependencies.push(name);
pluginDependencies.devDependencies.push(name);
}

return dependencies;
return pluginDependencies;
}

function checkPluginDependencies() {
const installedDependencies = getInstalledDependencies();
const plugins = globSync(sanitizePath(path.join(process.cwd(), 'src/core/plugins/*')));

const missingDepdendencies = [];
Expand Down
17 changes: 15 additions & 2 deletions scripts/runtime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,15 @@ async function handleViteDevServer() {
await runFile(node, './scripts/plugins/webview.js');
lastViteServer = spawn(
npx,
['vite', './src-webviews', '--clearScreen=false', '--debug=true', '--host=localhost', '--port=3000'],
[
'vite',
'./src-webviews',
'--clearScreen=false',
'--debug=true',
'--host=localhost',
'--port=3000',
'--logLevel=silent',
],
{
stdio: 'inherit',
},
Expand All @@ -132,6 +140,10 @@ async function handleViteDevServer() {
console.log(`Vite process exited with code ${code}`);
});

lastViteServer.on('spawn', () => {
console.log(`>>> Vue Pages Server: https://localhost:3000`);
});

return await new Promise((resolve) => {
setTimeout(resolve, 2000);
});
Expand Down Expand Up @@ -244,8 +256,9 @@ async function coreBuildProcess() {
await Promise.all(promises);
mixedTime.stop();

const transformTime = createExecTime('>>> transform-time');
await runFile(node, './scripts/transform/index');
console.log(`Build Time - ${Date.now() - start}ms`);
transformTime.stop();
}

async function devMode(firstRun = false) {
Expand Down

0 comments on commit 4f24b1f

Please sign in to comment.