Skip to content

Commit

Permalink
Added other package managers for the publish flow
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPshul committed Nov 7, 2024
1 parent a24885f commit 9c230fb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions packages/func/src/executors/publish/executor.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import { Executor } from '@nx/devkit';
import { detectPackageManager, Executor, getPackageManagerCommand } from '@nx/devkit';
import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
import { build } from '../common';
import { PublishExecutorSchema } from './schema';

const getInstallCommand = () => {
const rawInstallCommand = getPackageManagerCommand().install;

const packageManager = detectPackageManager();
return packageManager === 'pnpm' ? `${rawInstallCommand} --node-linker=hoisted` : rawInstallCommand;
};

const executor: Executor<PublishExecutorSchema> = async (options, context) => {
const success = await build(context);

if (success) {
const { projectName, projectsConfigurations, isVerbose, target } = context;

const { name, additionalFlags } = options;
const installCommand = 'npm i';
const installCommand = getInstallCommand();
if (isVerbose) {
console.log(`Running ${target.executor} command: ${installCommand}.`);
}
Expand Down

0 comments on commit 9c230fb

Please sign in to comment.