netlify 27.7.0 → 27.8.1
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.
|
@@ -6,6 +6,7 @@ import { startSpinner } from '../../lib/spinner.js';
|
|
|
6
6
|
import { chalk, logAndThrowError, exit, log, netlifyCommand } from '../../utils/command-helpers.js';
|
|
7
7
|
import { ensureNetlifyIgnore } from '../../utils/gitignore.js';
|
|
8
8
|
import getRepoData from '../../utils/get-repo-data.js';
|
|
9
|
+
import { matchesRepoUrl } from '../../utils/match-repo-url.js';
|
|
9
10
|
import { isInteractive } from '../../utils/scripted-commands.js';
|
|
10
11
|
import { track } from '../../utils/telemetry/index.js';
|
|
11
12
|
const findSiteByRepoUrl = async (api, repoUrl) => {
|
|
@@ -16,7 +17,8 @@ const findSiteByRepoUrl = async (api, repoUrl) => {
|
|
|
16
17
|
spinner.error();
|
|
17
18
|
return logAndThrowError(`You don't have any projects yet. Run ${chalk.cyanBright(`${netlifyCommand()} sites:create`)} to create a project.`);
|
|
18
19
|
}
|
|
19
|
-
const matchingSites = sites.filter(({ build_settings: buildSettings = {} }) => repoUrl === buildSettings.repo_url
|
|
20
|
+
const matchingSites = sites.filter(({ build_settings: buildSettings = {} }) => repoUrl === buildSettings.repo_url ||
|
|
21
|
+
(buildSettings.provider === 'manual' && matchesRepoUrl(repoUrl, buildSettings.repo_url)));
|
|
20
22
|
if (matchingSites.length === 0) {
|
|
21
23
|
spinner.error();
|
|
22
24
|
log(chalk.redBright.bold.underline(`No matching project found`));
|
package/dist/utils/login-url.js
CHANGED
|
@@ -2,7 +2,12 @@ import { getDrivingAgent } from './agent-detection.js';
|
|
|
2
2
|
// By contract these two hold only a non-sensitive agent name[@version]. Every other marker's value is a flag,
|
|
3
3
|
// a session or run id, or a path, none of which may reach a URL.
|
|
4
4
|
const SOURCES_WITH_ANNOUNCED_VALUE = new Set(['NETLIFY_AGENT', 'AI_AGENT']);
|
|
5
|
+
const LOGIN_SOURCES = new Set(['mcp']);
|
|
5
6
|
const sanitizeUtmTerm = (raw) => raw.replace(/[^A-Za-z0-9_.:@-]/g, '').slice(0, 64);
|
|
7
|
+
const getUtmSource = (env) => {
|
|
8
|
+
const source = env.NETLIFY_LOGIN_SOURCE;
|
|
9
|
+
return source !== undefined && LOGIN_SOURCES.has(source) ? source : 'cli';
|
|
10
|
+
};
|
|
6
11
|
const getUtmTerm = (source, env) => {
|
|
7
12
|
const value = SOURCES_WITH_ANNOUNCED_VALUE.has(source) ? env[source] : undefined;
|
|
8
13
|
return sanitizeUtmTerm(value ? `${source}:${value}` : source);
|
|
@@ -12,7 +17,7 @@ export const buildAuthorizeUrl = (ticketId, env = process.env) => {
|
|
|
12
17
|
const params = new URLSearchParams({
|
|
13
18
|
response_type: 'ticket',
|
|
14
19
|
ticket: ticketId,
|
|
15
|
-
utm_source:
|
|
20
|
+
utm_source: getUtmSource(env),
|
|
16
21
|
utm_campaign: 'integrations',
|
|
17
22
|
});
|
|
18
23
|
const agent = getDrivingAgent(env);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import parseGithubUrl from 'parse-github-url';
|
|
2
|
+
const BARE_OWNER_REPO_PATTERN = /^[^\s/]+\/[^\s/]+$/;
|
|
3
|
+
export const matchesRepoUrl = (inputUrl, storedRepoUrl) => {
|
|
4
|
+
if (!storedRepoUrl) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
const parsedInput = parseGithubUrl(inputUrl);
|
|
8
|
+
if (!parsedInput?.owner || !parsedInput.name) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (BARE_OWNER_REPO_PATTERN.test(storedRepoUrl)) {
|
|
12
|
+
const normalizedStoredRepoUrl = storedRepoUrl.replace(/\.git$/i, '');
|
|
13
|
+
return normalizedStoredRepoUrl.toLowerCase() === `${parsedInput.owner}/${parsedInput.name}`.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
const parsedStored = parseGithubUrl(storedRepoUrl);
|
|
16
|
+
if (!parsedStored?.owner || !parsedStored.name || !parsedStored.host) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return (parsedInput.host?.toLowerCase() === parsedStored.host.toLowerCase() &&
|
|
20
|
+
parsedInput.owner.toLowerCase() === parsedStored.owner.toLowerCase() &&
|
|
21
|
+
parsedInput.name.toLowerCase() === parsedStored.name.toLowerCase());
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=match-repo-url.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.8.1",
|
|
4
4
|
"description": "Netlify command line tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"@fastify/static": "^10.0.0",
|
|
55
55
|
"@netlify/ai": "^1.0.1",
|
|
56
56
|
"@netlify/api": "^15.1.2",
|
|
57
|
-
"@netlify/blobs": "^11.0
|
|
58
|
-
"@netlify/build": "^
|
|
57
|
+
"@netlify/blobs": "^11.1.0",
|
|
58
|
+
"@netlify/build": "^37.0.0",
|
|
59
59
|
"@netlify/build-info": "^11.3.0",
|
|
60
60
|
"@netlify/config": "^25.2.5",
|
|
61
|
-
"@netlify/dev": "^5.1.
|
|
61
|
+
"@netlify/dev": "^5.1.2",
|
|
62
62
|
"@netlify/dev-utils": "^6.0.1",
|
|
63
63
|
"@netlify/edge-bundler": "^16.0.4",
|
|
64
64
|
"@netlify/edge-functions": "^4.0.0",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@netlify/local-functions-proxy": "^2.0.3",
|
|
69
69
|
"@netlify/redirect-parser": "^16.1.1",
|
|
70
70
|
"@netlify/server-dev": "^0.1.1",
|
|
71
|
-
"@netlify/zip-it-and-ship-it": "^
|
|
71
|
+
"@netlify/zip-it-and-ship-it": "^16.0.0",
|
|
72
72
|
"@octokit/rest": "^22.0.0",
|
|
73
|
-
"@opentelemetry/api": "
|
|
73
|
+
"@opentelemetry/api": "~1.9.0",
|
|
74
74
|
"@pnpm/tabtab": "^0.5.4",
|
|
75
75
|
"ansi-escapes": "^7.3.0",
|
|
76
76
|
"ansi-to-html": "^0.7.2",
|