@stacksjs/utils 0.58.59 → 0.58.60
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/index.js +12 -10
- package/package.json +1 -1
- package/src/hash.ts +9 -9
package/dist/index.js
CHANGED
|
@@ -147,12 +147,14 @@ function isTruthy(v) {
|
|
|
147
147
|
import {hashPaths} from "@stacksjs/storage";
|
|
148
148
|
import {path as p2} from "@stacksjs/path";
|
|
149
149
|
import {config as config2} from "@stacksjs/config";
|
|
150
|
-
|
|
151
|
-
try {
|
|
152
|
-
|
|
153
|
-
} catch (error) {
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
function originRequestFunctionHash() {
|
|
151
|
+
try {
|
|
152
|
+
return hashPaths(p2.cloudPath("src/edge"));
|
|
153
|
+
} catch (error) {
|
|
154
|
+
log.error("Are we in a Docker container? Failed to hash paths. Error below:");
|
|
155
|
+
log.error(error);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
156
158
|
}
|
|
157
159
|
var docsSrc = [
|
|
158
160
|
p2.projectPath("docs"),
|
|
@@ -163,7 +165,7 @@ var websiteSrc = [
|
|
|
163
165
|
];
|
|
164
166
|
var websiteSourceHash = config2.app.docMode === true ? hashPaths(docsSrc) : hashPaths(websiteSrc);
|
|
165
167
|
// src/helpers.ts
|
|
166
|
-
import {log, runCommand} from "@stacksjs/cli";
|
|
168
|
+
import {log as log2, runCommand} from "@stacksjs/cli";
|
|
167
169
|
import {err, handleError, ok} from "@stacksjs/error-handling";
|
|
168
170
|
import {frameworkPath, projectPath} from "@stacksjs/path";
|
|
169
171
|
import * as storage2 from "@stacksjs/storage";
|
|
@@ -176,13 +178,13 @@ async function packageManager() {
|
|
|
176
178
|
}
|
|
177
179
|
async function initProject() {
|
|
178
180
|
if (app.env !== "production")
|
|
179
|
-
|
|
181
|
+
log2.info("Project not yet initialized, generating application key...");
|
|
180
182
|
else
|
|
181
183
|
handleError("Please run `buddy key:generate` to generate an application key");
|
|
182
184
|
const result = await runAction(Action.KeyGenerate, { cwd: projectPath() });
|
|
183
185
|
if (result.isErr())
|
|
184
186
|
return err(handleError(result.error));
|
|
185
|
-
|
|
187
|
+
log2.info("Application key generated.");
|
|
186
188
|
return ok(result.value);
|
|
187
189
|
}
|
|
188
190
|
async function ensureProjectIsInitialized() {
|
|
@@ -920,7 +922,7 @@ function prettyBytes(number, options) {
|
|
|
920
922
|
return prefix + numberString + separator + unit;
|
|
921
923
|
}
|
|
922
924
|
// package.json
|
|
923
|
-
var version = "0.58.
|
|
925
|
+
var version = "0.58.60";
|
|
924
926
|
export {
|
|
925
927
|
wordChar,
|
|
926
928
|
wordBoundary,
|
package/package.json
CHANGED
package/src/hash.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { hashPaths } from '@stacksjs/storage'
|
|
|
2
2
|
import { path as p } from '@stacksjs/path'
|
|
3
3
|
import { config } from '@stacksjs/config'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export function originRequestFunctionHash() {
|
|
6
|
+
try {
|
|
7
|
+
return hashPaths(p.cloudPath('src/edge'))
|
|
8
|
+
}
|
|
9
|
+
catch (error: any) {
|
|
10
|
+
log.error('Are we in a Docker container? Failed to hash paths. Error below:')
|
|
11
|
+
log.error(error)
|
|
12
|
+
return undefined
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
|
-
catch (error) {
|
|
11
|
-
console.error('Are we in a Docker container? Failed to hash paths:', error)
|
|
12
|
-
originRequestFunctionHash = null // or some default/fallback value
|
|
13
|
-
}
|
|
14
|
-
export { originRequestFunctionHash }
|
|
15
15
|
|
|
16
16
|
const docsSrc = [
|
|
17
17
|
p.projectPath('docs'),
|