build(docs-infra): always specify a landing file for StackBlitz projects (#34553)
The StackBlitz API (which we use to generate StackBlitz projects on the fly, when a user clicks on a live example link in the docs) allows specifying the file to open in the editor by passing a query param. If no file is specified, StackBlitz opens a default one. In the past, it used to be `main.ts` and nowadays it seems to be `app.component.ts`. StackBlitz builder, the tool that we use to generate the StackBlitz projects, allows specifying the primary file by setting the `file` property in the corresponding `stackblitz.json`. Previously, if the `file` property was not set, StackBlitz builder would not specify a file, thus falling back on StackBlitz's default behavior. This was not great, because the default behavior may change unexpectedly is the future to something that is less useful for our users. This commit change StackBlitz builder to always specify a primary file. If no file is specified in `stackblitz.json`, the builder will look for the first file that exists in the example from a list of predefined files. Partially addresses #22357. PR Close #34553
This commit is contained in:
parent
77c53559d0
commit
f49b45832c
|
@ -5,6 +5,5 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["Accessibility"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2,3].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["animations"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/app.module.ts"
|
||||
"file": "src/app/hero-list.component.html"
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2,3].*"
|
||||
],
|
||||
"file": "src/app/highlight.directive.ts",
|
||||
"tags": ["attribute", "directive"]
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
"!**/*.native.*",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/hero-app.component.ts",
|
||||
"tags": ["CSS"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags":["cookbook"]
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
"!**/*.[0,1,2,3,4].*",
|
||||
"!**/dummy.module.ts"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["dependency", "di"]
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
"!**/app-ctor.component.ts",
|
||||
"!**/*.[1,2,3].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["Template"]
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
"description": "Second authors style guide stackblitz (non-executing)",
|
||||
"files": [
|
||||
"src/index.2.html"
|
||||
"src/main.2.ts",
|
||||
"src/index.2.html",
|
||||
"src/styles.css"
|
||||
],
|
||||
"main": "src/index.2.html",
|
||||
"file": "src/index.html",
|
||||
"tags": ["author", "style guide"]
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags":["cookbook component"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags":["cookbook"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/popup.service.ts",
|
||||
"tags":["cookbook"]
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
"!**/*.d.ts",
|
||||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
]
|
||||
],
|
||||
"file": "src/app/app.component.ts"
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
"files":[
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
]
|
||||
],
|
||||
"file": "src/app/app.component.ts"
|
||||
}
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
"files":[
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
]
|
||||
],
|
||||
"file": "src/app/hero-form/hero-form.component.html"
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[0-9].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["Angular", "getting started", "tutorial"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[0-9].*"
|
||||
],
|
||||
"file": "src/app/product-list/product-list.component.html",
|
||||
"tags": ["Angular", "getting started", "tutorial"]
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["dependency", "injection"]
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
"files":[
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js",
|
||||
|
||||
"!src/testing/*.*",
|
||||
"!src/index-specs.html",
|
||||
"!src/main-specs.ts"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["http"]
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"file": "src/app/app-routing.module.ts",
|
||||
"tags": ["lazy loading"]
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"file": "src/app/app.module.ts",
|
||||
"tags": ["NgModules"]
|
||||
}
|
||||
|
|
|
@ -11,5 +11,6 @@
|
|||
"!src/app/main-final.ts",
|
||||
"!src/index-final.html"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["reactive", "forms"]
|
||||
}
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
"!src/app/crisis-list/*.*",
|
||||
"!src/app/hero-list/*.*"
|
||||
],
|
||||
"tags": ["router"]
|
||||
"tags": ["router"],
|
||||
"file": "src/app/app-routing.module.ts"
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
"!**/*.d.ts",
|
||||
"!**/*.js"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["security"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": [ "cookbook" ]
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"!**/*.js",
|
||||
"!src/app/scrap.txt"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": [
|
||||
"structural", "directives", "template", "ngIf",
|
||||
"ngSwitch", "ngFor"
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/app.component.ts",
|
||||
"tags": ["tutorial", "tour", "heroes"]
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
"!**/*.[1].*",
|
||||
"!**/dummy.module.ts"
|
||||
],
|
||||
"file": "src/app/heroes/heroes.component.html",
|
||||
"tags": ["tutorial", "tour", "heroes"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/heroes/heroes.component.html",
|
||||
"tags": ["tutorial", "tour", "heroes"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/heroes/heroes.component.html",
|
||||
"tags": ["tutorial", "tour", "heroes"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2].*"
|
||||
],
|
||||
"file": "src/app/hero.service.ts",
|
||||
"tags": ["tutorial", "tour", "heroes"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[0,1,2,3].*"
|
||||
],
|
||||
"file": "src/app/app-routing.module.ts",
|
||||
"tags": ["tutorial", "tour", "heroes", "router"]
|
||||
}
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
"!**/*.js",
|
||||
"!**/*.[1,2].*"
|
||||
],
|
||||
"file": "src/app/hero.service.ts",
|
||||
"tags": ["tutorial", "tour", "heroes", "http"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue