alchemy 0.62.1 → 0.62.2
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/bin/alchemy.js
CHANGED
|
@@ -44441,7 +44441,6 @@ async function addGitHubWorkflowToAlchemy(context$1) {
|
|
|
44441
44441
|
} }
|
|
44442
44442
|
}));
|
|
44443
44443
|
let code = await import_lib$6.default.readFile(alchemyFilePath, "utf-8");
|
|
44444
|
-
code = code.replace("{projectName}", context$1.name);
|
|
44445
44444
|
const alchemyImportRegex = /(import alchemy from "alchemy";)/;
|
|
44446
44445
|
const alchemyImportMatch = code.match(alchemyImportRegex);
|
|
44447
44446
|
if (alchemyImportMatch) {
|
|
@@ -44451,7 +44450,6 @@ import { CloudflareStateStore } from "alchemy/state";`;
|
|
|
44451
44450
|
}
|
|
44452
44451
|
const lastImportRegex = /import[^;]+from[^;]+;(\s*\n)*/g;
|
|
44453
44452
|
let lastImportMatch;
|
|
44454
|
-
let lastImportEnd = 0;
|
|
44455
44453
|
while ((lastImportMatch = lastImportRegex.exec(code)) !== null) lastImportMatch.index + lastImportMatch[0].length;
|
|
44456
44454
|
const appCallRegex = /const app = await alchemy\("([^"]+)"\);/;
|
|
44457
44455
|
const appMatch = code.match(appCallRegex);
|
|
@@ -50864,6 +50862,7 @@ async function copyTemplate(templateName, context$1) {
|
|
|
50864
50862
|
await import_lib$3.ensureDir(path$6.dirname(destPath));
|
|
50865
50863
|
await import_lib$3.copy(srcPath, destPath);
|
|
50866
50864
|
}
|
|
50865
|
+
await substituteProjectName(context$1);
|
|
50867
50866
|
await updateTemplatePackageJson(context$1);
|
|
50868
50867
|
await addPackageDependencies({
|
|
50869
50868
|
devDependencies: ["alchemy"],
|
|
@@ -50886,6 +50885,12 @@ async function copyTemplate(templateName, context$1) {
|
|
|
50886
50885
|
throwWithContext(error$81, `Failed to copy template '${templateName}'`);
|
|
50887
50886
|
}
|
|
50888
50887
|
}
|
|
50888
|
+
async function substituteProjectName(context$1) {
|
|
50889
|
+
const alchemyFile = join(context$1.path, "alchemy.run.ts");
|
|
50890
|
+
const code = await import_lib$3.readFile(alchemyFile, "utf8");
|
|
50891
|
+
const newCode = code.replace("{projectName}", context$1.name);
|
|
50892
|
+
await import_lib$3.writeFile(alchemyFile, newCode);
|
|
50893
|
+
}
|
|
50889
50894
|
async function updateTemplatePackageJson(context$1) {
|
|
50890
50895
|
const packageJsonPath = join(context$1.path, "package.json");
|
|
50891
50896
|
if (!import_lib$3.existsSync(packageJsonPath)) return;
|
|
@@ -50985,7 +50990,7 @@ const POSTHOG_PROJECT_ID = process.env.POSTHOG_PROJECT_ID ?? "phc_A51Mi7Q63TvnNr
|
|
|
50985
50990
|
//#endregion
|
|
50986
50991
|
//#region package.json
|
|
50987
50992
|
var name = "alchemy";
|
|
50988
|
-
var version = "0.62.
|
|
50993
|
+
var version = "0.62.2";
|
|
50989
50994
|
var license = "Apache-2.0";
|
|
50990
50995
|
var author = "Sam Goodwin <sam@alchemy.run>";
|
|
50991
50996
|
var homepage = "https://alchemy.run";
|
|
@@ -221,7 +221,6 @@ export async function addGitHubWorkflowToAlchemy(
|
|
|
221
221
|
);
|
|
222
222
|
|
|
223
223
|
let code = await fs.readFile(alchemyFilePath, "utf-8");
|
|
224
|
-
code = code.replace("{projectName}", context.name);
|
|
225
224
|
|
|
226
225
|
const alchemyImportRegex = /(import alchemy from "alchemy";)/;
|
|
227
226
|
const alchemyImportMatch = code.match(alchemyImportRegex);
|
|
@@ -233,10 +232,9 @@ import { CloudflareStateStore } from "alchemy/state";`;
|
|
|
233
232
|
|
|
234
233
|
const lastImportRegex = /import[^;]+from[^;]+;(\s*\n)*/g;
|
|
235
234
|
let lastImportMatch;
|
|
236
|
-
let lastImportEnd = 0;
|
|
237
235
|
|
|
238
236
|
while ((lastImportMatch = lastImportRegex.exec(code)) !== null) {
|
|
239
|
-
|
|
237
|
+
lastImportMatch.index + lastImportMatch[0].length;
|
|
240
238
|
}
|
|
241
239
|
|
|
242
240
|
const appCallRegex = /const app = await alchemy\("([^"]+)"\);/;
|
|
@@ -54,6 +54,8 @@ export async function copyTemplate(
|
|
|
54
54
|
await fs.copy(srcPath, destPath);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
await substituteProjectName(context);
|
|
58
|
+
|
|
57
59
|
await updateTemplatePackageJson(context);
|
|
58
60
|
|
|
59
61
|
await addPackageDependencies({
|
|
@@ -83,6 +85,13 @@ export async function copyTemplate(
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
async function substituteProjectName(context: ProjectContext): Promise<void> {
|
|
89
|
+
const alchemyFile = join(context.path, "alchemy.run.ts");
|
|
90
|
+
const code = await fs.readFile(alchemyFile, "utf8");
|
|
91
|
+
const newCode = code.replace("{projectName}", context.name);
|
|
92
|
+
await fs.writeFile(alchemyFile, newCode);
|
|
93
|
+
}
|
|
94
|
+
|
|
86
95
|
async function updateTemplatePackageJson(
|
|
87
96
|
context: ProjectContext,
|
|
88
97
|
): Promise<void> {
|