Skip to content

Commit

Permalink
vx: build single
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Jun 25, 2022
1 parent 7d2185c commit 92c0e70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
run: yarn test
- name: Lint
run: yarn lint
- name: Build Types
run: yarn build --buildSingle
- name: Set npmrc
run: echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ~/.npmrc
env:
Expand Down
19 changes: 6 additions & 13 deletions vx/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ genTsConfig();

const argv = hideBin(process.argv);

const namedOptions = Object.entries({
'--package': 2,
'-p': 2,
});

const defaultPackage = usePackage() ?? insidePackageDir();

const cli = yargs(argv)
Expand All @@ -56,20 +51,18 @@ const cli = yargs(argv)
describe: 'Package to run against',
...(!!defaultPackage && { default: defaultPackage }),
})
.option('buildSingle', {
demandOption: false,
describe: 'build format',
})
.help().argv;

const { package, command } = cli;
const { package, command, buildSingle } = cli;

if (!commands[command]) {
throw new Error(`Command ${command} not found.`);
}

const options = argv.slice(
namedOptions.reduce((count, [option, increment]) => {
return argv.includes(option) ? count + increment : count;
}, 1)
);

logger.info(
joinTruthy([
`Running command ${command}`,
Expand All @@ -79,7 +72,7 @@ logger.info(

ctx.withPackage(package, () =>
commands[command]({
options,
buildSingle,
})
);

Expand Down
6 changes: 0 additions & 6 deletions vx/commands/release.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const commitChangesToGit = require('../scripts/release/steps/commitChangesToGit');

const build = require('vx/commands/build');
const logger = require('vx/logger');
const packagesToRelease = require('vx/scripts/release/packagesToRelease');
const releasePackage = require('vx/scripts/release/releasePackage');
Expand All @@ -20,11 +19,6 @@ function release() {
return;
}

// Start by running a build, we don't really want to build here
// but the types are required for the release script.
// FIXME: We should come back and fix this.
build({ SINGLE: true });

const pkg = usePackage() || targetPackage;
if (pkg) {
return ctx.withPackage(pkg, releasePackage);
Expand Down
4 changes: 2 additions & 2 deletions vx/scripts/build/buildPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ function buildPackage(options = {}) {

cleanupDistFiles(name);
process.env.VX_PACKAGE_NAME = name;
process.env.VX_BUILD_SINGLE = !!options.SINGLE;
process.env.VX_BUILD_SINGLE = !!options.buildSingle;

let builds;

if (options.SINGLE) {
if (options.buildSingle) {
builds = [opts.format.CJS];
} else {
builds = [opts.format.ES, opts.format.UMD, opts.format.CJS];
Expand Down

1 comment on commit 92c0e70

@vercel
Copy link

@vercel vercel bot commented on 92c0e70 Jun 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vest-next – ./website

vest-next-git-latest-ealush.vercel.app
vest-next-ealush.vercel.app
vest-next.vercel.app
vest-website.vercel.app

Please sign in to comment.