Socket
Socket
Sign inDemoInstall

@bunch-good-drive/good-drive-frontend-components

Package Overview
Dependencies
21
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

compiled_components/index.js

35

compile_scripts/SvelteComponents.js

@@ -19,12 +19,18 @@ /***

(async function() {
const componentSrcPath = path.join(__dirname, "..", "src", "components/");
const componentSrcPath = path.join(__dirname, "..", "src", "components");
const componentDestinationPath = path.join(__dirname, "..", "compiled_components");
function outputPath(filePath) {
const localFilePath = filePath.slice(componentSrcPath.length);
return path.join(__dirname, "..", "compiled_components", localFilePath);
const setExtension = (filePath, newExt) => {
const sliceEnd = -path.extname(filePath).length || undefined;
return filePath.slice(0, sliceEnd) + newExt;
}
const srcPathToDestinationPath = (path) =>
path.replace(componentSrcPath, componentDestinationPath);
const files = await globPromise(path.join(componentSrcPath, "**", "*.svelte"));
console.log('srcpath', componentSrcPath);
console.log('files', files);
for(const file of files) {
console.log('file', file);
//Compile Svelte to bundle

@@ -48,3 +54,3 @@ const bundle = await rollup.rollup({

format: yargs.format || 'iife',
file: outputPath(file).replace(/svelte$/, "js"),
file: setExtension(srcPathToDestinationPath(file), '.js'),
name: path.basename(file, '.svelte'),

@@ -58,12 +64,15 @@ });

const fileImports = files.map((file) => {
const name = path.basename(file, '.svelte');
return {
name,
path: outputPath(file).replace(/svelte$/, "js"),
};
const name = path.basename(file, '.svelte');
const absolutePath = srcPathToDestinationPath(file);
const relativePath = './' + path.relative(componentDestinationPath, absolutePath);
console.log({name, absolutePath, relativePath});
const res = {
name,
path: relativePath,
};
console.log('fileImports', res);
return res;
});
const exportsFolderPath = path.join(__dirname, "..", "exports");
await mkdirp(exportsFolderPath);
await fs.writeFile(path.join(exportsFolderPath, "index.js"), [
await fs.writeFile(path.join(componentDestinationPath, "index.js"), [
...fileImports.map(({ name, path }) => `import ${name} from '${path}';`),

@@ -70,0 +79,0 @@ `export {`,

@@ -1,5 +0,5 @@

import BreadCrumbs from '/home/bladt/repos/deranged/good-drive/svelte/compiled_components/internal/BreadCrumbs.js';
import ClickableText from '/home/bladt/repos/deranged/good-drive/svelte/compiled_components/internal/ClickableText.js';
import FileActions from '/home/bladt/repos/deranged/good-drive/svelte/compiled_components/internal/FileActions.js';
import FolderListing from '/home/bladt/repos/deranged/good-drive/svelte/compiled_components/standalone/FolderListing.js';
import BreadCrumbs from './compiled_components/internal/BreadCrumbs.svelte';
import ClickableText from './compiled_components/internal/ClickableText.svelte';
import FileActions from './compiled_components/internal/FileActions.svelte';
import FolderListing from './compiled_components/standalone/FolderListing.svelte';
export {

@@ -6,0 +6,0 @@ BreadCrumbs,

{
"name": "@bunch-good-drive/good-drive-frontend-components",
"version": "0.2.0",
"version": "0.3.0",
"main": "compiled_components",
"svelte": "exports/index.js",
"scripts": {

@@ -6,0 +7,0 @@ "build": "rollup -c",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc