Skip to content

Commit

Permalink
attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
mayarajan3 committed Oct 1, 2024
1 parent c3137ab commit 5065564
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
[submodule "scratch-packages/scratch-vm"]
path = scratch-packages/scratch-vm
url = git@github.com:mitmedialab/prg-raise-playground-scratch-vm.git
branch = main
branch = main
[submodule "scratch-packages/scratch-blocks"]
path = scratch-packages/scratch-blocks
url = git@github.com:gonfunko/scratch-blocks.git
branch = blockly-changes
6 changes: 6 additions & 0 deletions extensions/paths.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
],
"$scratch-vm/*": [
"../scratch-packages/scratch-vm/src/*"
],
"$scratch-blocks": [
"../scratch-packages/scratch-blocks/src"
],
"$scratch-blocks/*": [
"../scratch-packages/scratch-blocks/src/*"
]
}
}
Expand Down
6 changes: 4 additions & 2 deletions extensions/scripts/utils/aliases.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import fs from "fs";

import { vmSrc } from "$root/scripts/paths";
import { vmSrc, blocksSrc } from "$root/scripts/paths";
import { commonDirectory } from "./fileSystem";

export const commonAlias = "$common";
export const scratchVmAlias = "$scratch-vm";
export const scratchBlocksAlias = "$scratch-blocks"

const getCommonAliasEntry = () => getAlias(commonDirectory, commonAlias);
const getScratchVmAliasEntry = () => getAlias(vmSrc, scratchVmAlias);
const getScratchBlocksAliasEntry = () => getAlias(blocksSrc, scratchBlocksAlias);

const getAlias = (location: string, alias: string) => {
if (!fs.existsSync(location)) throw new Error(`Could not form alias '${alias}' because location didn't exist: ${location}`);
return { [alias]: location };
}

export const getAliasEntries = () => ({ ...getCommonAliasEntry(), ...getScratchVmAliasEntry() });
export const getAliasEntries = () => ({ ...getCommonAliasEntry(), ...getScratchVmAliasEntry(), ...getScratchBlocksAliasEntry() });
1 change: 1 addition & 0 deletions scratch-packages/scratch-blocks
Submodule scratch-blocks added at 6d1453
2 changes: 2 additions & 0 deletions scripts/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const getPackage = (name: string) => path.join(root, "scratch-packages", `scratc
export const scratchPackages = {
gui: getPackage("gui"),
vm: getPackage("vm"),
blocks: getPackage("blocks")
}

export const vmSrc = path.join(scratchPackages.vm, "src");
export const guiSrc = path.join(scratchPackages.gui, "src");
export const blocksSrc = path.join(scratchPackages.blocks, "src");
export const extensionsFolder = path.join(root, "extensions");


Expand Down

0 comments on commit 5065564

Please sign in to comment.