Skip to content

Commit

Permalink
infra: made dev version explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
shairez committed Jul 26, 2024
1 parent c74da62 commit 40d2e0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
27 changes: 13 additions & 14 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { type BuildConfig, ensureDir, panic } from './util';
import { rmSync } from 'fs';
import { copyFile, watch } from 'fs/promises';
import { join } from 'path';
import { apiExtractorQwik, apiExtractorQwikCity } from './api';
import { buildPlatformBinding, copyPlatformBindingWasm } from './binding-platform';
import { buildWasmBinding } from './binding-wasm';
import { buildCreateQwikCli } from './create-qwik-cli';
import { buildEslint } from './eslint';
import { buildPlatformBinding, copyPlatformBindingWasm } from './binding-platform';
import { buildQwikAuth } from './qwik-auth';
import { buildQwikCity } from './qwik-city';
import { buildQwikLabs } from './qwik-labs';
import { buildQwikReact } from './qwik-react';
import { buildWasmBinding } from './binding-wasm';
import { emptyDir } from './util';
import { buildQwikWorker } from './qwik-worker';
import {
commitPrepareReleaseVersion,
prepareReleaseVersion,
publish,
setDevVersion,
setDistVersion,
setReleaseVersion,
} from './release';
import { submoduleBuild } from './submodule-build';
Expand All @@ -22,16 +26,11 @@ import { submoduleQwikLoader } from './submodule-qwikloader';
import { submoduleQwikPrefetch } from './submodule-qwikprefetch';
import { submoduleServer } from './submodule-server';
import { submoduleTesting } from './submodule-testing';
import { buildSupabaseAuthHelpers } from './supabase-auth-helpers';
import { tsc, tscQwik, tscQwikCity } from './tsc';
import { tscDocs } from './tsc-docs';
import { type BuildConfig, emptyDir, ensureDir, panic } from './util';
import { validateBuild } from './validate-build';
import { buildQwikAuth } from './qwik-auth';
import { buildSupabaseAuthHelpers } from './supabase-auth-helpers';
import { buildQwikWorker } from './qwik-worker';
import { buildQwikLabs } from './qwik-labs';
import { watch, copyFile } from 'fs/promises';
import { join } from 'path';
import { rmSync } from 'fs';

/**
* Complete a full build for all of the package's submodules. Passed in config has all the correct
Expand All @@ -49,8 +48,8 @@ export async function build(config: BuildConfig) {
// ci release, npm publish
await setReleaseVersion(config);
} else {
// local build or ci commit that's not for publishing
await setDevVersion(config);
// local build or dev build
await setDistVersion(config);
}

console.log(
Expand Down
14 changes: 7 additions & 7 deletions scripts/release.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type BuildConfig, panic, run } from './util';
import { Octokit } from '@octokit/action';
import { execa } from 'execa';
import { join, resolve } from 'node:path';
import { Octokit } from '@octokit/action';
import { fileURLToPath } from 'node:url';
import prompts from 'prompts';
import { readPackageJson, writePackageJson } from './package-json';
import semver from 'semver';
import { validateBuild } from './validate-build';
import { publishCreateQwikCli } from './create-qwik-cli';
import { publishEslint } from './eslint';
import { fileURLToPath } from 'node:url';
import { readPackageJson, writePackageJson } from './package-json';
import { type BuildConfig, panic, run } from './util';
import { validateBuild } from './validate-build';

let version: string;

Expand All @@ -18,7 +18,7 @@ export async function getVersion(distTag?: string, rootDir?: string) {
rootDir ||= resolve(__dirname, '..');
const rootPkg = await readPackageJson(rootDir);
let v = rootPkg.version;
if (!distTag || distTag === 'dev') {
if (distTag === 'dev') {
const d = new Date();
v += '-dev';
v += String(d.getUTCFullYear());
Expand All @@ -32,7 +32,7 @@ export async function getVersion(distTag?: string, rootDir?: string) {
}
return version;
}
export async function setDevVersion(config: BuildConfig) {
export async function setDistVersion(config: BuildConfig) {
config.distVersion = await getVersion(config.setDistTag, config.rootDir);
}

Expand Down

0 comments on commit 40d2e0e

Please sign in to comment.