Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dot env files in windows #8086

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/frameworks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
FrameworkContext,
FrameworksOptions,
} from "./interfaces";
import { logWarning } from "../utils";
import { IS_WINDOWS, logWarning } from "../utils";
import { ensureTargeted } from "../functions/ensureTargeted";
import { isDeepStrictEqual } from "util";
import { resolveProjectPath } from "../projectPath";
Expand All @@ -61,7 +61,7 @@
/**
*
*/
export async function discover(dir: string, warn = true) {

Check warning on line 64 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
const allFrameworkTypes = [
...new Set(Object.values(WebFrameworks).map(({ type }) => type)),
].sort();
Expand Down Expand Up @@ -91,18 +91,18 @@
function memoizeBuild(
dir: string,
build: Framework["build"],
deps: any[],

Check warning on line 94 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
target: string,
context: FrameworkContext,
): ReturnType<Framework["build"]> {
const key = [dir, ...deps];

Check warning on line 98 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe spread of an `any` value in an array
for (const existingKey of BUILD_MEMO.keys()) {
if (isDeepStrictEqual(existingKey, key)) {
return BUILD_MEMO.get(existingKey) as ReturnType<Framework["build"]>;
}
}
const value = build(dir, target, context);
BUILD_MEMO.set(key, value);

Check warning on line 105 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any[]` assigned to a parameter of type `string[]`
return value;
}

Expand All @@ -110,7 +110,7 @@
* Use a function to ensure the same codebase name is used here and
* during hosting deploy.
*/
export function generateSSRCodebaseId(site: string) {

Check warning on line 113 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
return `firebase-frameworks-${site}`;
}

Expand Down Expand Up @@ -176,7 +176,7 @@
`Hosting config for site ${site} places server-side content in region ${ssrRegion} which is not known. Valid regions are ${validRegions}`,
);
}
const getProjectPath = (...args: string[]) => join(projectRoot, source, ...args);

Check warning on line 179 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
// Combined traffic tag (19 chars) and functionId cannot exceed 46 characters.
const functionId = `ssr${site.toLowerCase().replace(/-/g, "").substring(0, 20)}`;
const usesFirebaseAdminSdk = !!findDependency("firebase-admin", { cwd: getProjectPath() });
Expand Down Expand Up @@ -214,11 +214,11 @@
if (selectedSite) {
const { appId } = selectedSite;
if (appId) {
firebaseConfig = isDemoProject

Check warning on line 217 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
? constructDefaultWebSetup(project)
: await getAppConfig(appId, AppPlatform.WEB);
firebaseDefaults ||= {};
firebaseDefaults.config = firebaseConfig;

Check warning on line 221 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
} else {
const defaultConfig = await implicitInit(options);
if (defaultConfig.json) {
Expand All @@ -227,7 +227,7 @@
You can link a Web app to a Hosting site here https://console.firebase.google.com/project/${project}/settings/general/web`,
);
firebaseDefaults ||= {};
firebaseDefaults.config = JSON.parse(defaultConfig.json);

Check warning on line 230 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
} else {
// N.B. None of us know when this can ever happen and the deploy would
// still succeed. Maaaaybe if someone tried calling firebase serve
Expand Down Expand Up @@ -363,7 +363,7 @@

const codebase = generateSSRCodebaseId(site);
const existingFunctionsConfig = options.config.get("functions")
? [].concat(options.config.get("functions"))

Check warning on line 366 in src/frameworks/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `ConcatArray<never>`
: [];
options.config.set("functions", [
...existingFunctionsConfig,
Expand Down Expand Up @@ -525,7 +525,7 @@
}`.trimStart(),
);

const envs = await glob(getProjectPath(".env.*"));
const envs = await glob(getProjectPath(".env.*"), { windowsPathsNoEscape: IS_WINDOWS });

await Promise.all(envs.map((path) => copyFile(path, join(functionsDist, basename(path)))));

Expand Down
Loading