@profitlich/template-toolkit 2.7.3 ā 2.8.4
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/dev/toolbar/toolbar.scss +9 -11
- package/package.json +1 -1
- package/scripts/deploy.js +76 -72
package/dev/toolbar/toolbar.scss
CHANGED
|
@@ -13,16 +13,14 @@ $color--dev-grid-center: rgba(0, 0, 0, 0.2);
|
|
|
13
13
|
$margin-left: size($layout, $margin-left);
|
|
14
14
|
$margin-right: size($layout, $margin-right);
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
width: calc(100% - $margin-right + calc($gutter / 2) - $margin-left + calc($gutter / 2));
|
|
25
|
-
}
|
|
16
|
+
.dev-toolbar__grid::after {
|
|
17
|
+
// the grid is made through repition
|
|
18
|
+
// 'important' because background settings are more specific than the grid settings
|
|
19
|
+
background-size: calc((100% - ($columns * $gutter)) * calc(1 / $columns) + $gutter) 1px !important;
|
|
20
|
+
margin: 0 ($margin-right - calc($gutter / 2)) 0 ($margin-left - calc($gutter / 2));
|
|
21
|
+
// The grid is calculated starting from the middle
|
|
22
|
+
// Thats why its necessary to add the half of the column gap to the left and right side
|
|
23
|
+
width: calc(100% - $margin-right + calc($gutter / 2) - $margin-left + calc($gutter / 2));
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
body[data-dev-grid="lines"] {
|
|
@@ -62,7 +60,7 @@ $color--dev-grid-center: rgba(0, 0, 0, 0.2);
|
|
|
62
60
|
position: fixed;
|
|
63
61
|
top: 0;
|
|
64
62
|
|
|
65
|
-
body[data-dev='
|
|
63
|
+
body:not([data-dev-grid='aus']) & {
|
|
66
64
|
display: block;
|
|
67
65
|
}
|
|
68
66
|
|
package/package.json
CHANGED
package/scripts/deploy.js
CHANGED
|
@@ -38,93 +38,99 @@ export async function runDeploy(mode, uploadTasks, options = {}) {
|
|
|
38
38
|
secure: true
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const mainClient = new ftp.Client();
|
|
42
|
-
mainClient.ftp.verbose = false;
|
|
43
41
|
let activeProgressBar = null;
|
|
44
42
|
|
|
45
43
|
try {
|
|
46
44
|
console.log(`š Starting deployment for: ${modeUpper}`);
|
|
47
45
|
|
|
48
|
-
await mainClient.access(accessOptions);
|
|
49
|
-
|
|
50
46
|
for (const task of uploadTasks) {
|
|
51
47
|
console.log(`\nProcessing Task: ${task.name}`);
|
|
52
48
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
dot: true,
|
|
56
|
-
ignore: task.ignore
|
|
57
|
-
});
|
|
49
|
+
const mainClient = new ftp.Client();
|
|
50
|
+
mainClient.ftp.verbose = false;
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
52
|
+
try {
|
|
53
|
+
await mainClient.access(accessOptions);
|
|
63
54
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const remotePath = path.join(task.remoteDir, relativeFile).replace(/\\/g, '/');
|
|
70
|
-
if (await isNewer(mainClient, file, remotePath)) {
|
|
71
|
-
filesToUpload.push({ file, remotePath });
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
process.stdout.write(` ${filesToUpload.length} changed.\n`);
|
|
55
|
+
const files = await glob(task.localPattern, {
|
|
56
|
+
nodir: true,
|
|
57
|
+
dot: true,
|
|
58
|
+
ignore: task.ignore
|
|
59
|
+
});
|
|
75
60
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
if (files.length === 0) {
|
|
62
|
+
console.log('No files found for this task.');
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
80
65
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (parallel <= 1) {
|
|
92
|
-
for (const { file, remotePath } of filesToUpload) {
|
|
93
|
-
await mainClient.ensureDir(path.dirname(remotePath));
|
|
94
|
-
await mainClient.uploadFrom(file, remotePath);
|
|
95
|
-
progressBar.increment();
|
|
66
|
+
// Determine which files are newer than their remote counterparts
|
|
67
|
+
process.stdout.write(` Checking ${files.length} files...`);
|
|
68
|
+
const filesToUpload = [];
|
|
69
|
+
for (const file of files) {
|
|
70
|
+
const relativeFile = path.relative(task.localBase, file);
|
|
71
|
+
const remotePath = path.join(task.remoteDir, relativeFile).replace(/\\/g, '/');
|
|
72
|
+
if (await isNewer(mainClient, file, remotePath)) {
|
|
73
|
+
filesToUpload.push({ file, remotePath });
|
|
74
|
+
}
|
|
96
75
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
process.stdout.write(` ${filesToUpload.length} changed.\n`);
|
|
77
|
+
|
|
78
|
+
if (filesToUpload.length === 0) {
|
|
79
|
+
console.log(' All files are up to date, skipping.');
|
|
80
|
+
continue;
|
|
102
81
|
}
|
|
103
82
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
83
|
+
const progressBar = new cliProgress.SingleBar({
|
|
84
|
+
format: ' Upload |{bar}| {percentage}% {value}/{total} files {duration_formatted}',
|
|
85
|
+
barCompleteChar: 'ā',
|
|
86
|
+
barIncompleteChar: 'ā',
|
|
87
|
+
hideCursor: true
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
activeProgressBar = progressBar;
|
|
91
|
+
progressBar.start(filesToUpload.length, 0);
|
|
92
|
+
|
|
93
|
+
if (parallel <= 1) {
|
|
94
|
+
for (const { file, remotePath } of filesToUpload) {
|
|
95
|
+
await mainClient.ensureDir(path.dirname(remotePath));
|
|
96
|
+
await mainClient.uploadFrom(file, remotePath);
|
|
97
|
+
progressBar.increment();
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
// Pre-create all required remote directories with the main client
|
|
101
|
+
const uniqueDirs = [...new Set(filesToUpload.map(({ remotePath }) => path.dirname(remotePath)))];
|
|
102
|
+
for (const dir of uniqueDirs) {
|
|
103
|
+
await mainClient.ensureDir(dir);
|
|
121
104
|
}
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
105
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
106
|
+
// Spawn parallel worker connections
|
|
107
|
+
const workerCount = Math.min(parallel, filesToUpload.length);
|
|
108
|
+
const workers = await Promise.all(
|
|
109
|
+
Array.from({ length: workerCount }, () => createClient(accessOptions))
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const queue = [...filesToUpload];
|
|
113
|
+
await Promise.all(workers.map(async (workerClient) => {
|
|
114
|
+
try {
|
|
115
|
+
while (true) {
|
|
116
|
+
const item = queue.shift();
|
|
117
|
+
if (!item) break;
|
|
118
|
+
await workerClient.uploadFrom(item.file, item.remotePath);
|
|
119
|
+
progressBar.increment();
|
|
120
|
+
}
|
|
121
|
+
} finally {
|
|
122
|
+
workerClient.close();
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
activeProgressBar.stop();
|
|
128
|
+
activeProgressBar = null;
|
|
129
|
+
await delay(50);
|
|
130
|
+
|
|
131
|
+
} finally {
|
|
132
|
+
mainClient.close();
|
|
133
|
+
}
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
console.log('\nā
Deployment completed successfully!');
|
|
@@ -134,8 +140,6 @@ export async function runDeploy(mode, uploadTasks, options = {}) {
|
|
|
134
140
|
activeProgressBar.stop();
|
|
135
141
|
}
|
|
136
142
|
console.error('Deployment failed:', err);
|
|
137
|
-
} finally {
|
|
138
|
-
mainClient.close();
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
|