Skip to content

Commit 2bc724e

Browse files
committed
vx: build single
1 parent 7d2185c commit 2bc724e

File tree

4 files changed

+10
-21
lines changed

4 files changed

+10
-21
lines changed

.github/workflows/integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
run: yarn test
3333
- name: Lint
3434
run: yarn lint
35+
- name: Build Types
36+
run: yarn build --buildSingle
3537
- name: Set npmrc
3638
run: echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > ~/.npmrc
3739
env:

vx/cli.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ genTsConfig();
3434

3535
const argv = hideBin(process.argv);
3636

37-
const namedOptions = Object.entries({
38-
'--package': 2,
39-
'-p': 2,
40-
});
41-
4237
const defaultPackage = usePackage() ?? insidePackageDir();
4338

4439
const cli = yargs(argv)
@@ -56,20 +51,18 @@ const cli = yargs(argv)
5651
describe: 'Package to run against',
5752
...(!!defaultPackage && { default: defaultPackage }),
5853
})
54+
.option('buildSingle', {
55+
demandOption: false,
56+
describe: 'build format',
57+
})
5958
.help().argv;
6059

61-
const { package, command } = cli;
60+
const { package, command, buildSingle } = cli;
6261

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

67-
const options = argv.slice(
68-
namedOptions.reduce((count, [option, increment]) => {
69-
return argv.includes(option) ? count + increment : count;
70-
}, 1)
71-
);
72-
7366
logger.info(
7467
joinTruthy([
7568
`Running command ${command}`,
@@ -79,7 +72,7 @@ logger.info(
7972

8073
ctx.withPackage(package, () =>
8174
commands[command]({
82-
options,
75+
buildSingle,
8376
})
8477
);
8578

vx/commands/release.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const commitChangesToGit = require('../scripts/release/steps/commitChangesToGit');
22

3-
const build = require('vx/commands/build');
43
const logger = require('vx/logger');
54
const packagesToRelease = require('vx/scripts/release/packagesToRelease');
65
const releasePackage = require('vx/scripts/release/releasePackage');
@@ -20,11 +19,6 @@ function release() {
2019
return;
2120
}
2221

23-
// Start by running a build, we don't really want to build here
24-
// but the types are required for the release script.
25-
// FIXME: We should come back and fix this.
26-
build({ SINGLE: true });
27-
2822
const pkg = usePackage() || targetPackage;
2923
if (pkg) {
3024
return ctx.withPackage(pkg, releasePackage);

vx/scripts/build/buildPackage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ function buildPackage(options = {}) {
1212

1313
cleanupDistFiles(name);
1414
process.env.VX_PACKAGE_NAME = name;
15-
process.env.VX_BUILD_SINGLE = !!options.SINGLE;
15+
process.env.VX_BUILD_SINGLE = !!options.SINGLE || !!options.buildSingle;
1616

1717
let builds;
1818

19-
if (options.SINGLE) {
19+
if (process.env.VX_BUILD_SINGLE) {
2020
builds = [opts.format.CJS];
2121
} else {
2222
builds = [opts.format.ES, opts.format.UMD, opts.format.CJS];

0 commit comments

Comments
 (0)