Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
local-cdn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
local-cdn
Commits
43688ce3
Commit
43688ce3
authored
Nov 28, 2017
by
Дмитрий Никулин
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to yarn instead of npm
parent
f4991381
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
README.md
README.md
+2
-2
add.sh
add.sh
+2
-2
functions.sh
functions.sh
+9
-3
update.sh
update.sh
+1
-1
No files found.
README.md
View file @
43688ce3
Зависимости для работы - jq и
npm
(ставятся в теле скрипта через epm).
Зависимости для работы - jq и
yarn
(ставятся в теле скрипта через epm).
Чтобы начать работу, нужно склонировать репозиторий и запустить ./init.sh - это
создаст пустой registry.json.
...
...
@@ -26,7 +26,7 @@
нет);
-
Создастся (если ещё не существует) каталог packages/jquery/latest, а в нём
package.json с "jquery": "
*
" в зависимостях;
-
В каталоге будет выполнен
npm install
;
-
В каталоге будет выполнен
yarn upgrade
;
-
Будет создан каталог public/jquery/latest, в нём хардлинки jquery.min.js и
jquery.js на сжатую версию, и jquery.development.js на несжатую.
...
...
add.sh
View file @
43688ce3
...
...
@@ -48,10 +48,10 @@ if ! [[ "$version" =~ $re ]] && [ "$version" != "latest" ]; then
fi
epm assure jq
||
exit
epm assure
npm
||
exit
epm assure
yarn
||
exit
if
!
npm view
"
$library
"
>
/dev/null
;
then
if
!
yarn info
"
$library
"
>
/dev/null
;
then
echo
'Failed to get package info. Are you sure it exists?'
echo
'If not sure, check npm-debug.log for details.'
exit
1
...
...
functions.sh
View file @
43688ce3
...
...
@@ -58,7 +58,7 @@ create_dist_link () {
mkdir
-p
"
$public_base
"
||
fatal
#if [ -z "$3" ]; then
# main_file=$(
npm view
"$1" main)
# main_file=$(
yarn info
"$1" main)
#else
#fi
link_and_print
"
$library_base
/
$main_file_minified
"
"
$public_base
/
$library
.min.js"
...
...
@@ -75,6 +75,7 @@ create_package_version () {
mkdir
-p
"packages/
$1
/
$2
"
rm
-f
"packages/
$1
/
$2
/package.json"
# private: true is to avoid yarn warnings
cat
>>
"packages/
$1
/
$2
/package.json"
<<
EOL
{
"name": "",
...
...
@@ -82,7 +83,8 @@ create_package_version () {
"version": "0.1.0",
"dependencies": {
"
$1
": "
$semver_version
"
}
},
"private": true
}
EOL
}
...
...
@@ -90,7 +92,11 @@ EOL
install_or_update_package
()
{
cd
"packages/
$1
/
$2
/"
||
fatal
npm i
>
/dev/null
||
fatal
"Failed to install
$1
@
$2
"
if
[
-e
yarn.lock
]
;
then
yarn upgrade
>
/dev/null
||
fatal
"Failed to update
$1
@
$2
"
else
yarn
install
>
/dev/null
||
fatal
"Failed to install
$1
@
$2
"
fi
cd
../../../
||
fatal
}
...
...
update.sh
View file @
43688ce3
...
...
@@ -26,7 +26,7 @@ if [ "$1" == '-h' ] || [ "$1" == '--help' ] || [ $# -eq 1 ] ; then
fi
epm assure jq
||
exit
epm assure
npm
||
exit
epm assure
yarn
||
exit
library
=
"
$1
"
version
=
"
$2
"
...
...
Дмитрий Никулин
@TheOwl
mentioned in commit
a1c5e093
·
Nov 28, 2017
mentioned in commit
a1c5e093
mentioned in commit a1c5e0939efd73e117e0cfb8265964a253381e5c
Toggle commit list
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