@total_onion/onion-library 3.0.19 → 3.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/block-video-content-v3/video-content-v3.twig +5 -89
- package/components/component-video-component-v3/video-component-v3.twig +2 -2
- package/duplicateBlock.js +69 -156
- package/package.json +1 -1
- /package/components/core-block-editor-assets-v3/{block-editor-assets-v3.php → core-block-editor-assets-v3.php} +0 -0
|
@@ -12,97 +12,13 @@
|
|
|
12
12
|
{{sectionStyles}}
|
|
13
13
|
}
|
|
14
14
|
</style>
|
|
15
|
-
<section
|
|
16
|
-
{
|
|
17
|
-
{% set renderDynamic = fields.child_pattern_settings.render_dynamic|default(0) %}
|
|
18
|
-
{% set videoPlayingZindexClass = fields.video_playing_high_z_index ? 'video-playing--high-z-index' : '' %}
|
|
19
|
-
{% if videoEnabled %}
|
|
20
|
-
{% set videoType = fields.video_type|ru %}
|
|
21
|
-
{% set youtubeEmbed = fields.youtube_embed|default(false) %}
|
|
22
|
-
{% if 'data-src="' in youtubeEmbed %}
|
|
23
|
-
{% set youtubeDesktopParts = youtubeEmbed|split('data-src="') %}
|
|
24
|
-
{% elseif 'src="' in youtubeEmbed %}
|
|
25
|
-
{% set youtubeDesktopParts = youtubeEmbed|split('src="') %}
|
|
26
|
-
{% endif %}
|
|
27
|
-
{% set youtubeDesktopUrl = youtubeDesktopParts[1]|split('"')[0] %}
|
|
28
|
-
{% set youtubeDesktopId = youtubeDesktopUrl|split('/embed/')|last|split('?')|first %}
|
|
29
|
-
{% set youtubeMobile = fields.youtube_mobile %}
|
|
30
|
-
{% if 'data-src="' in youtubeMobile %}
|
|
31
|
-
{% set youtubeMobileParts = youtubeMobile|split('data-src="') %}
|
|
32
|
-
{% elseif 'src="' in youtubeMobile %}
|
|
33
|
-
{% set youtubeMobileParts = youtubeMobile|split('src="') %}
|
|
34
|
-
{% endif %}
|
|
35
|
-
{% set youtubeMobileUrl = youtubeMobileParts[1]|split('"')[0] %}
|
|
36
|
-
{% set youtubeMobileId = youtubeMobileUrl|split('/embed/')|last|split('?')|first|default(youtubeDesktopId) %}
|
|
37
|
-
{% set vimeoEmbed = fields.vimeo_embed|default(false) %}
|
|
38
|
-
{% if 'data-src="' in vimeoEmbed %}
|
|
39
|
-
{% set vimeoDesktopParts = vimeoEmbed|split('data-src="') %}
|
|
40
|
-
{% elseif 'src="' in vimeoEmbed %}
|
|
41
|
-
{% set vimeoDesktopParts = vimeoEmbed|split('src="') %}
|
|
42
|
-
{% endif %}
|
|
43
|
-
{% set vimeoDesktopUrl = vimeoDesktopParts[1]|split('"')[0] %}
|
|
44
|
-
{% set vimeoDesktopId = vimeoDesktopUrl|split('/video/')|last|split('?')|first %}
|
|
45
|
-
{% set vimeoMobile = fields.vimeo_mobile %}
|
|
46
|
-
{% if 'data-src="' in vimeoMobile %}
|
|
47
|
-
{% set vimeoMobileParts = vimeoMobile|split('data-src="') %}
|
|
48
|
-
{% elseif 'src="' in vimeoMobile %}
|
|
49
|
-
{% set vimeoMobileParts = vimeoMobile|split('src="') %}
|
|
50
|
-
{% endif %}
|
|
51
|
-
{% set vimeoMobileUrl = vimeoMobileParts[1]|split('"')[0] %}
|
|
52
|
-
{% set vimeoMobileId = vimeoMobileUrl|split('/video/')|last|split('?')|first|default(vimeoDesktopId) %}
|
|
53
|
-
{% set videoDesktop = fields.video_desktop|default(false) %}
|
|
54
|
-
{% set videoMobile = fields.video_mobile|default(false) %}
|
|
55
|
-
{% set autoplayVideo = fields.autoplay %}
|
|
56
|
-
{% set autoplayVideoMobile = fields.mobile_autoplay %}
|
|
57
|
-
{% if autoplayVideo == false %}
|
|
58
|
-
{% set autoplayVideo = 0 %}
|
|
59
|
-
{% set autoplayVideoMobile = 0 %}
|
|
60
|
-
{% endif %}
|
|
61
|
-
{% if autoplayVideoMobile == false and autoplayVideoMobile is not null %}
|
|
62
|
-
{% set autoplayVideoMobile = 0 %}
|
|
63
|
-
{% endif %}
|
|
64
|
-
{% if autoplayVideo == true and autoplayVideoMobile is null %}
|
|
65
|
-
{% set autoplayVideoMobile = 1 %}
|
|
66
|
-
{% endif %}
|
|
67
|
-
{% set fullscreen = fields.fullscreen %}
|
|
68
|
-
{% set loopVideo = fields.loop %}
|
|
69
|
-
{% set controls = fields.controls ? 1 : 0 %}
|
|
70
|
-
{% set modal = fields.modal %}
|
|
71
|
-
{% set playsInModal = fields.modal %}
|
|
72
|
-
{% set muted = fields.muted %}
|
|
73
|
-
{% set lockVideoAspectToImage = fields.lock_video_aspect_to_image ? 'lock-video-aspect-to-image' : '' %}
|
|
74
|
-
{% set setVideoToCover = fields.set_video_to_cover ? 'set-video-to-cover' : '' %}
|
|
75
|
-
{% set videoId = block.videoIdPrefix ~ fields.video_trigger_id %}
|
|
76
|
-
{% set captionsEnabled = fields.enable_captions|default(false) %}
|
|
77
|
-
{% set captions = fields.captions %}
|
|
78
|
-
{% set captionsFile = fields.captions.0.captions_file %}
|
|
79
|
-
{% set noAudioCaptions = fields.enable_no_audio_captions %}
|
|
15
|
+
<section
|
|
16
|
+
{{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{block.className}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
|
|
80
17
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<video class="{{blockClassName}}__video-player cblvc-video-container__video-player" {{muted ? 'muted' : ''}} playsinline width='{{videoDesktop.width}}' height='{{videoDesktop.height}}'>
|
|
85
|
-
<source src="" type="video/mp4">
|
|
86
|
-
{% if captionsEnabled == true and noAudioCaptions %}
|
|
87
|
-
<track src={{ asset('no-audio.vtt') }} srclang="en" label="english" kind="captions"/>
|
|
18
|
+
<!--pattern-replace-start:component/video-component-v3 -->
|
|
19
|
+
{{include('components/video-component-v3.twig',{ fields, block, blockClassName }, with_context = false)}}
|
|
20
|
+
<!--pattern-replace-end:component/video-component-v3 -->
|
|
88
21
|
|
|
89
|
-
{% elseif captionsEnabled == true and not noAudioCaptions and captions is not empty %}
|
|
90
|
-
{% for caption in captions %}
|
|
91
|
-
<track src="{{ caption.captions_file.url }}" srclang="{{ caption.language_code }}" label="{{ caption.caption_label }}" kind="captions"/>
|
|
92
|
-
{% endfor %}
|
|
93
|
-
{% endif %}
|
|
94
|
-
|
|
95
|
-
</video>
|
|
96
|
-
{% endif %}
|
|
97
|
-
{% if videoType == 'youtube' %}
|
|
98
|
-
<div id="yt-{{videoId}}"></div>
|
|
99
|
-
{% endif %}
|
|
100
|
-
{% if videoType == 'vimeo' %}
|
|
101
|
-
<div id="vimeo-{{videoId}}-{{vimeoDesktopId}}" style="width: 100%"></div>
|
|
102
|
-
{% endif %}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
{% endif %}
|
|
106
22
|
{% if fields.animations.enable_animations %}
|
|
107
23
|
{{ include('components/animations-style-v3.twig', { fields, block, blockClassName }, with_context = false) }}
|
|
108
24
|
{% endif %}
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
{% set muted = fields.muted %}
|
|
58
58
|
{% set lockVideoAspectToImage = fields.lock_video_aspect_to_image ? 'lock-video-aspect-to-image' : '' %}
|
|
59
59
|
{% set setVideoToCover = fields.set_video_to_cover ? 'set-video-to-cover' : '' %}
|
|
60
|
+
{% set videoId = block.videoIdPrefix ~ fields.video_trigger_id %}
|
|
60
61
|
{% set captionsEnabled = fields.enable_captions|default(false) %}
|
|
61
62
|
{% set captions = fields.captions %}
|
|
62
|
-
{% set videoId = block.videoIdPrefix ~ fields.video_trigger_id %}
|
|
63
63
|
{% set captionsFile = fields.captions.0.captions_file %}
|
|
64
64
|
{% set noAudioCaptions = fields.enable_no_audio_captions %}
|
|
65
65
|
|
|
66
|
-
<div data-videoid="{{videoId}}" data-videocontainerid="{{fields.video_trigger_id}}" data-desktopvideo="{{gt_video_mainsrc(videoDesktop['url'])}}" data-youtubedesktop="{{youtubeDesktopId}}" data-youtubemobile="{{youtubeMobileId}}" data-vimeo-desktop-url="{{vimeoDesktopUrl}}" data-vimeo-mobile-url="{{vimeoMobileUrl}}" data-vimeodesktopid="{{vimeoDesktopId}}" data-vimeomobileid="{{vimeoMobileId}}" data-mobilevideo="{{gt_video_mainsrc(videoMobile['url'])}}" class="{{blockClassName}}__video-container cblvc-video-container {{lockVideoAspectToImage}} {{videoPlayingZindexClass}} {{setVideoToCover}}" data-videotype="{{videoType}}" data-loop="{{loopVideo}}" data-modal="{{modal}}" data-controls="{{controls}}" data-autoplay="{{autoplayVideo}}" data-autoplay-mobile="{{autoplayVideoMobile}}" data-fullscreen="{{fullscreen}}" data-muted="{{muted}}" data-videoenabled="{{videoEnabled}}" data-pattern-dynamic="1">
|
|
66
|
+
<div data-videoid="{{videoId}}" data-datalayerpush="{{fields.data_layer_push}}" data-videocontainerid="{{fields.video_trigger_id}}" data-desktopvideo="{{gt_video_mainsrc(videoDesktop['url'])}}" data-youtubedesktop="{{youtubeDesktopId}}" data-youtubemobile="{{youtubeMobileId}}" data-vimeo-desktop-url="{{vimeoDesktopUrl}}" data-vimeo-mobile-url="{{vimeoMobileUrl}}" data-vimeodesktopid="{{vimeoDesktopId}}" data-vimeomobileid="{{vimeoMobileId}}" data-mobilevideo="{{gt_video_mainsrc(videoMobile['url'])}}" class="{{blockClassName}}__video-container cblvc-video-container {{lockVideoAspectToImage}} {{videoPlayingZindexClass}} {{setVideoToCover}}" data-videotype="{{videoType}}" data-loop="{{loopVideo}}" data-modal="{{modal}}" data-controls="{{controls}}" data-autoplay="{{autoplayVideo}}" data-autoplay-mobile="{{autoplayVideoMobile}}" data-fullscreen="{{fullscreen}}" data-muted="{{muted}}" data-videoenabled="{{videoEnabled}}" data-pattern-dynamic="1">
|
|
67
67
|
<div class="{{blockClassName}}__video-inner-container cblvc-video-container__video-inner-container" data-pattern-type>
|
|
68
68
|
{% if videoType == 'upload' %}
|
|
69
69
|
<video class="{{blockClassName}}__video-player cblvc-video-container__video-player" {{muted ? 'muted' : ''}} playsinline width='{{videoDesktop.width}}' height='{{videoDesktop.height}}'>
|
package/duplicateBlock.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
require('dotenv').config();
|
|
2
2
|
const fs = require('fs');
|
|
3
|
-
const
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const {globSync} = require('glob');
|
|
4
5
|
const yargs = require('yargs');
|
|
5
6
|
const compressing = require('compressing');
|
|
6
|
-
const { log } = require('console');
|
|
7
7
|
const templateOptions = yargs.argv._;
|
|
8
8
|
const themePath =
|
|
9
9
|
process.env.THEME_PATH || 'web/wp-content/themes/global-theme';
|
|
10
10
|
const srcPathJs = `${themePath}/assets/js/blocks`;
|
|
11
11
|
const srcPathScss = `${themePath}/assets/scss/blocks`;
|
|
12
12
|
const srcPathTwig = `${themePath}/views/blocks`;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const destPath =
|
|
13
|
+
const srcPathBlockJson = `${themePath}/inc/acf-blocks`;
|
|
14
|
+
// exported-blocks lives at the project root, relative to cwd (the theme dir)
|
|
15
|
+
const destPath =
|
|
16
|
+
process.env.EXPORTED_BLOCKS_PATH ||
|
|
17
|
+
path.resolve(process.cwd(), '../../../../exported-blocks');
|
|
16
18
|
const newName = templateOptions[1];
|
|
17
19
|
|
|
18
|
-
const exisitingBlockNames =
|
|
19
|
-
.map((
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const exisitingBlockNames = [
|
|
21
|
+
...globSync(`${themePath}/assets/js/blocks/*.js`).map((p) =>
|
|
22
|
+
path.basename(p, '.js')
|
|
23
|
+
),
|
|
24
|
+
...globSync(`${themePath}/inc/acf-blocks/*/block.json`).map((p) =>
|
|
25
|
+
path.basename(path.dirname(p))
|
|
26
|
+
)
|
|
27
|
+
];
|
|
25
28
|
|
|
26
29
|
const blockName = templateOptions[0];
|
|
27
30
|
|
|
@@ -54,162 +57,72 @@ if (exisitingBlockNames.includes(blockName)) {
|
|
|
54
57
|
}
|
|
55
58
|
fs.mkdirSync(dir);
|
|
56
59
|
if (fs.existsSync(`${srcPathJs}/${blockName}.js`)) {
|
|
57
|
-
fs.
|
|
60
|
+
const contents = fs.readFileSync(
|
|
58
61
|
`${srcPathJs}/${blockName}.js`,
|
|
59
|
-
'utf-8'
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'gi'
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const replaced = contents
|
|
68
|
-
.replaceAll(
|
|
69
|
-
regEx,
|
|
70
|
-
`${newName.toLowerCase().replaceAll(/( |-)/g, '')}`
|
|
71
|
-
)
|
|
72
|
-
.replaceAll(`blocks/${blockName}`, `blocks/${newName}`);
|
|
73
|
-
fs.writeFile(
|
|
74
|
-
`${dir}/${newName}.js`,
|
|
75
|
-
replaced,
|
|
76
|
-
'utf-8',
|
|
77
|
-
function (err) {
|
|
78
|
-
if (err) throw err;
|
|
79
|
-
console.log(
|
|
80
|
-
`👑👑\x1b[32m Successfully duplicated the js file! 👑👑`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
}
|
|
62
|
+
'utf-8'
|
|
63
|
+
);
|
|
64
|
+
const regEx = RegExp(
|
|
65
|
+
String.raw`(${blockName.replaceAll(/( |-)/g, '')})`,
|
|
66
|
+
'gi'
|
|
85
67
|
);
|
|
68
|
+
const replaced = contents
|
|
69
|
+
.replaceAll(
|
|
70
|
+
regEx,
|
|
71
|
+
`${newName.toLowerCase().replaceAll(/( |-)/g, '')}`
|
|
72
|
+
)
|
|
73
|
+
.replaceAll(`blocks/${blockName}`, `blocks/${newName}`);
|
|
74
|
+
fs.writeFileSync(`${dir}/${newName}.js`, replaced, 'utf-8');
|
|
75
|
+
console.log(`👑👑\x1b[32m Successfully duplicated the js file! 👑👑`);
|
|
86
76
|
}
|
|
87
77
|
if (fs.existsSync(`${srcPathScss}/${blockName}.scss`)) {
|
|
88
|
-
fs.
|
|
78
|
+
const contents = fs.readFileSync(
|
|
89
79
|
`${srcPathScss}/${blockName}.scss`,
|
|
90
|
-
'utf-8'
|
|
91
|
-
(err, contents) => {
|
|
92
|
-
if (err) throw err;
|
|
93
|
-
const replaced = contents.replaceAll(
|
|
94
|
-
`${blockName}`,
|
|
95
|
-
`${newName}`
|
|
96
|
-
);
|
|
97
|
-
fs.writeFile(
|
|
98
|
-
`${dir}/${newName}.scss`,
|
|
99
|
-
replaced,
|
|
100
|
-
'utf-8',
|
|
101
|
-
function (err) {
|
|
102
|
-
if (err) throw err;
|
|
103
|
-
console.log(
|
|
104
|
-
`👑👑\x1b[32m Successfully duplicated the scss file! 👑👑`
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
80
|
+
'utf-8'
|
|
109
81
|
);
|
|
82
|
+
const replaced = contents.replaceAll(`${blockName}`, `${newName}`);
|
|
83
|
+
fs.writeFileSync(`${dir}/${newName}.scss`, replaced, 'utf-8');
|
|
84
|
+
console.log(`👑👑\x1b[32m Successfully duplicated the scss file! 👑👑`);
|
|
110
85
|
}
|
|
111
86
|
if (fs.existsSync(`${srcPathTwig}/${blockName}.twig`)) {
|
|
112
|
-
fs.
|
|
87
|
+
const contents = fs.readFileSync(
|
|
113
88
|
`${srcPathTwig}/${blockName}.twig`,
|
|
114
|
-
'utf-8'
|
|
115
|
-
(err, contents) => {
|
|
116
|
-
if (err) throw err;
|
|
117
|
-
const regEx = RegExp(String.raw`(\"${blockName}) `, 'gi');
|
|
118
|
-
const replaced = contents.replaceAll(regEx, `"${newName} `);
|
|
119
|
-
const regEx2 = RegExp(
|
|
120
|
-
String.raw`([\"|\']${blockName}[\"|\'])`,
|
|
121
|
-
'gi'
|
|
122
|
-
);
|
|
123
|
-
const replaced2 = replaced.replaceAll(regEx2, `"${newName}"`);
|
|
124
|
-
fs.writeFile(
|
|
125
|
-
`${dir}/${newName}.twig`,
|
|
126
|
-
replaced2,
|
|
127
|
-
'utf-8',
|
|
128
|
-
function (err) {
|
|
129
|
-
if (err) throw err;
|
|
130
|
-
console.log(
|
|
131
|
-
`👑👑\x1b[32m Successfully duplicated the twig file! 👑👑`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
89
|
+
'utf-8'
|
|
136
90
|
);
|
|
91
|
+
const regEx = RegExp(String.raw`(\"${blockName}) `, 'gi');
|
|
92
|
+
const replaced = contents.replaceAll(regEx, `"${newName} `);
|
|
93
|
+
const regEx2 = RegExp(String.raw`([\"|\']${blockName}[\"|\'])`, 'gi');
|
|
94
|
+
const replaced2 = replaced.replaceAll(regEx2, `"${newName}"`);
|
|
95
|
+
fs.writeFileSync(`${dir}/${newName}.twig`, replaced2, 'utf-8');
|
|
96
|
+
console.log(`👑👑\x1b[32m Successfully duplicated the twig file! 👑👑`);
|
|
137
97
|
}
|
|
138
|
-
if (fs.existsSync(`${
|
|
139
|
-
fs.
|
|
140
|
-
`${
|
|
141
|
-
'utf-8'
|
|
142
|
-
(err, contents) => {
|
|
143
|
-
if (err) throw err;
|
|
144
|
-
const replaced = contents.replaceAll(
|
|
145
|
-
`${blockName}`,
|
|
146
|
-
`${newName}`
|
|
147
|
-
);
|
|
148
|
-
const regEx = RegExp(
|
|
149
|
-
String.raw`${blockName.replaceAll('-', ' ')}`,
|
|
150
|
-
'gi'
|
|
151
|
-
);
|
|
152
|
-
const replaced2 = replaced.replaceAll(
|
|
153
|
-
regEx,
|
|
154
|
-
`${newName.slice(0, 1).toUpperCase()}${newName
|
|
155
|
-
.replaceAll('-', ' ')
|
|
156
|
-
.slice(1)}`
|
|
157
|
-
);
|
|
158
|
-
const regEx2 = RegExp(
|
|
159
|
-
String.raw`${blockName.replaceAll('-', '_')}`,
|
|
160
|
-
'gi'
|
|
161
|
-
);
|
|
162
|
-
const replaced3 = replaced2.replaceAll(
|
|
163
|
-
regEx2,
|
|
164
|
-
`${newName.replaceAll('-', '_')}`
|
|
165
|
-
);
|
|
166
|
-
fs.writeFile(
|
|
167
|
-
`${dir}/${newName}.php`,
|
|
168
|
-
replaced3,
|
|
169
|
-
'utf-8',
|
|
170
|
-
function (err) {
|
|
171
|
-
if (err) throw err;
|
|
172
|
-
console.log(
|
|
173
|
-
`👑👑\x1b[32m Successfully duplicated the php file! 👑👑`
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}
|
|
98
|
+
if (fs.existsSync(`${srcPathBlockJson}/${blockName}/block.json`)) {
|
|
99
|
+
const contents = fs.readFileSync(
|
|
100
|
+
`${srcPathBlockJson}/${blockName}/block.json`,
|
|
101
|
+
'utf-8'
|
|
178
102
|
);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (err) throw err;
|
|
196
|
-
console.log(
|
|
197
|
-
`👑👑\x1b[32m Successfully duplicated the vue file! 👑👑`
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
}
|
|
103
|
+
const data = JSON.parse(contents);
|
|
104
|
+
data.name = `acf/${newName}`;
|
|
105
|
+
data.title = newName
|
|
106
|
+
.split('-')
|
|
107
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
108
|
+
.join(' ');
|
|
109
|
+
if (data.description) {
|
|
110
|
+
data.description = data.description.replaceAll(blockName, newName);
|
|
111
|
+
}
|
|
112
|
+
fs.writeFileSync(
|
|
113
|
+
`${dir}/block.json`,
|
|
114
|
+
JSON.stringify(data, null, '\t'),
|
|
115
|
+
'utf-8'
|
|
116
|
+
);
|
|
117
|
+
console.log(
|
|
118
|
+
`👑👑\x1b[32m Successfully duplicated the block.json file! 👑👑`
|
|
202
119
|
);
|
|
203
120
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
.compressDir(`${dir}`, `${dir}.zip`)
|
|
212
|
-
.then(compressDone)
|
|
213
|
-
.catch(handleError);
|
|
214
|
-
}, 100);
|
|
121
|
+
compressing.zip
|
|
122
|
+
.compressDir(`${dir}`, `${dir}.zip`)
|
|
123
|
+
.then(() => {
|
|
124
|
+
fs.rmSync(`${destPath}/${newName}`, {recursive: true});
|
|
125
|
+
console.log(`\x1b[32m 🎉 Zip created at ${dir}.zip \x1b[0m`);
|
|
126
|
+
})
|
|
127
|
+
.catch((err) => console.error(err));
|
|
215
128
|
}
|
package/package.json
CHANGED
|
File without changes
|