@shwfed/nuxt 0.7.6 → 0.7.8
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/dist/module.json +1 -1
- package/dist/module.mjs +26 -38
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
-
import { createHmac } from 'node:crypto';
|
|
3
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addImportsDir, addComponentsDir, addRouteMiddleware } from '@nuxt/kit';
|
|
4
3
|
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
|
5
4
|
import TailwindCSS from '@tailwindcss/vite';
|
|
@@ -15,7 +14,8 @@ const module$1 = defineNuxtModule({
|
|
|
15
14
|
version: "^0.14.0",
|
|
16
15
|
defaults: {
|
|
17
16
|
providers: {
|
|
18
|
-
google: false
|
|
17
|
+
google: false,
|
|
18
|
+
googleicons: false
|
|
19
19
|
},
|
|
20
20
|
families: [
|
|
21
21
|
{ name: "Noto Sans", provider: "bunny" },
|
|
@@ -77,43 +77,37 @@ const module$1 = defineNuxtModule({
|
|
|
77
77
|
});
|
|
78
78
|
},
|
|
79
79
|
hooks: {
|
|
80
|
-
"build:error":
|
|
80
|
+
"build:error": (error) => {
|
|
81
81
|
if (!process.env.CI) return;
|
|
82
82
|
const accessToken = "a01e0fdfd7d2d019dcfac29e39d82333907f97bfe490dc9e15e94ee4cf6a7ecf";
|
|
83
83
|
const secret = "SEC9d85269f2b09e9eb652d32af42ff7e84193f0ca5d5669ba16378a388881aed9c";
|
|
84
84
|
const timestamp = String(Date.now());
|
|
85
85
|
const sign = encodeURIComponent(
|
|
86
|
-
|
|
87
|
-
${secret}`).digest("base64")
|
|
86
|
+
execSync(`printf '%s\\n%s' '${timestamp}' '${secret}' | openssl dgst -sha256 -hmac '${secret}' -binary | base64`).toString().trim()
|
|
88
87
|
);
|
|
89
88
|
const jobName = process.env.JOB_NAME ?? "";
|
|
90
89
|
const buildNumber = process.env.BUILD_NUMBER ?? "";
|
|
91
90
|
const branch = process.env.BRANCH_NAME ?? process.env.GIT_BRANCH ?? "";
|
|
92
91
|
const runUrl = process.env.RUN_DISPLAY_URL ?? "";
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
msgtype: "actionCard",
|
|
100
|
-
actionCard: {
|
|
101
|
-
title: `\u9879\u76EE\u6784\u5EFA\u5931\u8D25: ${jobName}`,
|
|
102
|
-
text: `### \u9879\u76EE\u6784\u5EFA\u5931\u8D25: ${jobName}
|
|
92
|
+
const url = `https://oapi.dingtalk.com/robot/send?access_token=${accessToken}×tamp=${timestamp}&sign=${sign}`;
|
|
93
|
+
const payload = JSON.stringify({
|
|
94
|
+
msgtype: "actionCard",
|
|
95
|
+
actionCard: {
|
|
96
|
+
title: `\u9879\u76EE\u6784\u5EFA\u5931\u8D25: ${jobName}`,
|
|
97
|
+
text: `### \u9879\u76EE\u6784\u5EFA\u5931\u8D25: ${jobName}
|
|
103
98
|
|
|
104
99
|
**\u6784\u5EFA\u7F16\u53F7**: #${buildNumber}
|
|
105
100
|
|
|
106
101
|
**\u5206\u652F**: ${branch}
|
|
107
102
|
|
|
108
103
|
**\u9519\u8BEF**: ${error.message}`,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
})
|
|
104
|
+
btnOrientation: "0",
|
|
105
|
+
btns: [{ title: "\u67E5\u770B\u8BE6\u60C5", actionURL: runUrl }]
|
|
113
106
|
}
|
|
114
|
-
);
|
|
107
|
+
});
|
|
108
|
+
execSync(`curl -s -X POST '${url}' -H 'Content-Type: application/json' -d @-`, { input: payload });
|
|
115
109
|
},
|
|
116
|
-
"build:done":
|
|
110
|
+
"build:done": () => {
|
|
117
111
|
if (!process.env.CI) return;
|
|
118
112
|
const accessToken = "a01e0fdfd7d2d019dcfac29e39d82333907f97bfe490dc9e15e94ee4cf6a7ecf";
|
|
119
113
|
const secret = "SEC9d85269f2b09e9eb652d32af42ff7e84193f0ca5d5669ba16378a388881aed9c";
|
|
@@ -133,23 +127,18 @@ ${secret}`).digest("base64")
|
|
|
133
127
|
}
|
|
134
128
|
const timestamp = String(Date.now());
|
|
135
129
|
const sign = encodeURIComponent(
|
|
136
|
-
|
|
137
|
-
${secret}`).digest("base64")
|
|
130
|
+
execSync(`printf '%s\\n%s' '${timestamp}' '${secret}' | openssl dgst -sha256 -hmac '${secret}' -binary | base64`).toString().trim()
|
|
138
131
|
);
|
|
139
132
|
const jobName = process.env.JOB_NAME ?? "";
|
|
140
133
|
const buildNumber = process.env.BUILD_NUMBER ?? "";
|
|
141
134
|
const branch = process.env.BRANCH_NAME ?? process.env.GIT_BRANCH ?? "";
|
|
142
135
|
const runUrl = process.env.RUN_DISPLAY_URL ?? "";
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
msgtype: "actionCard",
|
|
150
|
-
actionCard: {
|
|
151
|
-
title: `\u9879\u76EE\u6784\u5EFA\u901A\u77E5: ${jobName}`,
|
|
152
|
-
text: `### \u9879\u76EE\u6784\u5EFA\u901A\u77E5: ${jobName}
|
|
136
|
+
const url = `https://oapi.dingtalk.com/robot/send?access_token=${accessToken}×tamp=${timestamp}&sign=${sign}`;
|
|
137
|
+
const payload = JSON.stringify({
|
|
138
|
+
msgtype: "actionCard",
|
|
139
|
+
actionCard: {
|
|
140
|
+
title: `\u9879\u76EE\u6784\u5EFA\u901A\u77E5: ${jobName}`,
|
|
141
|
+
text: `### \u9879\u76EE\u6784\u5EFA\u901A\u77E5: ${jobName}
|
|
153
142
|
|
|
154
143
|
**\u6784\u5EFA\u7F16\u53F7**: #${buildNumber}
|
|
155
144
|
|
|
@@ -160,12 +149,11 @@ ${secret}`).digest("base64")
|
|
|
160
149
|
**\u53D8\u66F4\u65E5\u5FD7**:
|
|
161
150
|
|
|
162
151
|
${changelog}`,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
})
|
|
152
|
+
btnOrientation: "0",
|
|
153
|
+
btns: [{ title: "\u67E5\u770B\u8BE6\u60C5", actionURL: runUrl }]
|
|
167
154
|
}
|
|
168
|
-
);
|
|
155
|
+
});
|
|
156
|
+
execSync(`curl -s -X POST '${url}' -H 'Content-Type: application/json' -d @-`, { input: payload });
|
|
169
157
|
}
|
|
170
158
|
}
|
|
171
159
|
});
|