Skip to content

Commit

Permalink
chore: execute linking in the root
Browse files Browse the repository at this point in the history
Node_modules dir is hoisted to the root. Previously, the linked package
was added in client but the one hoisted to root was used in build.
  • Loading branch information
barmac committed Oct 17, 2024
1 parent 866e870 commit 5574871
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tasks/link-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const customLinkersMap = {
'bpmn-io/form-js': linkFormJs
};

const clientDir = path.join(__dirname, '..', 'client');
const builderDir = path.join(__dirname, '..');
const dependenciesDir = path.join(__dirname, '.linked-dependencies');

const dependencies = getDependencies();
Expand Down Expand Up @@ -98,7 +98,7 @@ async function linkDependencies(dependencies) {
* @param {Dependency} dependency
*/
function linkFromGitHub({ repo, ref }) {
exec(`npm i ${repo}#${ref}`, { cwd: clientDir });
exec(`npm i ${repo}#${ref}`, { cwd: builderDir });
}

/**
Expand Down Expand Up @@ -129,7 +129,7 @@ function linkDmnJs({ repo, ref }) {
const dmnJsDir = path.join(rootDir, 'packages', 'dmn-js');
exec('yarn link', { cwd: dmnJsDir });

exec('yarn link dmn-js', { cwd: clientDir });
exec('yarn link dmn-js', { cwd: builderDir });
}

/**
Expand All @@ -154,7 +154,7 @@ function linkWithYarn({ repo, ref }) {
const packageJson = path.join(rootDir, 'package.json');
const packageName = getPackageName(packageJson);

exec(`yarn link ${packageName}`, { cwd: clientDir });
exec(`yarn link ${packageName}`, { cwd: builderDir });

console.log(`Linked ${packageName}.`);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ function linkFormJs({ repo, ref }) {
const formJsDir = path.join(rootDir, 'packages', 'form-js');
exec('yarn link', { cwd: formJsDir });

exec('yarn link @bpmn-io/form-js', { cwd: clientDir });
exec('yarn link @bpmn-io/form-js', { cwd: builderDir });
}

function gitClone(repo, target = toDirName(repo)) {
Expand Down

0 comments on commit 5574871

Please sign in to comment.