Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Aug 21, 2024
1 parent 71456ff commit cd7fd6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/create/scripts/build-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,6 @@ async function main(dist) {
await generate_templates(shared, dist);
}

main('dist');
// also generates the templates in the package where `@svelte-cli/create` will be bundled
main(path.resolve('..', 'core', 'dist'));
7 changes: 3 additions & 4 deletions packages/create/test/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { fileURLToPath } from 'node:url';
import { promisify } from 'node:util';
import glob from 'tiny-glob/sync';
import { beforeAll, describe, test } from 'vitest';
import { create } from '../index';
import type { TemplateTypes, Types } from '../types/internal';
import { create, type LanguageType, type TemplateType } from '../index';

// Resolve the given path relative to the current file
const resolve_path = (path: string) => fileURLToPath(new URL(path, import.meta.url));
Expand Down Expand Up @@ -85,12 +84,12 @@ function patch_package_json(pkg: any) {
*/
const script_test_map = new Map();

const templates = fs.readdirSync('templates') as TemplateTypes[];
const templates = fs.readdirSync('templates') as TemplateType[];

for (const template of templates) {
if (template[0] === '.') continue;

for (const types of ['checkjs', 'typescript'] as Types[]) {
for (const types of ['checkjs', 'typescript'] as LanguageType[]) {
const cwd = path.join(test_workspace_dir, `${template}-${types}`);
fs.rmSync(cwd, { recursive: true, force: true });

Expand Down

0 comments on commit cd7fd6a

Please sign in to comment.