build: pack on build-assets
This commit is contained in:
parent
c27eba4d39
commit
30224a8474
|
@ -12,6 +12,7 @@ import * as terser from 'terser';
|
|||
import { build as buildLocales } from '../locales/index.js';
|
||||
import generateDTS from '../locales/generateDTS.js';
|
||||
import meta from '../package.json' assert { type: "json" };
|
||||
import buildTarball from './tarball.mjs';
|
||||
|
||||
let locales = buildLocales();
|
||||
|
||||
|
@ -77,12 +78,13 @@ async function build() {
|
|||
copyBackendViews(),
|
||||
buildBackendScript(),
|
||||
buildBackendStyle(),
|
||||
buildTarball(),
|
||||
]);
|
||||
}
|
||||
|
||||
await build();
|
||||
|
||||
if (process.argv.includes("--watch")) {
|
||||
if (process.argv.includes('--watch')) {
|
||||
const watcher = fs.watch('./locales');
|
||||
for await (const event of watcher) {
|
||||
const filename = event.filename?.replaceAll('\\', '/');
|
||||
|
|
|
@ -6,8 +6,6 @@ import glob from 'fast-glob';
|
|||
import Pack from 'tar/lib/pack.js';
|
||||
import meta from '../package.json' assert { type: "json" };
|
||||
|
||||
const cwd = fileURLToPath(new URL('..', import.meta.url));
|
||||
const mkdirPromise = mkdir(resolve(cwd, 'built', 'tarball'), { recursive: true });
|
||||
const patterns = [
|
||||
'{assets,fluent-emojis,locales,misskey-assets}/**/*',
|
||||
'packages/.config/example.yml',
|
||||
|
@ -29,14 +27,19 @@ const patterns = [
|
|||
'pnpm-lock.yaml',
|
||||
'pnpm-workspace.yaml',
|
||||
];
|
||||
const pack = new Pack({ cwd, gzip: true });
|
||||
|
||||
for await (const entry of glob.stream(patterns)) {
|
||||
pack.add(entry);
|
||||
export default async function build() {
|
||||
const cwd = fileURLToPath(new URL('..', import.meta.url));
|
||||
const mkdirPromise = mkdir(resolve(cwd, 'built', 'tarball'), { recursive: true });
|
||||
const pack = new Pack({ cwd, gzip: true });
|
||||
|
||||
for await (const entry of glob.stream(patterns)) {
|
||||
pack.add(entry);
|
||||
}
|
||||
|
||||
pack.end();
|
||||
|
||||
await mkdirPromise;
|
||||
|
||||
pack.pipe(createWriteStream(resolve(cwd, 'built', 'tarball', `misskey-${meta.version}.tar.gz`)));
|
||||
}
|
||||
|
||||
pack.end();
|
||||
|
||||
await mkdirPromise;
|
||||
|
||||
pack.pipe(createWriteStream(resolve(cwd, 'built', 'tarball', `misskey-${meta.version}.tar.gz`)));
|
||||
|
|
Loading…
Reference in New Issue