@stacksjs/utils 0.58.58 → 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 +13 -5
- package/package.json +2 -2
- package/src/hash.ts +10 -1
package/dist/index.js
CHANGED
|
@@ -147,7 +147,15 @@ 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
|
-
|
|
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
|
+
}
|
|
158
|
+
}
|
|
151
159
|
var docsSrc = [
|
|
152
160
|
p2.projectPath("docs"),
|
|
153
161
|
p2.projectPath("config/docs.ts")
|
|
@@ -157,7 +165,7 @@ var websiteSrc = [
|
|
|
157
165
|
];
|
|
158
166
|
var websiteSourceHash = config2.app.docMode === true ? hashPaths(docsSrc) : hashPaths(websiteSrc);
|
|
159
167
|
// src/helpers.ts
|
|
160
|
-
import {log, runCommand} from "@stacksjs/cli";
|
|
168
|
+
import {log as log2, runCommand} from "@stacksjs/cli";
|
|
161
169
|
import {err, handleError, ok} from "@stacksjs/error-handling";
|
|
162
170
|
import {frameworkPath, projectPath} from "@stacksjs/path";
|
|
163
171
|
import * as storage2 from "@stacksjs/storage";
|
|
@@ -170,13 +178,13 @@ async function packageManager() {
|
|
|
170
178
|
}
|
|
171
179
|
async function initProject() {
|
|
172
180
|
if (app.env !== "production")
|
|
173
|
-
|
|
181
|
+
log2.info("Project not yet initialized, generating application key...");
|
|
174
182
|
else
|
|
175
183
|
handleError("Please run `buddy key:generate` to generate an application key");
|
|
176
184
|
const result = await runAction(Action.KeyGenerate, { cwd: projectPath() });
|
|
177
185
|
if (result.isErr())
|
|
178
186
|
return err(handleError(result.error));
|
|
179
|
-
|
|
187
|
+
log2.info("Application key generated.");
|
|
180
188
|
return ok(result.value);
|
|
181
189
|
}
|
|
182
190
|
async function ensureProjectIsInitialized() {
|
|
@@ -914,7 +922,7 @@ function prettyBytes(number, options) {
|
|
|
914
922
|
return prefix + numberString + separator + unit;
|
|
915
923
|
}
|
|
916
924
|
// package.json
|
|
917
|
-
var version = "0.58.
|
|
925
|
+
var version = "0.58.60";
|
|
918
926
|
export {
|
|
919
927
|
wordChar,
|
|
920
928
|
wordBoundary,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.60",
|
|
5
5
|
"description": "The Stacks helper functions.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"build": "bun --bun build.ts",
|
|
50
50
|
"typecheck": "bun --bun tsc --noEmit",
|
|
51
51
|
"prepublishOnly": "bun --bun run build",
|
|
52
|
-
"size": "
|
|
52
|
+
"size": "bun scripts/export-size.ts"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@stacksjs/actions": "latest",
|
package/src/hash.ts
CHANGED
|
@@ -2,7 +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
|
-
export
|
|
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
|
+
}
|
|
14
|
+
}
|
|
6
15
|
|
|
7
16
|
const docsSrc = [
|
|
8
17
|
p.projectPath('docs'),
|