@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.7.6",
4
+ "version": "0.7.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
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": async (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
- createHmac("sha256", secret).update(`${timestamp}
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
- await fetch(
94
- `https://oapi.dingtalk.com/robot/send?access_token=${accessToken}&timestamp=${timestamp}&sign=${sign}`,
95
- {
96
- method: "POST",
97
- headers: { "Content-Type": "application/json" },
98
- body: JSON.stringify({
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}&timestamp=${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
- btnOrientation: "0",
110
- btns: [{ title: "\u67E5\u770B\u8BE6\u60C5", actionURL: runUrl }]
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": async () => {
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
- createHmac("sha256", secret).update(`${timestamp}
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
- await fetch(
144
- `https://oapi.dingtalk.com/robot/send?access_token=${accessToken}&timestamp=${timestamp}&sign=${sign}`,
145
- {
146
- method: "POST",
147
- headers: { "Content-Type": "application/json" },
148
- body: JSON.stringify({
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}&timestamp=${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
- btnOrientation: "0",
164
- btns: [{ title: "\u67E5\u770B\u8BE6\u60C5", actionURL: runUrl }]
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",