Skip to content

Commit

Permalink
[chore] resolve outdated todos (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Aug 15, 2021
1 parent b3b4382 commit b772016
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 41 deletions.
18 changes: 0 additions & 18 deletions packages/kit/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,6 @@ prog
}
});

// TODO remove this after a few versions
prog
.command('start')
.describe('Deprecated — use svelte-kit preview instead')
.option('-p, --port', 'Port', 3000)
.option('-h, --host', 'Host (only use this on trusted networks)', 'localhost')
.option('-H, --https', 'Use self-signed HTTPS certificate', false)
.option('-o, --open', 'Open a browser tab', false)
.action(async () => {
console.log(
colors
.bold()
.red(
'"svelte-kit preview" will now preview your production build locally. Note: it is not intended for production use'
)
);
});

prog
.command('package')
.describe('Create a package')
Expand Down
1 change: 0 additions & 1 deletion packages/kit/src/core/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export async function load_config({ cwd = process.cwd() } = {}) {
validated.kit.files.lib = path.resolve(cwd, validated.kit.files.lib);
validated.kit.files.routes = path.resolve(cwd, validated.kit.files.routes);
validated.kit.files.serviceWorker = path.resolve(cwd, validated.kit.files.serviceWorker);
validated.kit.files.setup = path.resolve(cwd, validated.kit.files.setup);
validated.kit.files.template = path.resolve(cwd, validated.kit.files.template);

validate_template(cwd, validated);
Expand Down
2 changes: 0 additions & 2 deletions packages/kit/src/core/config/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ test('fills in defaults', () => {
lib: 'src/lib',
routes: 'src/routes',
serviceWorker: 'src/service-worker',
setup: 'src/setup',
template: 'src/app.html'
},
floc: false,
Expand Down Expand Up @@ -123,7 +122,6 @@ test('fills in partial blanks', () => {
lib: 'src/lib',
routes: 'src/routes',
serviceWorker: 'src/service-worker',
setup: 'src/setup',
template: 'src/app.html'
},
floc: false,
Expand Down
2 changes: 0 additions & 2 deletions packages/kit/src/core/config/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ const options = {
lib: expect_string('src/lib'),
routes: expect_string('src/routes'),
serviceWorker: expect_string('src/service-worker'),
// TODO remove this, eventually
setup: expect_string('src/setup'),
template: expect_string('src/app.html')
}
},
Expand Down
1 change: 0 additions & 1 deletion packages/kit/src/core/config/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function testLoadDefaultConfig(path) {
lib: join(cwd, 'src/lib'),
routes: join(cwd, 'src/routes'),
serviceWorker: join(cwd, 'src/service-worker'),
setup: join(cwd, 'src/setup'),
template: join(cwd, 'src/app.html')
},
floc: false,
Expand Down
13 changes: 4 additions & 9 deletions packages/kit/src/runtime/app/stores.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getContext } from 'svelte';

// const ssr = (import.meta as any).env.SSR;
const ssr = typeof window === 'undefined'; // TODO why doesn't previous line work in build?
const ssr = import.meta.env.SSR;

// TODO remove this (for 1.0? after 1.0?)
let warned = false;
Expand All @@ -26,6 +25,7 @@ export const getStores = () => {
navigating: {
subscribe: stores.navigating.subscribe
},
// TODO remove this (for 1.0? after 1.0?)
// @ts-expect-error - deprecated, not part of type definitions, but still callable
get preloading() {
console.error('stores.preloading is deprecated; use stores.navigating instead');
Expand All @@ -48,7 +48,6 @@ export const page = {

/** @type {typeof import('$app/stores').navigating} */
export const navigating = {
/** @param {(value: any) => void} fn */
subscribe(fn) {
const store = getStores().navigating;
return store.subscribe(fn);
Expand Down Expand Up @@ -76,10 +75,6 @@ export const session = {

return store.subscribe(fn);
},
set: (value) => {
error('set');
},
update: (updater) => {
error('update');
}
set: () => error('set'),
update: () => error('update')
};
6 changes: 1 addition & 5 deletions packages/kit/src/runtime/server/page/load_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ export async function load_node({
if (asset) {
response = options.read
? new Response(options.read(asset.file), {
headers: asset.type
? {
'content-type': asset.type
}
: {}
headers: asset.type ? { 'content-type': asset.type } : {}
})
: await fetch(
// TODO we need to know what protocol to use
Expand Down
4 changes: 1 addition & 3 deletions packages/kit/types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,4 @@ export interface Config {
preprocess?: any;
}

export type ValidatedConfig = RecursiveRequired<Config> & {
kit: { files: { setup: string } }; // only for validated
};
export type ValidatedConfig = RecursiveRequired<Config>;

0 comments on commit b772016

Please sign in to comment.