migrate build scripts to esmodules (#17071)
* chore: migrate build scripts to esmodules * chore: do not use export default in build script
This commit is contained in:
parent
f6fc78f578
commit
38b3eecc8c
|
|
@ -23,7 +23,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"compile-config": "cd packages/backend && pnpm compile-config",
|
||||
"build-pre": "node ./scripts/build-pre.js",
|
||||
"build-pre": "node scripts/build-pre.mjs",
|
||||
"build-assets": "node ./scripts/build-assets.mjs",
|
||||
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
|
||||
"build-storybook": "pnpm --filter frontend build-storybook",
|
||||
|
|
@ -48,8 +48,8 @@
|
|||
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
|
||||
"test": "pnpm -r test",
|
||||
"test-and-coverage": "pnpm -r test-and-coverage",
|
||||
"clean": "node ./scripts/clean.js",
|
||||
"clean-all": "node ./scripts/clean-all.js",
|
||||
"clean": "node scripts/clean.mjs",
|
||||
"clean-all": "node scripts/clean-all.mjs",
|
||||
"cleanall": "pnpm clean-all"
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import * as fs from 'node:fs/promises';
|
|||
import * as path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as yaml from 'js-yaml';
|
||||
import buildTarball from './tarball.mjs';
|
||||
import { buildTarball } from './tarball.mjs';
|
||||
|
||||
const configDir = fileURLToPath(new URL('../.config', import.meta.url));
|
||||
const configPath = process.env.MISSKEY_CONFIG_YML
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
import * as fs from 'node:fs';
|
||||
|
||||
const __dirname = import.meta.dirname;
|
||||
|
||||
const packageJsonPath = __dirname + '/../package.json'
|
||||
|
||||
function build() {
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
import { execSync } from 'note:child_process';
|
||||
import * as fs from 'note:fs';
|
||||
|
||||
const __dirname = import.meta.dirname;
|
||||
|
||||
(async () => {
|
||||
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
||||
|
|
@ -3,7 +3,9 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
import * as fs from 'note:fs';
|
||||
|
||||
const __dirname = import.meta.dirname;
|
||||
|
||||
(async () => {
|
||||
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
||||
|
|
@ -19,7 +19,7 @@ const ignore = [
|
|||
// Exclude files you don't want to include in the tarball here
|
||||
];
|
||||
|
||||
export default async function build() {
|
||||
export async function buildTarball() {
|
||||
const mkdirPromise = mkdir(resolve(cwd, 'built', 'tarball'), { recursive: true });
|
||||
const pack = new Pack({ cwd, gzip: true });
|
||||
const patterns = await walk({ path: cwd, ignoreFiles: ['.gitignore'] });
|
||||
|
|
|
|||
Loading…
Reference in New Issue