sv 0.4.3 → 0.5.0

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.
Files changed (59) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +20 -128
  3. package/dist/bin.js +13085 -0
  4. package/dist/bin.js.map +1 -0
  5. package/dist/index-CfDBZLMZ.js +137 -0
  6. package/dist/index-CfDBZLMZ.js.map +1 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +5 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/shared.json +138 -0
  11. package/dist/templates/demo/assets/DOT-gitignore +21 -0
  12. package/dist/templates/demo/assets/DOT-npmrc +1 -0
  13. package/dist/templates/demo/assets/src/app.css +107 -0
  14. package/dist/templates/demo/assets/src/app.html +12 -0
  15. package/dist/templates/demo/assets/src/lib/images/github.svg +16 -0
  16. package/dist/templates/demo/assets/src/lib/images/svelte-logo.svg +1 -0
  17. package/dist/templates/demo/assets/src/lib/images/svelte-welcome.png +0 -0
  18. package/dist/templates/demo/assets/src/lib/images/svelte-welcome.webp +0 -0
  19. package/dist/templates/demo/assets/static/favicon.png +0 -0
  20. package/dist/templates/demo/assets/static/robots.txt +3 -0
  21. package/dist/templates/demo/files.types=checkjs.json +62 -0
  22. package/dist/templates/demo/files.types=none.json +58 -0
  23. package/dist/templates/demo/files.types=typescript.json +62 -0
  24. package/dist/templates/demo/meta.json +4 -0
  25. package/dist/templates/demo/package.json +19 -0
  26. package/dist/templates/skeleton/assets/DOT-gitignore +21 -0
  27. package/dist/templates/skeleton/assets/DOT-npmrc +1 -0
  28. package/dist/templates/skeleton/assets/src/app.html +12 -0
  29. package/dist/templates/skeleton/assets/static/favicon.png +0 -0
  30. package/dist/templates/skeleton/files.types=checkjs.json +14 -0
  31. package/dist/templates/skeleton/files.types=none.json +10 -0
  32. package/dist/templates/skeleton/files.types=typescript.json +14 -0
  33. package/dist/templates/skeleton/meta.json +4 -0
  34. package/dist/templates/skeleton/package.json +18 -0
  35. package/dist/templates/skeletonlib/assets/DOT-gitignore +22 -0
  36. package/dist/templates/skeletonlib/assets/DOT-npmrc +1 -0
  37. package/dist/templates/skeletonlib/assets/src/app.html +12 -0
  38. package/dist/templates/skeletonlib/assets/static/favicon.png +0 -0
  39. package/dist/templates/skeletonlib/files.types=checkjs.json +14 -0
  40. package/dist/templates/skeletonlib/files.types=none.json +10 -0
  41. package/dist/templates/skeletonlib/files.types=typescript.json +14 -0
  42. package/dist/templates/skeletonlib/meta.json +4 -0
  43. package/dist/templates/skeletonlib/package.json +34 -0
  44. package/dist/unocss-Dk7i15rK.js +11 -0
  45. package/dist/unocss-Dk7i15rK.js.map +1 -0
  46. package/dist/unplugin-icons-DkNLYvBs.js +11 -0
  47. package/dist/unplugin-icons-DkNLYvBs.js.map +1 -0
  48. package/package.json +42 -29
  49. package/bin/sv.d.ts +0 -2
  50. package/bin/sv.js +0 -126
  51. package/common.d.ts +0 -39
  52. package/common.js +0 -29
  53. package/docs/example.js +0 -57
  54. package/index.d.ts +0 -13
  55. package/index.js +0 -31
  56. package/parser.d.ts +0 -31
  57. package/parser.js +0 -209
  58. package/stringifier.d.ts +0 -44
  59. package/stringifier.js +0 -174
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024 [these people](https://github.com/sveltejs/cli/graphs/contributors)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,142 +1,34 @@
1
- # sv
1
+ # sv - the Svelte CLI
2
2
 
3
- [![npm version](https://badge.fury.io/js/sv.svg)](https://www.npmjs.com/package/sv)
4
- [![Travis CI Build Status](https://travis-ci.org/chbrown/sv.svg)](https://travis-ci.org/chbrown/sv)
5
- [![Coverage Status](https://coveralls.io/repos/chbrown/sv/badge.svg)](https://coveralls.io/github/chbrown/sv)
3
+ A CLI for creating new [SvelteKit](https://kit.svelte.dev) projects and adding functionality to existing ones. Just run...
6
4
 
7
- For all your separated value needs.
5
+ ```bash
6
+ npx sv
7
+ ```
8
8
 
9
- * `sv.Stringifier` is a [Readable stream](http://nodejs.org/api/stream.html#stream_class_stream_readable).
10
- * `sv.Parser` is a [Writable stream](http://nodejs.org/api/stream.html#stream_class_stream_writable).
9
+ ...and follow the prompts.
11
10
 
12
- ## Install
11
+ ## API
13
12
 
14
- npm install sv
13
+ You can also use `sv` programmatically:
15
14
 
16
- The `optimist` dependency is only required for command line use.
15
+ ```js
16
+ import { create } from 'sv';
17
17
 
18
- ## API usage
18
+ await create('my-new-app', {
19
+ name: 'my-new-app',
20
+ template: 'default' // or 'skeleton' or 'skeletonlib'
21
+ });
22
+ ```
19
23
 
20
- All tabular data must / will have column names on the first row.
24
+ `checkjs` means your project will use TypeScript to typecheck JavaScript via [JSDoc comments](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html).
21
25
 
22
- ### Parsing
26
+ ## Acknowledgements
23
27
 
24
- sprints.csv:
25
-
26
- index name time
27
- 1 chris 1:18
28
- 2 daniel 1:17
29
- 3 lewis 1:30
30
- 4 stephen 1:16
31
- 5 larry 1:32
32
-
33
- And in node:
34
-
35
- var sv = require('sv');
36
- var parser = new sv.Parser();
37
- parser.on('data', function(obj) {
38
- console.log('sprinter ->', obj);
39
- });
40
-
41
- var fs = require('fs');
42
- var sprints = fs.createReadStream('sprints.csv', {encoding: 'utf8'});
43
- sprints.pipe(parser);
44
-
45
- ### Stringifying
46
-
47
- var expenses = [
48
- {name: 'Tip' },
49
- {name: 'Lunch', amount: 5.90},
50
- {name: 'Latte', amount: 3.15},
51
- {name: 'Paper', amount: 2.10},
52
- {name: 'Pens' , amount: 4.59},
53
- { amount: 9.16}
54
- ];
55
-
56
- var sv = require('sv');
57
- var stringifier = new sv.Stringifier({peek: 2, missing: 'n/a'});
58
- stringifier.pipe(process.stdout);
59
- expenses.forEach(function(expense) {
60
- stringifier.write(expense);
61
- });
62
-
63
- // if you write set 'peek' to more rows than you have in your data,
64
- // you'll need to call stringifier end so that they get flushed.
65
- stringifier.end();
66
-
67
- * N.b.: If you pipe a buffer or (i.e., with a stringifier) into a parser, the
68
- parser will not receive any encoding. You _must_ set the encoding on the
69
- parser in those cases.
70
-
71
- ### Stringifier features:
72
-
73
- 1. Infer column names from a list of objects.
74
- 2. Convert from objects to csv / tsv plaintext.
75
- * Also allows writing arrays / strings directly.
76
- 3. Write header automatically.
77
-
78
- ### Parser features:
79
-
80
- 1. Infer delimiter from input.
81
- 2. Infer column names from first line of input.
82
- 3. Handle universal newlines (`\r`, `\r\n`, or `\n`).
83
-
84
- ## CLI usage
85
-
86
- shopt -s globstar
87
- for csv in ~/corpora/testsheets/**/*.csv; do
88
- echo
89
- file "$csv"
90
- echo "Tunneling through multiple 'sv' calls should be transparent."
91
- cat "$csv" | sv -j | wc -l
92
- cat "$csv" | sv | sv -j | wc -l
93
- done
94
-
95
- ## TODO
96
-
97
- * Decide how to encode a field like {id: 1, name: '"chris'},
98
- when the delimiter is `,` and quotechar is `"`.
99
- - This is weird because it doesn't *need* quoting, but without, the
100
- quotechar marker will trigger an `inside` state, but there's no end quote.)
101
-
102
-
103
- # Development notes
104
-
105
- ## Characters codes
106
-
107
- Line separators:
108
-
109
- * `\n` = 10 (newline)
110
- * `\r` = 13 (return)
111
-
112
- Field separators:
113
-
114
- * `\t` = 9 (tab)
115
- * ` ` = 32 (space)
116
- * `,` = 44 (comma)
117
- * `;` = 59 (semicolon)
118
-
119
- Field quotations:
120
-
121
- * `"` = 34 (double quote)
122
- * `'` = 39 (single quote)
123
- * <code>`</code> = 96 (backtick)
124
-
125
- Escapes:
126
-
127
- * `\` = 92 (backslash)
128
-
129
- ## Debugging helper:
130
-
131
- function logEvents(emitter, prefix, names) {
132
- names.forEach(function(name) {
133
- emitter.on(name, function(/*...*/) {
134
- console.error(prefix + ':' + name, arguments);
135
- });
136
- });
137
- }
28
+ Thank you to [Christopher Brown](https://github.com/chbrown) who originally owned the `sv` name on npm for graciously allowing it to be used for this package. You can find the original `sv` package at [`@chbrown/sv`](https://www.npmjs.com/package/@chbrown/sv).
138
29
 
30
+ This project was formed by merging the `create-svelte` and `svelte-add` CLIs. Thank you to [J](https://github.com/babichjacob) for starting the community-led `svelte-add` project and to the [`svelte-add` contributors](https://github.com/svelte-add/svelte-add/graphs/contributors).
139
31
 
140
32
  ## License
141
33
 
142
- Copyright 2013-2016 Christopher Brown. [MIT Licensed](http://chbrown.github.io/licenses/MIT/#2013-2016).
34
+ [MIT](../../LICENSE).