Skip to content

Commit

Permalink
Revert "Update templates to avoid devDependencies and :global (#4544)" (
Browse files Browse the repository at this point in the history
#4575)

This reverts commit ca2d072.
  • Loading branch information
Dan Jutan authored Aug 31, 2022
1 parent ca2d072 commit 23d4f80
Show file tree
Hide file tree
Showing 30 changed files with 2,689 additions and 2,644 deletions.
4 changes: 2 additions & 2 deletions examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1"
"devDependencies": {
"astro": "^1.1.2"
}
}
10 changes: 3 additions & 7 deletions examples/basics/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ const { title } = Astro.props;
margin: 0;
}


</style>

<style is:global>
h1 {
:global(h1) {
font-size: var(--font-size-xl);
}

h2 {
:global(h2) {
font-size: var(--font-size-lg);
}

code {
:global(code) {
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
Expand Down
8 changes: 4 additions & 4 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1",
"@astrojs/mdx": "^0.10.2",
"devDependencies": {
"@astrojs/mdx": "^0.10.3",
"@astrojs/rss": "^1.0.0",
"@astrojs/sitemap": "^1.0.0"
"@astrojs/sitemap": "^1.0.0",
"astro": "^1.1.2"
}
}
5 changes: 0 additions & 5 deletions examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"build": "astro --root demo build",
"serve": "astro --root demo preview"
},
<<<<<<< HEAD
"dependencies": {
"astro": "^1.1.1"
=======
"devDependencies": {
"astro": "^1.1.2"
>>>>>>> main
}
}
16 changes: 9 additions & 7 deletions examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"@astrojs/react": "^1.1.0",
"@astrojs/preact": "^1.0.2",
"@algolia/client-search": "^4.13.1",
"@docsearch/css": "^3.1.0",
"@docsearch/react": "^3.1.0",
"@types/react": "^17.0.45",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0"
},
"devDependencies": {
"@astrojs/preact": "^1.0.2",
"@types/node": "^18.0.0",
"@types/react-dom": "^18.0.0"
"@types/react-dom": "^18.0.0",
"@astrojs/react": "^1.1.1",
"astro": "^1.1.2"
}
}
10 changes: 4 additions & 6 deletions examples/docs/src/components/Header/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,13 @@ const lang = getLanguageFromURL(currentPage);
max-width: 200px;
}

:global(.search-item > *) {
flex-grow: 1;
}

@media (min-width: 50em) {
.search-item {
max-width: 400px;
}
}
</style>

<style is:global>
.search-item > * {
flex-grow: 1;
}
</style>
50 changes: 23 additions & 27 deletions examples/docs/src/components/LeftSidebar/LeftSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,25 @@ const sidebar = SIDEBAR[langCode];

<nav aria-labelledby="grid-left">
<ul class="nav-groups">
{
Object.entries(sidebar).map(([header, children]) => (
<li>
<div class="nav-group">
<h2>{header}</h2>
<ul>
{children.map((child) => {
const url = Astro.site?.pathname + child.link;
return (
<li class="nav-link">
<a href={url} aria-current={currentPageMatch === child.link ? 'page' : false}>
{child.text}
</a>
</li>
);
})}
</ul>
</div>
</li>
))
}
{Object.entries(sidebar).map(([header, children]) => (
<li>
<div class="nav-group">
<h2>{header}</h2>
<ul>
{children.map((child) => {
const url = Astro.site?.pathname + child.link;
return (
<li class="nav-link">
<a href={url} aria-current={currentPageMatch === child.link ? 'page' : false}>
{child.text}
</a>
</li>
);
})}
</ul>
</div>
</li>
))}
</ul>
</nav>

Expand Down Expand Up @@ -103,15 +101,13 @@ const sidebar = SIDEBAR[langCode];
font-weight: 600;
}

:global(:root.theme-dark) .nav-link a[aria-current='page'] {
color: hsla(var(--color-base-white), 100%, 1);
}

@media (min-width: 50em) {
.nav-groups {
padding: 0;
}
}
</style>

<style is:global>
:root.theme-dark .nav-link a[aria-current='page'] {
color: hsla(var(--color-base-white), 100%, 1);
}
</style>
29 changes: 14 additions & 15 deletions examples/docs/src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
overflow-x: hidden;
}

.layout :global(> *) {
width: 100%;
height: 100%;
}

.grid-sidebar {
height: 100vh;
position: sticky;
Expand All @@ -73,6 +78,15 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
display: none;
}

:global(.mobile-sidebar-toggle) {
overflow: hidden;
}

:global(.mobile-sidebar-toggle) #grid-left {
display: block;
top: 2rem;
}

@media (min-width: 50em) {
.layout {
overflow: initial;
Expand Down Expand Up @@ -102,21 +116,6 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
}
}
</style>
<style is:global>
.layout > * {
width: 100%;
height: 100%;
}

.mobile-sidebar-toggle {
overflow: hidden;
}

.mobile-sidebar-toggle #grid-left {
display: block;
top: 2rem;
}
</style>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions examples/env-vars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1"
"devDependencies": {
"astro": "^1.1.2"
}
}
11 changes: 6 additions & 5 deletions examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1",
"alpinejs": "^3.10.2",
"devDependencies": {
"@astrojs/alpinejs": "^0.1.1",
"@types/alpinejs": "^3.7.0"
}
"@types/alpinejs": "^3.7.0",
"alpinejs": "^3.10.2",
"astro": "^1.1.2"
},
"dependencies": {}
}
10 changes: 6 additions & 4 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/lit": "^1.0.1",
"astro": "^1.1.2"
},
"dependencies": {
"astro": "^1.1.1",
"lit": "^2.2.5",
"@astrojs/lit": "^1.0.0",
"@webcomponents/template-shadowroot": "^0.1.0"
"@webcomponents/template-shadowroot": "^0.1.0",
"lit": "^2.2.5"
}
}
11 changes: 1 addition & 10 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"preview": "astro preview",
"astro": "astro"
},
<<<<<<< HEAD
=======
"devDependencies": {
"@astrojs/preact": "^1.0.2",
"@astrojs/react": "^1.1.1",
Expand All @@ -19,19 +17,12 @@
"@astrojs/vue": "^1.0.0",
"astro": "^1.1.2"
},
>>>>>>> main
"dependencies": {
"astro": "^1.1.1",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"solid-js": "^1.4.3",
"svelte": "^3.48.0",
"vue": "^3.2.37",
"@astrojs/preact": "^1.0.2",
"@astrojs/react": "^1.1.0",
"@astrojs/solid-js": "^1.1.0",
"@astrojs/svelte": "^1.0.0",
"@astrojs/vue": "^1.0.0"
"vue": "^3.2.37"
}
}
8 changes: 5 additions & 3 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/preact": "^1.0.2",
"astro": "^1.1.2"
},
"dependencies": {
"astro": "^1.1.1",
"preact": "^10.7.3",
"@astrojs/preact": "^1.0.2"
"preact": "^10.7.3"
}
}
12 changes: 7 additions & 5 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/react": "^1.1.1",
"@types/react": "^18.0.10",
"@types/react-dom": "^18.0.5",
"astro": "^1.1.2"
},
"dependencies": {
"astro": "^1.1.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"@astrojs/react": "^1.1.0",
"@types/react": "^18.0.10",
"@types/react-dom": "^18.0.5"
"react-dom": "^18.1.0"
}
}
8 changes: 5 additions & 3 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/solid-js": "^1.1.0",
"astro": "^1.1.2"
},
"dependencies": {
"astro": "^1.1.1",
"solid-js": "^1.4.3",
"@astrojs/solid-js": "^1.1.0"
"solid-js": "^1.4.3"
}
}
8 changes: 5 additions & 3 deletions examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"svelte": "^3.48.0",
"devDependencies": {
"@astrojs/svelte": "^1.0.0",
"astro": "^1.1.1"
"astro": "^1.1.2"
},
"dependencies": {
"svelte": "^3.48.0"
}
}
8 changes: 5 additions & 3 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/vue": "^1.0.0",
"astro": "^1.1.2"
},
"dependencies": {
"astro": "^1.1.1",
"vue": "^3.2.37",
"@astrojs/vue": "^1.0.0"
"vue": "^3.2.37"
}
}
4 changes: 2 additions & 2 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1"
"devDependencies": {
"astro": "^1.1.2"
}
}
4 changes: 2 additions & 2 deletions examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"astro": "^1.1.1"
"devDependencies": {
"astro": "^1.1.2"
}
}
Loading

0 comments on commit 23d4f80

Please sign in to comment.