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 speedscope bundling #5214

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"ignoreDependencies": [
"eslint-plugin-react",
"eslint-plugin-react-hooks",
"@shopify/cli",
"@shopify/cli-hydrogen",
"@shopify/theme-check-node",
"@shopify/theme-check-docs-updater"
Expand Down Expand Up @@ -193,8 +194,7 @@
],
"project": "**/*.ts!",
"ignoreDependencies": [
"@ast-grep/napi",
"speedscope"
"@ast-grep/napi"
],
"vite": {
"config": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export type ThemeRole =
* publishing are restricted until the merchant resolves the licensing issue.
*/
| 'LOCKED'
/** TThe currently published theme. There can only be one main theme at any time. */
/** The currently published theme. There can only be one main theme at any time. */
| 'MAIN'
/** The currently published theme that is only accessible to a mobile client. */
| 'MOBILE'
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/bin/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ esBuild({
from: ['../app/assets/**/*'],
to: ['./dist/assets'],
},
{
from: ['../theme/assets/**/*'],
to: ['./dist/assets'],
},
{
from: ['../app/templates/**/*'],
to: ['./dist/templates'],
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"./package.json": "./package.json"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding this so that we can require.resolve('@shopify/cli/package.json') later.
If for some reason this is not desired, we can use findPathUp like we do in Hydrogen (we needed that in Hydrogen because the package can be run globally bundled, or locally, so require.resolve wouldn't be enough).

},
"main": "src/index.js",
"module": "src/index.js",
Expand Down Expand Up @@ -102,7 +103,6 @@
},
"dependencies": {
"@ast-grep/napi": "0.33.0",
"speedscope": "1.21.0",
"esbuild": "0.24.0"
},
"devDependencies": {
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/theme/assets/speedscope/demangle-cpp.1768f4cc.js

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
324 changes: 324 additions & 0 deletions packages/theme/assets/speedscope/file-format-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"CloseFrameEvent": {
"properties": {
"at": {
"title": "at",
"type": "number"
},
"frame": {
"title": "frame",
"type": "number"
},
"type": {
"enum": [
"C"
],
"title": "type",
"type": "string"
}
},
"required": [
"at",
"frame",
"type"
],
"title": "CloseFrameEvent",
"type": "object"
},
"FileFormat.EventType": {
"enum": [
"C",
"O"
],
"title": "FileFormat.EventType",
"type": "string"
},
"FileFormat.EventedProfile": {
"properties": {
"endValue": {
"title": "endValue",
"type": "number"
},
"events": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/OpenFrameEvent"
},
{
"$ref": "#/definitions/CloseFrameEvent"
}
]
},
"title": "events",
"type": "array"
},
"name": {
"title": "name",
"type": "string"
},
"startValue": {
"title": "startValue",
"type": "number"
},
"type": {
"enum": [
"evented"
],
"title": "type",
"type": "string"
},
"unit": {
"$ref": "#/definitions/FileFormat.ValueUnit",
"title": "unit"
}
},
"required": [
"endValue",
"events",
"name",
"startValue",
"type",
"unit"
],
"title": "FileFormat.EventedProfile",
"type": "object"
},
"FileFormat.File": {
"properties": {
"$schema": {
"enum": [
"https://www.speedscope.app/file-format-schema.json"
],
"title": "$schema",
"type": "string"
},
"activeProfileIndex": {
"title": "activeProfileIndex",
"type": "number"
},
"exporter": {
"title": "exporter",
"type": "string"
},
"name": {
"title": "name",
"type": "string"
},
"profiles": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/FileFormat.EventedProfile"
},
{
"$ref": "#/definitions/FileFormat.SampledProfile"
}
]
},
"title": "profiles",
"type": "array"
},
"shared": {
"properties": {
"frames": {
"items": {
"$ref": "#/definitions/FileFormat.Frame"
},
"title": "frames",
"type": "array"
}
},
"required": [
"frames"
],
"title": "shared",
"type": "object"
}
},
"required": [
"$schema",
"profiles",
"shared"
],
"title": "FileFormat.File",
"type": "object"
},
"FileFormat.Frame": {
"properties": {
"col": {
"title": "col",
"type": "number"
},
"file": {
"title": "file",
"type": "string"
},
"line": {
"title": "line",
"type": "number"
},
"name": {
"title": "name",
"type": "string"
}
},
"required": [
"name"
],
"title": "FileFormat.Frame",
"type": "object"
},
"FileFormat.IProfile": {
"properties": {
"type": {
"$ref": "#/definitions/FileFormat.ProfileType",
"title": "type"
}
},
"required": [
"type"
],
"title": "FileFormat.IProfile",
"type": "object"
},
"FileFormat.Profile": {
"anyOf": [
{
"$ref": "#/definitions/FileFormat.EventedProfile"
},
{
"$ref": "#/definitions/FileFormat.SampledProfile"
}
]
},
"FileFormat.ProfileType": {
"enum": [
"evented",
"sampled"
],
"title": "FileFormat.ProfileType",
"type": "string"
},
"FileFormat.SampledProfile": {
"properties": {
"endValue": {
"title": "endValue",
"type": "number"
},
"name": {
"title": "name",
"type": "string"
},
"samples": {
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"title": "samples",
"type": "array"
},
"startValue": {
"title": "startValue",
"type": "number"
},
"type": {
"enum": [
"sampled"
],
"title": "type",
"type": "string"
},
"unit": {
"$ref": "#/definitions/FileFormat.ValueUnit",
"title": "unit"
},
"weights": {
"items": {
"type": "number"
},
"title": "weights",
"type": "array"
}
},
"required": [
"endValue",
"name",
"samples",
"startValue",
"type",
"unit",
"weights"
],
"title": "FileFormat.SampledProfile",
"type": "object"
},
"FileFormat.ValueUnit": {
"enum": [
"bytes",
"microseconds",
"milliseconds",
"nanoseconds",
"none",
"seconds"
],
"title": "FileFormat.ValueUnit",
"type": "string"
},
"IEvent": {
"properties": {
"at": {
"title": "at",
"type": "number"
},
"type": {
"$ref": "#/definitions/FileFormat.EventType",
"title": "type"
}
},
"required": [
"at",
"type"
],
"title": "IEvent",
"type": "object"
},
"OpenFrameEvent": {
"properties": {
"at": {
"title": "at",
"type": "number"
},
"frame": {
"title": "frame",
"type": "number"
},
"type": {
"enum": [
"O"
],
"title": "type",
"type": "string"
}
},
"required": [
"at",
"frame",
"type"
],
"title": "OpenFrameEvent",
"type": "object"
},
"SampledStack": {
"items": {
"type": "number"
},
"type": "array"
}
},
"$ref": "#/definitions/FileFormat.File"
}
Loading
Loading