Skip to content

Commit

Permalink
build: license banner
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Aug 28, 2024
1 parent 67f14f7 commit e5ed66a
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ src/lib/*

public
build

rollup.config-*.cjs
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bilibili-local-player-h5",
"version": "2.0.0",
"version": "2.1.0",
"description": "bilibili-local-player-h5",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -54,6 +54,7 @@
"node-html-parser": "^6.1.13",
"onchange": "^7.1.0",
"rollup": "^4.18.1",
"rollup-plugin-license": "^3.5.2",
"sass": "^1.77.8",
"terser": "^5.31.2",
"tslib": "^2.6.3",
Expand Down
108 changes: 108 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import typescript from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
const license = require('rollup-plugin-license');
const { version, srcPath } = require('./scripts/utils.cjs');
const { javascript: terserOptions } = require('./scripts/terser.config.cjs');

const dev = process.env.NODE_ENV !== 'production';
const ver = version();

const ccl = '../lib/CommentCoreLibrary.js';

Expand Down Expand Up @@ -32,8 +34,21 @@ export default [
// (!) [plugin replace] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
preventAssignment: true,
values: {
// _version_: `JSON.parse('${JSON.stringify(version())}');`,
_version_: JSON.stringify(version()) + ';',
// _version_: `JSON.parse('${JSON.stringify(ver)}');`,
_version_: JSON.stringify(ver) + ';',
},
}),
license({
banner: {
commentStyle: 'ignored',
content: `
Bundle of BilibiliLocalPlayerH5 (https://github.com/auioc/BilibiliLocalPlayerH5)
Generated at <%= moment().format() %>
Version: v<%= pkg.version %> @ ${ver.text}
Copyright (C) 2022-<%= moment().format('YYYY') %> AUIOC.ORG
Copyright (C) 2018-2022 PCC-Studio
Licensed under GNU Affero General Public License v3.0 (https://github.com/auioc/BilibiliLocalPlayerH5/blob/main/LICENSE)
`.trim(),
},
}),
...[dev ? [] : [terser(terserOptions)]],
Expand Down
20 changes: 20 additions & 0 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (C) 2022-2024 AUIOC.ORG
* Copyright (C) 2018-2022 PCC-Studio
*
* This file is part of BilibiliLocalPlayerH5.
*
* BilibiliLocalPlayerH5 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* This program 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { playerMetadata } from './data';
import { PlayerMetadata } from './metadata';
import Player from './player';
Expand Down

0 comments on commit e5ed66a

Please sign in to comment.