astro 1.1.3 → 1.1.4

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.
@@ -1,4 +1,4 @@
1
- import { prependForwardSlash } from "../path.js";
1
+ import { prependForwardSlash, removeFileExtension } from "../path.js";
2
2
  import { viteID } from "../util.js";
3
3
  function createBuildInternals() {
4
4
  const hoistedScriptIdToHoistedMap = /* @__PURE__ */ new Map();
@@ -45,8 +45,12 @@ function* getPageDatasByChunk(internals, chunk) {
45
45
  function* getPageDatasByClientOnlyID(internals, viteid) {
46
46
  const pagesByClientOnly = internals.pagesByClientOnly;
47
47
  if (pagesByClientOnly.size) {
48
- const pathname = `/@fs${prependForwardSlash(viteid)}`;
49
- const pageBuildDatas = pagesByClientOnly.get(pathname);
48
+ let pathname = `/@fs${prependForwardSlash(viteid)}`;
49
+ let pageBuildDatas = pagesByClientOnly.get(viteid);
50
+ if (!pageBuildDatas) {
51
+ pathname = `/@fs${prependForwardSlash(removeFileExtension(viteid))}`;
52
+ pageBuildDatas = pagesByClientOnly.get(pathname);
53
+ }
50
54
  if (pageBuildDatas) {
51
55
  for (const pageData of pageBuildDatas) {
52
56
  yield pageData;
@@ -23,9 +23,9 @@ async function staticBuild(opts) {
23
23
  if (isModeServerWithNoAdapter(opts.astroConfig)) {
24
24
  throw new Error(`Cannot use \`output: 'server'\` without an adapter.
25
25
  Install and configure the appropriate server adapter for your final deployment.
26
- Example:
26
+ Learn more: https://docs.astro.build/en/guides/server-side-rendering/
27
27
 
28
- // astro.config.js
28
+ // Example: astro.config.js
29
29
  import netlify from '@astrojs/netlify';
30
30
  export default {
31
31
  output: 'server',
@@ -46,7 +46,7 @@ async function dev(config, options) {
46
46
  https: !!((_a = viteConfig.server) == null ? void 0 : _a.https)
47
47
  })
48
48
  );
49
- const currentVersion = "1.1.3";
49
+ const currentVersion = "1.1.4";
50
50
  if (currentVersion.includes("-")) {
51
51
  warn(options.logging, null, msg.prerelease({ currentVersion }));
52
52
  }
@@ -46,7 +46,7 @@ function devStart({
46
46
  https,
47
47
  site
48
48
  }) {
49
- const version = "1.1.3";
49
+ const version = "1.1.4";
50
50
  const rootPath = site ? site.pathname : "/";
51
51
  const localPrefix = `${dim("\u2503")} Local `;
52
52
  const networkPrefix = `${dim("\u2503")} Network `;
@@ -225,7 +225,7 @@ function printHelp({
225
225
  message.push(
226
226
  linebreak(),
227
227
  ` ${bgGreen(black(` ${commandName} `))} ${green(
228
- `v${"1.1.3"}`
228
+ `v${"1.1.4"}`
229
229
  )} ${headline}`
230
230
  );
231
231
  }
@@ -8,3 +8,4 @@ export declare function startsWithDotDotSlash(path: string): boolean;
8
8
  export declare function startsWithDotSlash(path: string): boolean;
9
9
  export declare function isRelativePath(path: string): boolean;
10
10
  export declare function joinPaths(...paths: (string | undefined)[]): string;
11
+ export declare function removeFileExtension(path: string): string;
package/dist/core/path.js CHANGED
@@ -36,11 +36,16 @@ function isString(path) {
36
36
  function joinPaths(...paths) {
37
37
  return paths.filter(isString).map(trimSlashes).join("/");
38
38
  }
39
+ function removeFileExtension(path) {
40
+ let idx = path.lastIndexOf(".");
41
+ return idx === -1 ? path : path.slice(0, idx);
42
+ }
39
43
  export {
40
44
  appendForwardSlash,
41
45
  isRelativePath,
42
46
  joinPaths,
43
47
  prependForwardSlash,
48
+ removeFileExtension,
44
49
  removeLeadingForwardSlash,
45
50
  removeTrailingForwardSlash,
46
51
  startsWithDotDotSlash,
package/dist/core/util.js CHANGED
@@ -5,7 +5,7 @@ import resolve from "resolve";
5
5
  import slash from "slash";
6
6
  import { fileURLToPath, pathToFileURL } from "url";
7
7
  import { prependForwardSlash, removeTrailingForwardSlash } from "./path.js";
8
- const ASTRO_VERSION = "1.1.3";
8
+ const ASTRO_VERSION = "1.1.4";
9
9
  function isObject(value) {
10
10
  return typeof value === "object" && value != null;
11
11
  }
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "1.1.3";
1
+ const ASTRO_VERSION = "1.1.4";
2
2
  function createDeprecatedFetchContentFn() {
3
3
  return () => {
4
4
  throw new Error("Deprecated: Astro.fetchContent() has been replaced with Astro.glob().");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",
@@ -95,7 +95,6 @@
95
95
  "@babel/types": "^7.18.4",
96
96
  "@proload/core": "^0.3.2",
97
97
  "@proload/plugin-tsm": "^0.2.1",
98
- "ast-types": "^0.14.2",
99
98
  "boxen": "^6.2.1",
100
99
  "ci-info": "^3.3.1",
101
100
  "common-ancestor-path": "^1.0.1",
@@ -160,6 +159,7 @@
160
159
  "@types/send": "^0.17.1",
161
160
  "@types/unist": "^2.0.6",
162
161
  "@types/yargs-parser": "^21.0.0",
162
+ "ast-types": "^0.14.2",
163
163
  "astro-scripts": "0.0.7",
164
164
  "chai": "^4.3.6",
165
165
  "cheerio": "^1.0.0-rc.11",