@transclude/create 0.5.0 → 0.7.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.
package/index.js
CHANGED
|
@@ -135,9 +135,13 @@ function copy(from, to, replacements) {
|
|
|
135
135
|
const TEXT = new Set(['.json', '.js', '.html', '.css', '.md', '.txt']);
|
|
136
136
|
|
|
137
137
|
for (const rel of walk(from)) {
|
|
138
|
-
// `.gitignore` in a template would
|
|
139
|
-
// every tool that reads one, including
|
|
140
|
-
|
|
138
|
+
// A leading underscore stands for a dot. `.gitignore` in a template would
|
|
139
|
+
// be applied to the template itself by every tool that reads one, including
|
|
140
|
+
// npm when this is packed, and a `.vscode` directory is the same shape of
|
|
141
|
+
// problem: tooling that finds it here would treat the templates as a
|
|
142
|
+
// project. Only the first segment, so a file named `_partial.html` inside a
|
|
143
|
+
// directory keeps its name.
|
|
144
|
+
const target = path.join(to, rel.replace(/^_/, '.'));
|
|
141
145
|
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
142
146
|
|
|
143
147
|
if (!TEXT.has(path.extname(rel))) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
// A transclude `.html` file holds several script blocks that are separate
|
|
3
|
+
// modules: `<script properties>`, `<script state>`, `<script server>` and the
|
|
4
|
+
// element's own `<script>`. VS Code's built-in HTML support reads them as one
|
|
5
|
+
// JavaScript module, so two `export default` blocks are reported as "A module
|
|
6
|
+
// cannot have multiple default exports" in every element that declares props
|
|
7
|
+
// and state. The file is correct; the reader is wrong about what it is.
|
|
8
|
+
//
|
|
9
|
+
// `npm run check` and the language server in `editor/` do the real checking,
|
|
10
|
+
// and they read these files the way the compiler does.
|
|
11
|
+
"html.validate.scripts": false
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
// A transclude `.html` file holds several script blocks that are separate
|
|
3
|
+
// modules: `<script properties>`, `<script state>`, `<script server>` and the
|
|
4
|
+
// element's own `<script>`. VS Code's built-in HTML support reads them as one
|
|
5
|
+
// JavaScript module, so two `export default` blocks are reported as "A module
|
|
6
|
+
// cannot have multiple default exports" in every element that declares props
|
|
7
|
+
// and state. The file is correct; the reader is wrong about what it is.
|
|
8
|
+
//
|
|
9
|
+
// `npm run check` and the language server in `editor/` do the real checking,
|
|
10
|
+
// and they read these files the way the compiler does.
|
|
11
|
+
"html.validate.scripts": false
|
|
12
|
+
}
|