@@ -20,7 +20,11 @@ const legacySlug = ["dev", "flow-skills"].join("");
2020const legacyBrand = [ "Dev" , "Flow" ] . join ( "" ) ;
2121const legacyUpper = [ "DEV" , "FLOW" ] . join ( "" ) ;
2222const legacyDotDirectory = [ ".dev" , "flow" ] . join ( "" ) ;
23- const allowedGithubSource = `LiTeXz/${ legacySlug } ` ;
23+ const legacyOwner = [ "Li" , "TeXz" ] . join ( "" ) ;
24+ const expectedOwner = "TrueNine" ;
25+ const expectedRepository = `${ expectedOwner } /devopsflow` ;
26+ const originalRepository = `${ legacyOwner } /${ legacySlug } ` ;
27+ const originalAttribution = `> 本项目基于 [${ originalRepository } ](https://github.com/${ originalRepository } ) 二次开发并公开发布。感谢原作者 [${ legacyOwner } ](https://github.com/${ legacyOwner } ) 的贡献;本项目继续遵循 [GPL-3.0-only](LICENSE) 协议。` ;
2428
2529function collectTextFiles ( directory : string ) : string [ ] {
2630 const files : string [ ] = [ ] ;
@@ -42,17 +46,23 @@ describe("DevOpsFlow project identity", () => {
4246 const projectPath = relative ( ROOT , file ) . replaceAll ( "\\" , "/" ) ;
4347 expect ( projectPath , projectPath ) . not . toContain ( legacySlug ) ;
4448
45- const content = readFileSync ( file , "utf-8" ) . replaceAll (
46- allowedGithubSource ,
49+ const content = readFileSync ( file , "utf-8" ) . replace (
50+ originalAttribution ,
4751 "" ,
4852 ) ;
4953 expect ( content , projectPath ) . not . toContain ( legacySlug ) ;
5054 expect ( content , projectPath ) . not . toContain ( legacyBrand ) ;
5155 expect ( content , projectPath ) . not . toContain ( legacyUpper ) ;
5256 expect ( content , projectPath ) . not . toContain ( legacyDotDirectory ) ;
57+ expect ( content , projectPath ) . not . toContain ( legacyOwner ) ;
5358 }
5459 } ) ;
5560
61+ it ( "attributes the original project in the README first line" , ( ) => {
62+ const readme = readFileSync ( join ( ROOT , "README.md" ) , "utf-8" ) ;
63+ expect ( readme . split ( / \r ? \n / , 1 ) [ 0 ] ) . toBe ( originalAttribution ) ;
64+ } ) ;
65+
5666 it ( "uses the new package and plugin identity" , ( ) => {
5767 const packageJson = JSON . parse (
5868 readFileSync ( join ( ROOT , "package.json" ) , "utf-8" ) ,
@@ -64,5 +74,17 @@ describe("DevOpsFlow project identity", () => {
6474 expect ( packageJson . name ) . toBe ( "devopsflow" ) ;
6575 expect ( pluginJson . name ) . toBe ( "devopsflow" ) ;
6676 expect ( pluginJson . interface . displayName ) . toBe ( "DevOpsFlow" ) ;
77+ expect ( pluginJson . author . name ) . toBe ( expectedOwner ) ;
78+ expect ( pluginJson . author . url ) . toBe ( `https://github.com/${ expectedOwner } ` ) ;
79+ expect ( pluginJson . homepage ) . toBe (
80+ `https://github.com/${ expectedRepository } ` ,
81+ ) ;
82+ expect ( pluginJson . repository ) . toBe (
83+ `https://github.com/${ expectedRepository } ` ,
84+ ) ;
85+ expect ( pluginJson . interface . developerName ) . toBe ( expectedOwner ) ;
86+ expect ( pluginJson . interface . websiteURL ) . toBe (
87+ `https://github.com/${ expectedRepository } ` ,
88+ ) ;
6789 } ) ;
6890} ) ;
0 commit comments