Skip to content

Commit 1395017

Browse files
committed
fix: move template folder to root and add it into npm files
1 parent fb3002c commit 1395017

File tree

14 files changed

+152
-146
lines changed

14 files changed

+152
-146
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
},
1313
"files": [
1414
"/bin",
15-
"/lib"
15+
"/lib",
16+
"/template"
1617
],
1718
"homepage": "https://github.com/raulfdm/generate-svelte-app",
1819
"keywords": [

src/copyTemplate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { PackageJson, CopyTemplate } from './types';
1212
const globPromise = promisify(glob);
1313

1414
const CWD_PATH = process.cwd();
15-
const TEMPLATE_PATH = path.resolve(__dirname, 'template');
15+
const TEMPLATE_PATH = path.resolve(__dirname, '../template');
1616

1717
export function copyTemplate({ projectName, useNpm }: CopyTemplate) {
1818
const PROJECT_PATH = path.resolve(CWD_PATH, projectName);
@@ -77,6 +77,8 @@ export function copyTemplate({ projectName, useNpm }: CopyTemplate) {
7777

7878
const files = await globPromise(`${TEMPLATE_PATH}/**/*`);
7979

80+
console.log('files', files);
81+
8082
return files.filter(removeFolders);
8183
}
8284

src/template/public/global.css

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/template/public/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/template/rollup.config.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/template/src/main.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/template/README.md renamed to template/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*Psst — looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)*
1+
_Psst — looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)_
22

33
---
44

@@ -13,8 +13,7 @@ npx degit sveltejs/template svelte-app
1313
cd svelte-app
1414
```
1515

16-
*Note that you will need to have [Node.js](https://nodejs.org) installed.*
17-
16+
_Note that you will need to have [Node.js](https://nodejs.org) installed._
1817

1918
## Get started
2019

@@ -35,7 +34,6 @@ Navigate to [localhost:5000](http://localhost:5000). You should see your app run
3534

3635
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
3736

38-
3937
## Deploying to the web
4038

4139
### With [now](https://zeit.co/now)
File renamed without changes.

template/public/global.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
html,
2+
body {
3+
position: relative;
4+
width: 100%;
5+
height: 100%;
6+
}
7+
8+
body {
9+
color: #333;
10+
margin: 0;
11+
padding: 8px;
12+
box-sizing: border-box;
13+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
14+
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
15+
}
16+
17+
a {
18+
color: rgb(0, 100, 200);
19+
text-decoration: none;
20+
}
21+
22+
a:hover {
23+
text-decoration: underline;
24+
}
25+
26+
a:visited {
27+
color: rgb(0, 80, 160);
28+
}
29+
30+
label {
31+
display: block;
32+
}
33+
34+
input,
35+
button,
36+
select,
37+
textarea {
38+
font-family: inherit;
39+
font-size: inherit;
40+
padding: 0.4em;
41+
margin: 0 0 0.5em 0;
42+
box-sizing: border-box;
43+
border: 1px solid #ccc;
44+
border-radius: 2px;
45+
}
46+
47+
input:disabled {
48+
color: #ccc;
49+
}
50+
51+
input[type='range'] {
52+
height: 0;
53+
}
54+
55+
button {
56+
color: #333;
57+
background-color: #f4f4f4;
58+
outline: none;
59+
}
60+
61+
button:active {
62+
background-color: #ddd;
63+
}
64+
65+
button:focus {
66+
border-color: #666;
67+
}

template/public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width" />
6+
7+
<title>Svelte app</title>
8+
9+
<link rel="icon" type="image/png" href="/favicon.png" />
10+
<link rel="stylesheet" href="/global.css" />
11+
<link rel="stylesheet" href="/bundle.css" />
12+
13+
<script defer src="/bundle.js"></script>
14+
</head>
15+
16+
<body></body>
17+
</html>

0 commit comments

Comments
 (0)