kopular 0.22.0 → 0.22.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/testing.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kopular",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Kopular: a small component framework for KopScript — components, reactive state, constructor-injected services, routing, real compiled templates, and HTTP, with no DI container",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/testing.js CHANGED
@@ -39,7 +39,7 @@ const OWN_SRC_DIR = dirname(fileURLToPath(import.meta.url));
39
39
  // than anything wrong with the copied files themselves.
40
40
  const TEMP_ROOT = join(OWN_SRC_DIR, "..", ".kopular-testing-tmp");
41
41
 
42
- // Copies every .ks/.html/.js file from `srcDir` into `dir`, plus any
42
+ // Copies every .ks/.html/.js/.css file from `srcDir` into `dir`, plus any
43
43
  // filename listed in `extraFiles` for anything with a different extension.
44
44
  // `.js` is included alongside `.ks`/`.html` (not just left to `extraFiles`)
45
45
  // because a hand-written, not-compiled-from-`.ks` companion file is a
@@ -54,10 +54,13 @@ const TEMP_ROOT = join(OWN_SRC_DIR, "..", ".kopular-testing-tmp");
54
54
  // gets harmlessly overwritten moments later by that `.ks`'s own fresh
55
55
  // compiled output — copying it first only matters for a `.js` with no
56
56
  // `.ks` counterpart at all, which is exactly the hand-written case this
57
- // exists for.
57
+ // exists for. `.css` is the same story again, for kopscript@0.26.0's
58
+ // `styles from "<path>.css";` — a real app's own stylesheet, named
59
+ // whatever the author chose, referenced by a relative path a test author
60
+ // can't enumerate in advance either.
58
61
  function copySources(srcDir, dir, extraFiles) {
59
62
  for (const name of readdirSync(srcDir)) {
60
- if (name.endsWith(".ks") || name.endsWith(".html") || name.endsWith(".js") || extraFiles.includes(name)) {
63
+ if (name.endsWith(".ks") || name.endsWith(".html") || name.endsWith(".js") || name.endsWith(".css") || extraFiles.includes(name)) {
61
64
  cpSync(join(srcDir, name), join(dir, name));
62
65
  }
63
66
  }