Skip to content

Add admin hoted app local spec#7027

Merged
alfonso-noriega merged 3 commits intomainfrom
add_admin_config_local_spec
Mar 30, 2026
Merged

Add admin hoted app local spec#7027
alfonso-noriega merged 3 commits intomainfrom
add_admin_config_local_spec

Conversation

@alfonso-noriega
Copy link
Copy Markdown
Contributor

@alfonso-noriega alfonso-noriega commented Mar 17, 2026

WHY are these changes introduced?

The admin extension type was previously hardcoded as a string literal, which prevented proper specification handling and caused inconsistencies in the extension system.

WHAT is this pull request doing?

  • Creates a new AdminSpecIdentifier constant and corresponding specification file for admin extensions
  • Replaces the hardcoded 'admin' string with the proper AdminSpecIdentifier in the configuration extension IDs array
  • Adds the admin specification to the loaded specifications list
  • Implements admin extension as a contract-based module with single UID strategy and copy files build mode
  • Adds a default case to the extension instance UID generation logic
  • Updates the app configuration schema contribution logic to handle specifications without shape definitions
  • Adds uidStrategy parameter support to contract-based module specifications

How to test your changes?

  1. Create an app with an admin section in the toml
  2. Verify the extension builds and deploys correctly
  3. Test that the hosted app copy files step executes during deployment

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Copy Markdown
Contributor Author

alfonso-noriega commented Mar 17, 2026

@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from a25fc78 to f1ff200 Compare March 17, 2026 11:02
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch from 0fd3c26 to 141233b Compare March 17, 2026 11:03
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from f1ff200 to 31060ea Compare March 17, 2026 11:07
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch from 141233b to 06bccee Compare March 17, 2026 11:07
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 31060ea to c22afce Compare March 17, 2026 11:19
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch 2 times, most recently from d13b2b2 to ef2ca4e Compare March 17, 2026 11:20
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from c22afce to 178b934 Compare March 17, 2026 11:20
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch from ef2ca4e to 9c06d65 Compare March 17, 2026 15:51
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 178b934 to 010e9ae Compare March 17, 2026 15:51
@alfonso-noriega alfonso-noriega changed the base branch from add_manifest_to_include_files_step to graphite-base/7027 March 18, 2026 10:45
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 010e9ae to 0de775d Compare March 18, 2026 17:50
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/7027 to add_manifest_to_include_files_step March 18, 2026 17:50
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch from 854f0c7 to f4baca8 Compare March 19, 2026 10:38
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 0de775d to 0420085 Compare March 19, 2026 10:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.39% 15149/18387
🟡 Branches 74.92% 7461/9958
🟢 Functions 81.39% 3805/4675
🟢 Lines 82.78% 14323/17303

Test suite run success

4000 tests passing in 1531 suites.

Report generated by 🧪jest coverage report action from 4acc557

@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 0420085 to 9bb0683 Compare March 19, 2026 12:04
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch 2 times, most recently from c034d57 to 0c42a4b Compare March 20, 2026 09:34
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch 2 times, most recently from c020200 to 6951bbf Compare March 20, 2026 12:49
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch 2 times, most recently from 98db2aa to c211225 Compare March 20, 2026 14:38
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 6951bbf to 206fa23 Compare March 20, 2026 14:38
@alfonso-noriega alfonso-noriega force-pushed the add_manifest_to_include_files_step branch from c211225 to 94743d0 Compare March 23, 2026 10:14
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 206fa23 to 4f587b6 Compare March 23, 2026 10:14
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch 3 times, most recently from 0d033d6 to 22bd069 Compare March 24, 2026 21:04
@alfonso-noriega alfonso-noriega changed the base branch from add_manifest_to_include_files_step to graphite-base/7027 March 24, 2026 23:48
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 22bd069 to 521b27d Compare March 25, 2026 00:13
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/7027 to add_manifest_to_include_files_step March 25, 2026 00:13
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from 521b27d to d52a5f6 Compare March 25, 2026 12:58
@github-actions
Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/node/custom-oclif-loader.d.ts
import { Command, Config } from '@oclif/core';
import { Options } from '@oclif/core/interfaces';
export declare class ShopifyConfig extends Config {
    constructor(options: Options);
    customPriority(commands: Command.Loadable[]): Command.Loadable | undefined;
}

Existing type declarations

packages/cli-kit/dist/public/node/cli-launcher.d.ts
@@ -3,7 +3,7 @@ interface Options {
     argv?: string[];
 }
 /**
- * Launches the CLI.
+ * Launches the CLI through our custom OCLIF loader.
  *
  * @param options - Options.
  * @returns A promise that resolves when the CLI has been launched.
packages/cli-kit/dist/public/node/path.d.ts
 import type { URL } from 'url';
 /**
  * Joins a list of paths together.
  *
  * @param paths - Paths to join.
  * @returns Joined path.
  */
 export declare function joinPath(...paths: string[]): string;
 /**
  * Normalizes a path.
  *
  * @param path - Path to normalize.
  * @returns Normalized path.
  */
 export declare function normalizePath(path: string): string;
 /**
  * Resolves a list of paths together.
  *
  * @param paths - Paths to resolve.
  * @returns Resolved path.
  */
 export declare function resolvePath(...paths: string[]): string;
 /**
  * Returns the relative path from one path to another.
  *
  * @param from - Path to resolve from.
  * @param to - Path to resolve to.
  * @returns Relative path.
  */
 export declare function relativePath(from: string, to: string): string;
 /**
  * Returns whether the path is absolute.
  *
  * @param path - Path to check.
  * @returns Whether the path is absolute.
  */
 export declare function isAbsolutePath(path: string): boolean;
 /**
  * Returns the directory name of a path.
  *
  * @param path - Path to get the directory name of.
  * @returns Directory name.
  */
 export declare function dirname(path: string): string;
 /**
  * Returns the base name of a path.
  *
  * @param path - Path to get the base name of.
  * @param ext - Optional extension to remove from the result.
  * @returns Base name.
  */
 export declare function basename(path: string, ext?: string): string;
 /**
  * Returns the extension of the path.
  *
  * @param path - Path to get the extension of.
  * @returns Extension.
  */
 export declare function extname(path: string): string;
 /**
  * Parses a path into its components (root, dir, base, ext, name).
  *
  * @param path - Path to parse.
  * @returns Parsed path object.
  */
 export declare function parsePath(path: string): {
     root: string;
     dir: string;
     base: string;
     ext: string;
     name: string;
 };
 /**
  * Given an absolute filesystem path, it makes it relative to
  * the current working directory. This is useful when logging paths
  * to allow the users to click on the file and let the OS open it
  * in the editor of choice.
  *
  * @param path - Path to relativize.
  * @param dir - Current working directory.
  * @returns Relativized path.
  */
 export declare function relativizePath(path: string, dir?: string): string;
 /**
  * Given 2 paths, it returns whether the second path is a subpath of the first path.
  *
  * @param mainPath - The main path.
  * @param subpath - The subpath.
  * @returns Whether the subpath is a subpath of the main path.
  */
 export declare function isSubpath(mainPath: string, subpath: string): boolean;
 /**
  * Given a module's import.meta.url it returns the directory containing the module.
  *
  * @param moduleURL - The value of import.meta.url in the context of the caller module.
  * @returns The path to the directory containing the caller module.
  */
 export declare function moduleDirectory(moduleURL: string | URL): string;
 /**
  * When running a script using `npm run`, something interesting happens. If the current
  * folder does not have a `package.json` or a `node_modules` folder, npm will traverse
  * the directory tree upwards until it finds one. Then it will run the script and set
  * `process.cwd()` to that folder, while the actual path is stored in the INIT_CWD
  * environment variable (see here: https://docs.npmjs.com/cli/v9/commands/npm-run-script#description).
  *
  * @returns The path to the current working directory.
  */
 export declare function cwd(): string;
 /**
  * Tries to get the value of the `--path` argument, if provided.
  *
  * @param argv - The arguments to search for the `--path` argument.
  * @returns The value of the `--path` argument, if provided.
  */
 export declare function sniffForPath(argv?: string[]): string | undefined;
 /**
  * Returns whether the `--json` or `-j` flags are present in the arguments.
  *
  * @param argv - The arguments to search for the `--json` and `-j` flags.
  * @returns Whether the `--json` or `-j` flag is present in the arguments.
  */
 export declare function sniffForJson(argv?: string[]): boolean;
+/**
+ * Removes any `..` traversal segments from a relative path and calls `warn`
+ * if any were stripped. Normal `..` that cancel out within the path (e.g.
+ * `foo/../bar` → `bar`) are collapsed but never allowed to escape the root.
+ * Both `/` and `\` are treated as separators for cross-platform safety.
+ *
+ * @param input - The relative path to sanitize.
+ * @param warn - Called with a human-readable warning when traversal segments are removed.
+ * @returns The sanitized path (may be an empty string if all segments were traversal).
+ */
+export declare function sanitizeRelativePath(input: string, warn: (msg: string) => void): string;

@alfonso-noriega alfonso-noriega changed the base branch from add_manifest_to_include_files_step to graphite-base/7027 March 25, 2026 19:57
@alfonso-noriega alfonso-noriega force-pushed the add_admin_config_local_spec branch from d52a5f6 to c5a0afc Compare March 26, 2026 14:11
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/7027 to add_manifest_to_include_files_step March 26, 2026 14:12
Copy link
Copy Markdown
Contributor

@elanalynn elanalynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎩 'd. Everything works. Deploy is successful and the assets are uploaded to the dev bucket.

@alfonso-noriega
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @alfonso-noriega! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260327142115

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@alfonso-noriega alfonso-noriega changed the base branch from add_manifest_to_include_files_step to graphite-base/7027 March 27, 2026 14:40
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @alfonso-noriega! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260327144705

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

return {
admin: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static_root: (remoteContent as any).admin.static_root,
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should probably validate here that admin is not null, otherwise it could crash

@alfonso-noriega
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @alfonso-noriega! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260330090510

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants