New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: release-notes-generator run failure #2752
Conversation
Relates to containers#1458 Signed-off-by: Jeff MAURY <jmaury@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the default
but probably replace package.json with build task being
"scripts": {
"build": "vite build"
},
a vite.config.js file with
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/
import {join} from 'path';
import {builtinModules} from 'module';
const PACKAGE_ROOT = __dirname;
/**
* @type {import('vite').UserConfig}
* @see https://vitejs.dev/config/
*/
const config = {
mode: process.env.MODE,
root: PACKAGE_ROOT,
envDir: process.cwd(),
resolve: {
alias: {
'/@/': join(PACKAGE_ROOT, 'src') + '/',
},
},
build: {
sourcemap: 'inline',
target: 'esnext',
outDir: 'dist',
assetsDir: '.',
minify: process.env.MODE === 'production' ? 'esbuild' : false,
lib: {
entry: 'src/release-notes-generator.ts',
formats: ['cjs'],
},
rollupOptions: {
external: [
...builtinModules.flatMap(p => [p, `node:${p}`]),
],
output: {
entryFileNames: '[name].js',
},
},
emptyOutDir: true,
reportCompressedSize: false,
},
};
export default config;
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
@@ -3,10 +3,11 @@ | |||
"version": "1.0.0", | |||
"description": "Generates release notes", | |||
"main": "index.js", | |||
"type": "module", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why you need to use 'module' there ? (and generate a .cjs file instead of a .js file)
you want to avoid the use of a vite.config.js file ?
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Relates to #1458
What does this PR do?
Fixes error while running the release-notes-generator
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
Fixes #1458
How to test this PR?
cd tools
yarn build
node dist/release-notes-generator.js