Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_YouLeChang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
NJ_YouLeChang
Commits
e36eb9e9
Commit
e36eb9e9
authored
Jan 09, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文件名适配新的发布规则
parent
831d1efe
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
149 additions
and
2 deletions
+149
-2
NJ_YouLeChang.ts
assets/NJ_YouLeChang/scene/NJ_YouLeChang.ts
+1
-1
NJ_YouLeChang_balloon.ts
assets/NJ_YouLeChang/scene/NJ_YouLeChang_balloon.ts
+0
-0
NJ_YouLeChang_balloon.ts.meta
assets/NJ_YouLeChang/scene/NJ_YouLeChang_balloon.ts.meta
+0
-0
MyCocosSceneComponent.ts
assets/NJ_YouLeChang/script/MyCocosSceneComponent.ts
+1
-1
NJ_YouLeChang_defaultData.ts
assets/NJ_YouLeChang/script/NJ_YouLeChang_defaultData.ts
+0
-0
NJ_YouLeChang_defaultData.ts.meta
...ts/NJ_YouLeChang/script/NJ_YouLeChang_defaultData.ts.meta
+0
-0
NJ_YouLeChang_util.ts
assets/NJ_YouLeChang/script/NJ_YouLeChang_util.ts
+0
-0
NJ_YouLeChang_util.ts.meta
assets/NJ_YouLeChang/script/NJ_YouLeChang_util.ts.meta
+0
-0
main.js
packages/check-file-name/main.js
+28
-0
package-lock.json
packages/check-file-name/package-lock.json
+30
-0
package.json
packages/check-file-name/package.json
+15
-0
file.js
packages/check-file-name/util/file.js
+74
-0
No files found.
assets/NJ_YouLeChang/scene/NJ_YouLeChang.ts
View file @
e36eb9e9
import
{
asyncCallNetworkApiGet
,
asyncDelay
,
buttonOnClick
,
jumpToBundle
,
onHomeworkFinish
,
getSpriteFrimeByUrl
,
callNetworkApiGet
}
from
"
../script/util
"
;
import
{
asyncCallNetworkApiGet
,
asyncDelay
,
buttonOnClick
,
jumpToBundle
,
onHomeworkFinish
,
getSpriteFrimeByUrl
,
callNetworkApiGet
}
from
"
../script/
NJ_YouLeChang_
util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
assets/NJ_YouLeChang/scene/balloon.ts
→
assets/NJ_YouLeChang/scene/
NJ_YouLeChang_
balloon.ts
View file @
e36eb9e9
File moved
assets/NJ_YouLeChang/scene/balloon.ts.meta
→
assets/NJ_YouLeChang/scene/
NJ_YouLeChang_
balloon.ts.meta
View file @
e36eb9e9
File moved
assets/NJ_YouLeChang/script/MyCocosSceneComponent.ts
View file @
e36eb9e9
import
{
defaultData
}
from
"
../script/defaultData
"
;
import
{
defaultData
}
from
"
../script/
NJ_YouLeChang_
defaultData
"
;
export
class
MyCocosSceneComponent
extends
cc
.
Component
{
...
...
assets/NJ_YouLeChang/script/defaultData.ts
→
assets/NJ_YouLeChang/script/
NJ_YouLeChang_
defaultData.ts
View file @
e36eb9e9
File moved
assets/NJ_YouLeChang/script/defaultData.ts.meta
→
assets/NJ_YouLeChang/script/
NJ_YouLeChang_
defaultData.ts.meta
View file @
e36eb9e9
File moved
assets/NJ_YouLeChang/script/util.ts
→
assets/NJ_YouLeChang/script/
NJ_YouLeChang_
util.ts
View file @
e36eb9e9
File moved
assets/NJ_YouLeChang/script/util.ts.meta
→
assets/NJ_YouLeChang/script/
NJ_YouLeChang_
util.ts.meta
View file @
e36eb9e9
File moved
packages/check-file-name/main.js
0 → 100644
View file @
e36eb9e9
var
fs
=
require
(
'
fs-extra
'
);
var
file
=
require
(
'
./util/file
'
);
module
.
exports
=
{
load
()
{
},
unload
()
{
},
replaceDirUuid
:
function
(
path
,
dbpath
)
{
Editor
.
log
(
'
开始检查:
'
+
path
);
file
.
findDirUuid
(
path
);
Editor
.
log
(
'
资源检查完成
'
);
},
messages
:
{
'
checkFileName
'
()
{
var
uuids
=
Editor
.
Selection
.
curSelection
(
'
asset
'
);
uuids
.
forEach
((
uuid
)
=>
{
var
dir_path
=
Editor
.
assetdb
.
_uuid2path
[
uuid
];
if
(
fs
.
existsSync
(
dir_path
))
{
this
.
replaceDirUuid
(
dir_path
,
Editor
.
assetdb
.
uuidToUrl
(
uuid
));
}
});
},
},
}
\ No newline at end of file
packages/check-file-name/package-lock.json
0 → 100644
View file @
e36eb9e9
{
"name"
:
"check-file-name"
,
"version"
:
"0.0.1"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"version"
:
"0.0.1"
,
"dependencies"
:
{
"node-uuid"
:
"1.4.8"
}
},
"node_modules/node-uuid"
:
{
"version"
:
"1.4.8"
,
"resolved"
:
"https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz"
,
"integrity"
:
"sha1-sEDrCSOWivq/jTL7HxfxFn/auQc="
,
"deprecated"
:
"Use uuid module instead"
,
"bin"
:
{
"uuid"
:
"bin/uuid"
}
}
},
"dependencies"
:
{
"node-uuid"
:
{
"version"
:
"1.4.8"
,
"resolved"
:
"https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz"
,
"integrity"
:
"sha1-sEDrCSOWivq/jTL7HxfxFn/auQc="
}
}
}
packages/check-file-name/package.json
0 → 100644
View file @
e36eb9e9
{
"name"
:
"check-file-name"
,
"version"
:
"0.0.1"
,
"description"
:
"check-file-name"
,
"author"
:
"Cocos Creator"
,
"main"
:
"main.js"
,
"main-menu"
:
{
"i18n:MAIN_MENU.package.title/check-file-name"
:
{
"message"
:
"check-file-name:checkFileName"
}
},
"dependencies"
:
{
"node-uuid"
:
"1.4.8"
}
}
packages/check-file-name/util/file.js
0 → 100644
View file @
e36eb9e9
var
fs
=
require
(
"
fs-extra
"
);
var
path
=
require
(
"
path
"
);
var
AppName
=
""
module
.
exports
=
{
/**
* 递归目录 检查文件名
* 参考 https://docs.cocos.com/creator/manual/zh/advanced-topics/meta.html
*/
findDirUuid
:
function
(
dir
)
{
if
(
AppName
==
''
)
{
AppName
=
this
.
getRootDirName
(
dir
);
if
(
AppName
!=
""
)
{
Editor
.
log
(
"
AppName:
"
+
AppName
);
}
}
var
stat
=
fs
.
statSync
(
dir
);
if
(
!
stat
.
isDirectory
())
{
return
;
}
var
subpaths
=
fs
.
readdirSync
(
dir
),
subpath
;
for
(
var
i
=
0
;
i
<
subpaths
.
length
;
++
i
)
{
if
(
subpaths
[
i
][
0
]
===
"
.
"
)
{
continue
;
}
subpath
=
path
.
join
(
dir
,
subpaths
[
i
]);
stat
=
fs
.
statSync
(
subpath
);
if
(
stat
.
isDirectory
())
{
this
.
findDirUuid
(
subpath
);
}
else
if
(
stat
.
isFile
())
{
var
metastr
=
subpath
.
substr
(
subpath
.
length
-
5
,
5
);
if
(
metastr
!=
"
.meta
"
)
{
this
.
check
(
AppName
,
subpaths
[
i
]);
}
}
}
},
getRootDirName
:
function
(
path
)
{
let
pArr
=
path
.
split
(
"
/
"
);
let
assteIndex
=
-
1
;
pArr
.
find
((
item
,
index
)
=>
{
if
(
item
==
'
assets
'
)
{
assteIndex
=
index
;
return
true
}
else
{
return
false
}
})
if
(
assteIndex
>
0
&&
assteIndex
<
(
pArr
.
length
-
1
))
{
return
pArr
[
assteIndex
+
1
];
}
else
{
return
""
}
},
check
:
(
appName
,
filePath
)
=>
{
if
(
escape
(
filePath
).
indexOf
(
"
%u
"
)
>=
0
)
{
Editor
.
log
(
`检测到[中文或中文符号]命名的文件:
${
filePath
}
`
);
}
if
(
!
/^
\S
*$/
.
test
(
filePath
))
{
Editor
.
log
(
`检测到[包含空格]命名的文件:
${
filePath
}
`
);
}
if
(
/
[
-
]
/
.
test
(
filePath
))
{
Editor
.
log
(
`检测到存在[包含减号(-)]命名的文件:
${
filePath
}
`
);
}
if
(
filePath
.
indexOf
(
appName
)
==
-
1
&&
(
filePath
.
endsWith
(
"
.js
"
)
||
filePath
.
endsWith
(
"
.ts
"
)))
{
Editor
.
log
(
`检测到[不包含包名(
${
appName
}
)]的文件:
${
filePath
}
`
);
}
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment