@sveltejs/kit 1.0.0-next.208 → 1.0.0-next.211

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,6 +1,6 @@
1
1
  import fs__default, { writeFileSync } from 'fs';
2
2
  import path__default from 'path';
3
- import { p as print_config_conflicts, c as copy_assets, b as posixify, a as resolve_entry, r as rimraf, m as mkdirp } from '../cli.js';
3
+ import { p as print_config_conflicts, c as copy_assets, b as posixify, r as resolve_entry, a as rimraf, m as mkdirp } from '../cli.js';
4
4
  import { d as deep_merge, a as create_app, c as create_manifest_data } from './index2.js';
5
5
  import { S as SVELTE_KIT } from './constants.js';
6
6
  import { g as generate_manifest } from './index4.js';
@@ -536,7 +536,7 @@ function get_methods(cwd, output, manifest_data) {
536
536
  * }} [opts]
537
537
  * @returns {Promise<import('types/internal').BuildData>}
538
538
  */
539
- async function build(config, { cwd = process.cwd(), runtime = '@sveltejs/kit/ssr' } = {}) {
539
+ async function build(config, { cwd = process.cwd(), runtime = './kit.js' } = {}) {
540
540
  const build_dir = path__default.resolve(cwd, `${SVELTE_KIT}/build`);
541
541
 
542
542
  rimraf(build_dir);
@@ -1,4 +1,4 @@
1
- import { m as mkdirp, r as rimraf, d as copy, $, l as logger } from '../cli.js';
1
+ import { m as mkdirp, a as rimraf, d as copy, $, l as logger } from '../cli.js';
2
2
  import { S as SVELTE_KIT } from './constants.js';
3
3
  import { readFileSync, writeFileSync } from 'fs';
4
4
  import { resolve, join, dirname } from 'path';
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import { createRequire } from 'module';
4
- import { r as rimraf, w as walk$1, $, m as mkdirp } from '../cli.js';
4
+ import { a as rimraf, w as walk$1, $, m as mkdirp } from '../cli.js';
5
5
  import 'sade';
6
6
  import 'child_process';
7
7
  import 'net';
package/dist/cli.js CHANGED
@@ -887,7 +887,7 @@ async function launch(port, https) {
887
887
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
888
888
  }
889
889
 
890
- const prog = sade('svelte-kit').version('1.0.0-next.208');
890
+ const prog = sade('svelte-kit').version('1.0.0-next.211');
891
891
 
892
892
  prog
893
893
  .command('dev')
@@ -903,37 +903,24 @@ prog
903
903
  const { dev } = await import('./chunks/index.js');
904
904
 
905
905
  try {
906
- const watcher = await dev({ port, host, https, config });
906
+ const cwd = process.cwd();
907
907
 
908
- watcher.on('stdout', (data) => {
909
- process.stdout.write(data);
910
- });
911
-
912
- watcher.on('stderr', (data) => {
913
- process.stderr.write(data);
908
+ const { address_info, server_config } = await dev({
909
+ cwd,
910
+ port,
911
+ host,
912
+ https,
913
+ config
914
914
  });
915
915
 
916
- if (!watcher.vite || !watcher.vite.httpServer) {
917
- throw Error('Could not find server');
918
- }
919
- // we never start the server on a socket path, so address will be of type AddressInfo
920
- const address_info = /** @type {import('net').AddressInfo} */ (
921
- watcher.vite.httpServer.address()
922
- );
923
-
924
- const vite_config = config.kit.vite();
925
-
926
- https = https || !!vite_config.server?.https;
927
- open = open || !!vite_config.server?.open;
928
-
929
916
  welcome({
930
917
  port: address_info.port,
931
918
  host: address_info.address,
932
- https,
933
- open,
934
- loose: vite_config.server?.fs?.strict === false,
935
- allow: watcher.allowed_directories(),
936
- cwd: watcher.cwd
919
+ https: !!(https || server_config.https),
920
+ open: open || !!server_config.open,
921
+ loose: server_config.fs.strict === false,
922
+ allow: server_config.fs.allow,
923
+ cwd
937
924
  });
938
925
  } catch (error) {
939
926
  handle_error(error);
@@ -1052,7 +1039,7 @@ async function check_port(port) {
1052
1039
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1053
1040
  if (open) launch(port, https);
1054
1041
 
1055
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.208'}\n`));
1042
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.211'}\n`));
1056
1043
 
1057
1044
  const protocol = https ? 'https:' : 'http:';
1058
1045
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
@@ -1089,4 +1076,4 @@ function welcome({ port, host, https, open, loose, allow, cwd }) {
1089
1076
  console.log('\n');
1090
1077
  }
1091
1078
 
1092
- export { $, resolve_entry as a, posixify as b, copy_assets as c, copy as d, get_mime_lookup as g, logger as l, mkdirp as m, print_config_conflicts as p, rimraf as r, walk as w };
1079
+ export { $, rimraf as a, posixify as b, copy_assets as c, copy as d, get_mime_lookup as g, logger as l, mkdirp as m, print_config_conflicts as p, resolve_entry as r, walk as w };
package/dist/ssr.js CHANGED
@@ -571,24 +571,22 @@ async function render_response({
571
571
  components: branch.map(({ node }) => node.module.default)
572
572
  };
573
573
 
574
- if (options.dev) {
575
- // TODO remove this for 1.0
576
- /**
577
- * @param {string} property
578
- * @param {string} replacement
579
- */
580
- const print_error = (property, replacement) => {
581
- Object.defineProperty(props.page, property, {
582
- get: () => {
583
- throw new Error(`$page.${property} has been replaced by $page.url.${replacement}`);
584
- }
585
- });
586
- };
574
+ // TODO remove this for 1.0
575
+ /**
576
+ * @param {string} property
577
+ * @param {string} replacement
578
+ */
579
+ const print_error = (property, replacement) => {
580
+ Object.defineProperty(props.page, property, {
581
+ get: () => {
582
+ throw new Error(`$page.${property} has been replaced by $page.url.${replacement}`);
583
+ }
584
+ });
585
+ };
587
586
 
588
- print_error('origin', 'origin');
589
- print_error('path', 'pathname');
590
- print_error('query', 'searchParams');
591
- }
587
+ print_error('origin', 'origin');
588
+ print_error('path', 'pathname');
589
+ print_error('query', 'searchParams');
592
590
 
593
591
  // props_n (instead of props[n]) makes it easy to avoid
594
592
  // unnecessary updates for layout components
@@ -1741,24 +1739,22 @@ async function respond(incoming, options, state = {}) {
1741
1739
  locals: {}
1742
1740
  };
1743
1741
 
1744
- if (options.dev) {
1745
- // TODO remove this for 1.0
1746
- /**
1747
- * @param {string} property
1748
- * @param {string} replacement
1749
- */
1750
- const print_error = (property, replacement) => {
1751
- Object.defineProperty(request, property, {
1752
- get: () => {
1753
- throw new Error(`request.${property} has been replaced by request.url.${replacement}`);
1754
- }
1755
- });
1756
- };
1742
+ // TODO remove this for 1.0
1743
+ /**
1744
+ * @param {string} property
1745
+ * @param {string} replacement
1746
+ */
1747
+ const print_error = (property, replacement) => {
1748
+ Object.defineProperty(request, property, {
1749
+ get: () => {
1750
+ throw new Error(`request.${property} has been replaced by request.url.${replacement}`);
1751
+ }
1752
+ });
1753
+ };
1757
1754
 
1758
- print_error('origin', 'origin');
1759
- print_error('path', 'pathname');
1760
- print_error('query', 'searchParams');
1761
- }
1755
+ print_error('origin', 'origin');
1756
+ print_error('path', 'pathname');
1757
+ print_error('query', 'searchParams');
1762
1758
 
1763
1759
  try {
1764
1760
  return await options.hooks.handle({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.208",
3
+ "version": "1.0.0-next.211",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -11,7 +11,6 @@
11
11
  "type": "module",
12
12
  "dependencies": {
13
13
  "@sveltejs/vite-plugin-svelte": "^1.0.0-next.32",
14
- "cheap-watch": "^1.0.4",
15
14
  "sade": "^1.7.4",
16
15
  "vite": "^2.7.2"
17
16
  },