svelte-entitlement 1.2.20 → 1.2.23

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/package.json CHANGED
@@ -1,42 +1,45 @@
1
1
  {
2
2
  "name": "svelte-entitlement",
3
- "version": "1.2.20",
3
+ "version": "1.2.23",
4
4
  "svelte": "./src/index.svelte",
5
5
  "keywords": [
6
6
  "component",
7
7
  "svelte",
8
+ "vite",
8
9
  "web"
9
10
  ],
10
11
  "scripts": {
11
- "start": "rollup -c tests/app/rollup.config.mjs -w",
12
+ "prepare": "vite build",
13
+ "start": "vite dev",
12
14
  "test": "npm run test:ava && npm run test:cafe",
13
- "test:cafe": "testcafe $BROWSER:headless tests/cafe/*.js -s build/test --page-request-timeout 9000 --app-init-delay 3000 --app \"rollup -c tests/app/rollup.config.mjs -w\"",
14
15
  "test:ava": "ava --timeout 2m tests/*.mjs",
16
+ "test:cafe": "testcafe $BROWSER:headless tests/cafe/*.js -s build/test --page-request-timeout 9000 --app-init-delay 3000 --app \"vite\"",
15
17
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
16
18
  "docs": "documentation readme --section=API ./src/**/*.mjs",
17
19
  "lint": "npm run lint:docs",
18
20
  "lint:docs": "documentation lint ./src/**/*.mjs",
19
- "build": "rollup -c tests/app/rollup.config.mjs"
21
+ "preview": "vite preview"
20
22
  },
21
23
  "dependencies": {
22
24
  "svelte-dnd-action": "^0.9.18"
23
25
  },
24
26
  "devDependencies": {
25
- "@rollup/plugin-node-resolve": "^13.3.0",
26
- "@rollup/plugin-virtual": "^2.1.0",
27
- "ava": "^4.2.0",
27
+ "@semantic-release/commit-analyzer": "^9.0.2",
28
+ "@semantic-release/exec": "^6.0.3",
29
+ "@semantic-release/release-notes-generator": "^10.0.3",
30
+ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49",
31
+ "ava": "^4.3.0",
28
32
  "c8": "^7.11.3",
29
33
  "documentation": "^13.2.5",
30
- "mf-styling": "^1.2.18",
31
- "postcss": "^8.4.14",
32
- "postcss-import": "^14.1.0",
33
- "rollup": "^2.74.1",
34
- "rollup-plugin-dev": "^2.0.4",
35
- "rollup-plugin-postcss": "^4.0.2",
36
- "rollup-plugin-svelte": "^7.1.0",
37
- "semantic-release": "^19.0.2",
34
+ "mf-styling": "^1.2.22",
35
+ "npm-pkgbuild": "^10.9.2",
36
+ "semantic-release": "^19.0.3",
38
37
  "svelte": "^3.48.0",
39
- "testcafe": "^1.19.0"
38
+ "testcafe": "^1.19.0",
39
+ "vite": "^2.9.12"
40
+ },
41
+ "optionalDependencies": {
42
+ "mf-hosting": "^1.6.3"
40
43
  },
41
44
  "repository": {
42
45
  "type": "git",
@@ -46,11 +49,34 @@
46
49
  "url": "https://github.com/arlac77/svelte-entitlement/issues"
47
50
  },
48
51
  "homepage": "https://github.com/arlac77/svelte-entitlement#readme",
52
+ "pkgbuild": {
53
+ "content": {
54
+ "${install.dir}": "build/",
55
+ "${nginx.sites.dir}${name}.conf": "pkg/nginx.conf"
56
+ },
57
+ "hooks": "pkg/hooks.sh",
58
+ "groups": "web"
59
+ },
60
+ "release": {
61
+ "plugins": [
62
+ "@semantic-release/commit-analyzer",
63
+ "@semantic-release/release-notes-generator",
64
+ "@semantic-release/npm",
65
+ [
66
+ "@semantic-release/exec",
67
+ {
68
+ "publishCmd": "npx npm-pkgbuild --available --continue --verbose"
69
+ }
70
+ ],
71
+ "@semantic-release/github"
72
+ ]
73
+ },
49
74
  "template": {
50
75
  "inheritFrom": [
51
76
  "arlac77/template-ava-coverage",
52
77
  "arlac77/template-cloudflare",
53
- "arlac77/template-svelte-component",
78
+ "arlac77/template-pacman",
79
+ "arlac77/template-svelte-component#next",
54
80
  "arlrac77/template-arlac77-github"
55
81
  ]
56
82
  }
@@ -16,11 +16,6 @@ export class Entitlement {
16
16
  return Array.isArray(this.cn) ? this.cn[0]: this.cn;
17
17
  }
18
18
 
19
- /*
20
- get id() {
21
- return this.name;
22
- }*/
23
-
24
19
  get displayName() {
25
20
  return this.name;
26
21
  }
package/vite.config.js ADDED
@@ -0,0 +1,47 @@
1
+ import { svelte } from "@sveltejs/vite-plugin-svelte";
2
+ //import { extractFromPackage } from "npm-pkgbuild/src/module.mjs";
3
+ import { defineConfig } from "vite";
4
+
5
+ export default defineConfig(async ({ command, mode }) => {
6
+ const { extractFromPackage } = await import(
7
+ new URL("node_modules/npm-pkgbuild/src/module.mjs", import.meta.url)
8
+ );
9
+ const res = extractFromPackage({
10
+ dir: new URL("./", import.meta.url).pathname
11
+ });
12
+ const first = await res.next();
13
+ const pkg = first.value;
14
+ const properties = pkg.properties;
15
+ const base = properties["http.path"] + "/";
16
+ const production = mode === "production";
17
+
18
+ process.env["VITE_NAME"] = properties.name;
19
+ process.env["VITE_DESCRIPTION"] = properties.description;
20
+ process.env["VITE_VERSION"] = properties.version;
21
+
22
+ return {
23
+ base,
24
+ root: "tests/app/src",
25
+ worker: { format: "es" },
26
+ plugins: [
27
+ svelte({
28
+ compilerOptions: {
29
+ dev: !production
30
+ }
31
+ })
32
+ ],
33
+ optimizeDeps: {
34
+ exclude: [
35
+ ...Object.keys(pkg.dependencies).filter(d => d.startsWith("svelte"))
36
+ ]
37
+ },
38
+ server: { host: true },
39
+ build: {
40
+ outDir: "../../../build",
41
+ target: "esnext",
42
+ emptyOutDir: true,
43
+ minify: production,
44
+ sourcemap: true
45
+ }
46
+ };
47
+ });