Skip to content

Commit

Permalink
fix: export build-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jul 24, 2024
1 parent 5758dba commit d9d7b14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ These commands stay as shortcuts/aliases (they kind of make sense there, as they
yarn bt => yarn dev-lib bt
yarn btl => yarn dev-lib lbt # lbt reflects the order: lint-build-test
yarn build => gone, no replacement
yarn build-copy => gone, no replacement
yarn build-copy => yarn dev-lib build-copy
yarn tsc-prod, tsc-scripts => gone, no replacement
yarn build-prod => yarn dev-lib build
yarn build-prod-esm-cjs => yarn dev-lib build-esm-cjs
Expand Down
8 changes: 7 additions & 1 deletion src/bin/dev-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import os from 'node:os'
import { select, Separator } from '@inquirer/prompts'
import { _assert, _by, PromisableFunction } from '@naturalcycles/js-lib'
import { dimGrey, runScript } from '@naturalcycles/nodejs-lib'
import { buildEsmCjs, buildProd, runTSCInFolders } from '../build.util'
import { buildCopy, buildEsmCjs, buildProd, runTSCInFolders } from '../build.util'
import {
eslintAll,
lintAllCommand,
Expand Down Expand Up @@ -32,6 +32,12 @@ const commands: (Command | Separator)[] = [
desc: 'Clean ./dist, run "build-copy" then tsc with emit, using tsconfig.prod.json',
cliOnly: true,
},
{
name: 'build-copy',
fn: buildCopy,
desc: 'Copy the non-ts files from ./src to ./dist',
cliOnly: true,
},
{
name: 'build-esm-cjs',
fn: buildEsmCjs,
Expand Down
2 changes: 1 addition & 1 deletion src/build.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function runTSCProd(): Promise<void> {
console.log(`${boldGrey('tsc prod')} ${dimGrey(`took ` + _since(started))}`)
}

function buildCopy(): void {
export function buildCopy(): void {
const baseDir = 'src'
const inputPatterns = [
'**',
Expand Down

0 comments on commit d9d7b14

Please sign in to comment.