Skip to content

Commit

Permalink
refactor(build): fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko committed Jan 13, 2023
1 parent c199607 commit 8f2bb36
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 41 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"lint:types": "tsc",
"lint:eslint": "eslint packages",
"lint:all": "yarn lint:eslint && yarn lint:types",
"release:build": "node -r @swc-node/register ./scripts/build/index.ts",
"release:test": "node ./scripts/test.js",
"release:build": "node -r @swc-node/register ./scripts/build/index.ts",
"release:test": "node -r @swc-node/register ./scripts/test.ts",
"version:next": "lerna version --exact --force-publish --no-private --preid next --create-release github --conventional-commits --conventional-prerelease --yes",
"version:latest": "lerna version --exact --force-publish --no-private --create-release github --conventional-commits --yes",
"release:latest": "lerna publish from-package --contents build --dist-tag latest --yes",
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/dev/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions packages/core/src/dev/loadLocaleData.test.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/core/src/dev/loadLocaleData.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/core/src/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { interpolate, UNICODE_REGEX } from "./context"
import { isString, isFunction } from "./essentials"
import { date, number } from "./formats"
import * as icu from "./dev"
import { compileMessage } from "./compile"
import { EventEmitter } from "./eventEmitter"
import type {PluralCategory} from "make-plural"

Expand Down Expand Up @@ -206,7 +206,7 @@ export class I18n extends EventEmitter<Events> {

if (process.env.NODE_ENV !== "production") {
translation = isString(translation)
? icu.compile(translation)
? compileMessage(translation)
: translation
}

Expand Down
11 changes: 6 additions & 5 deletions scripts/test.js → scripts/test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const argv = require("minimist")(process.argv.slice(2))

const fs = require("fs")
const path = require("path")
const { execSync } = require("child_process")
import * as fs from "fs"
import * as path from "path"
import {execSync} from "child_process"

const chalk = require("chalk")
const ora = require("ora")

const EXAMPLES_DIR = path.resolve("examples")

function listDirs(dir) {
function listDirs(dir: string) {
return fs
.readdirSync(dir)
.filter(dirname => fs.lstatSync(path.join(dir, dirname)).isDirectory())
Expand All @@ -26,7 +27,7 @@ const logHeading = message => console.log(chalk.bold("\n" + message + "\n"))

if (!argv["skip-build"]) {
logHeading("Build packages")
execSync("node scripts/build", { stdio: "inherit" })
execSync("yarn release:build", { stdio: "inherit" })
}

// TODO: Replace yalc with verdaccio
Expand Down

0 comments on commit 8f2bb36

Please sign in to comment.