Skip to content

Commit 1837c04

Browse files
committed
publish progress
1 parent 8f79351 commit 1837c04

31 files changed

+493
-254
lines changed

Publish.js

Lines changed: 66 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

automation/build/buildBanner.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import manifest from '../../manifest.json' assert { type: 'json' };
2+
3+
export function getBuildBanner(buildType: string, getVersion: (version: string) => string) {
4+
return `/*
5+
-------------------------------------------
6+
${manifest.name} - ${buildType}
7+
-------------------------------------------
8+
By: ${manifest.author} (${manifest.authorUrl})
9+
Time: ${new Date().toUTCString()}
10+
Version: ${getVersion(manifest.version)}
11+
-------------------------------------------
12+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
13+
if you want to view the source, please visit the github repository of this plugin
14+
-------------------------------------------
15+
Copyright (C) ${new Date().getFullYear()} ${manifest.author}
16+
-------------------------------------------
17+
This file is part of Meta Bind.
18+
19+
Meta Bind is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
20+
21+
Meta Bind is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
22+
23+
You should have received a copy of the GNU General Public License along with Meta Bind. If not, see <https://www.gnu.org/licenses/>.
24+
*/
25+
`;
26+
}

esbuild.config.mjs renamed to automation/build/esbuild.config.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,9 @@ import builtins from 'builtin-modules';
22
import esbuild from 'esbuild';
33
import esbuildSvelte from 'esbuild-svelte';
44
import sveltePreprocess from 'svelte-preprocess';
5-
import manifest from './manifest.json' assert { type: 'json' };
5+
import { getBuildBanner } from 'build/buildBanner';
66

7-
const banner = `/*
8-
-------------------------------------------
9-
${manifest.name} - Release Build
10-
-------------------------------------------
11-
By: ${manifest.author} (${manifest.authorUrl})
12-
Time: ${new Date().toUTCString()}
13-
Version: ${manifest.version}
14-
-------------------------------------------
15-
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
16-
if you want to view the source, please visit the github repository of this plugin
17-
*/
18-
`;
7+
const banner = getBuildBanner('Release Build', version => version);
198

209
const build = await esbuild.build({
2110
banner: {
@@ -56,7 +45,7 @@ const build = await esbuild.build({
5645
preprocess: sveltePreprocess(),
5746
filterWarnings: warning => {
5847
// we don't want warnings from node modules that we can do nothing about
59-
return !warning.filename.includes('node_modules');
48+
return !warning.filename?.includes('node_modules');
6049
},
6150
}),
6251
],

esbuild.dev.config.mjs renamed to automation/build/esbuild.dev.config.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,10 @@ import esbuild from 'esbuild';
22
import copy from 'esbuild-plugin-copy-watch';
33
import esbuildSvelte from 'esbuild-svelte';
44
import sveltePreprocess from 'svelte-preprocess';
5-
import manifest from './manifest.json' assert { type: 'json' };
5+
import manifest from '../../manifest.json' assert { type: 'json' };
6+
import { getBuildBanner } from 'build/buildBanner';
67

7-
const banner = `/*
8-
-------------------------------------------
9-
${manifest.name} - Dev Build
10-
-------------------------------------------
11-
By: ${manifest.author} (${manifest.authorUrl})
12-
Time: ${new Date().toUTCString()}
13-
Version: Dev Build
14-
-------------------------------------------
15-
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
16-
if you want to view the source, please visit the github repository of this plugin
17-
*/
18-
`;
8+
const banner = getBuildBanner('Dev Build', _ => 'Dev Build');
199

2010
const context = await esbuild.context({
2111
banner: {
@@ -66,7 +56,7 @@ const context = await esbuild.context({
6656
preprocess: sveltePreprocess(),
6757
filterWarnings: warning => {
6858
// we don't want warnings from node modules that we can do nothing about
69-
return !warning.filename.includes('node_modules');
59+
return !warning.filename?.includes('node_modules');
7060
},
7161
}),
7262
],

esbuild.publish.config.mjs renamed to automation/build/esbuild.publish.config.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ import esbuild from 'esbuild';
33
import esbuildSvelte from 'esbuild-svelte';
44
import process from 'process';
55
import sveltePreprocess from 'svelte-preprocess';
6-
import manifest from './manifest.json' assert { type: 'json' };
6+
import { getBuildBanner } from 'build/buildBanner';
77

8-
const banner = `/*
9-
-------------------------------------------
10-
${manifest.name} - Publish Build (based on ${manifest.version})
11-
-------------------------------------------
12-
By: ${manifest.author} (${manifest.authorUrl})
13-
Time: ${new Date().toUTCString()}
14-
Version: Publish Build (based on ${manifest.version})
15-
-------------------------------------------
16-
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
17-
if you want to view the source, please visit the github repository of this plugin
18-
*/
19-
`;
8+
const banner = getBuildBanner('Publish Release Build', version => `Publish Release Build (based on ${version})`);
209

2110
esbuild
2211
.build({
@@ -68,7 +57,7 @@ esbuild
6857
preprocess: sveltePreprocess(),
6958
filterWarnings: warning => {
7059
// we don't want warnings from node modules that we can do nothing about
71-
return !warning.filename.includes('node_modules');
60+
return !warning.filename?.includes('node_modules');
7261
},
7362
}),
7463
],

esbuild.publish.dev.config.mjs renamed to automation/build/esbuild.publish.dev.config.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ import esbuild from 'esbuild';
33
import esbuildSvelte from 'esbuild-svelte';
44
import process from 'process';
55
import sveltePreprocess from 'svelte-preprocess';
6-
import manifest from './manifest.json' assert { type: 'json' };
6+
import { getBuildBanner } from 'build/buildBanner';
77

8-
const banner = `/*
9-
-------------------------------------------
10-
${manifest.name} - Publish Build (based on ${manifest.version})
11-
-------------------------------------------
12-
By: ${manifest.author} (${manifest.authorUrl})
13-
Time: ${new Date().toUTCString()}
14-
Version: Publish Build (based on ${manifest.version})
15-
-------------------------------------------
16-
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
17-
if you want to view the source, please visit the github repository of this plugin
18-
*/
19-
`;
8+
const banner = getBuildBanner('Publish Dev Build', _ => `Publish Dev Build`);
209

2110
const context = await esbuild
2211
.context({
@@ -57,17 +46,19 @@ const context = await esbuild
5746
logLevel: 'info',
5847
sourcemap: false,
5948
treeShaking: true,
49+
minify: true,
6050
outfile: './Publish.js',
6151
define: {
6252
MB_GLOBAL_CONFIG_DEV_BUILD: 'false',
6353
},
54+
legalComments: 'none',
6455
plugins: [
6556
esbuildSvelte({
6657
compilerOptions: { css: 'injected' },
6758
preprocess: sveltePreprocess(),
6859
filterWarnings: warning => {
6960
// we don't want warnings from node modules that we can do nothing about
70-
return !warning.filename.includes('node_modules');
61+
return !warning.filename?.includes('node_modules');
7162
},
7263
}),
7364
],

automation/installScript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { $, Verboseness } from 'shellUtils';
1+
import { $, Verboseness } from 'utils/shellUtils';
22
import config from './config.json';
33

44
async function installScript() {

automation/release.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { UserError } from 'utils';
2-
import { CanaryVersion, Version, getIncrementOptions, parseVersion, stringifyVersion } from 'versionUtils';
1+
import { UserError } from 'utils/utils';
2+
import { CanaryVersion, Version, getIncrementOptions, parseVersion, stringifyVersion } from 'utils/versionUtils';
33
import config from './config.json';
4-
import { $choice as $choice, $confirm, $seq, CMD_FMT, Verboseness } from './shellUtils';
4+
import { $choice as $choice, $confirm, $seq, CMD_FMT, Verboseness } from 'utils/shellUtils';
55

66
async function runPreconditions(): Promise<void> {
77
// run preconditions
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)