reactivated 0.41.0 → 0.41.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.
@@ -1,11 +1,17 @@
1
1
  #!/usr/bin/env node
2
+ export default function capacitorPlugin(): {
3
+ name: string;
4
+ writeBundle(): void;
5
+ };
2
6
  declare const clientConfig: {
3
7
  define: {
4
8
  "process.env.NODE_ENV": string;
5
9
  "process.env": string;
6
10
  };
11
+ mode: string;
7
12
  build: {
8
- minify: true;
13
+ minify: boolean;
14
+ watch: {} | undefined;
9
15
  target: string;
10
16
  sourcemap: true;
11
17
  emptyOutDir: true;
@@ -21,7 +27,10 @@ declare const clientConfig: {
21
27
  };
22
28
  };
23
29
  };
24
- plugins: (import("vite").PluginOption[] | import("vite").Plugin<any>)[];
30
+ plugins: (import("vite").PluginOption[] | {
31
+ name: string;
32
+ writeBundle(): void;
33
+ } | import("vite").Plugin<any>)[];
25
34
  resolve: {
26
35
  alias: {
27
36
  "@client": string;
@@ -3,16 +3,39 @@ import react from "@vitejs/plugin-react";
3
3
  import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
4
4
  import { build } from "vite";
5
5
  import { builtinModules } from "node:module";
6
+ import { execSync } from "child_process";
6
7
  import path from "path";
8
+ import { rmSync } from "fs";
7
9
  import { define } from "./conf.js";
8
10
  import * as esbuild from "esbuild";
9
11
  import { promises as fs } from "fs";
12
+ const REACTIVATED_WATCH = "REACTIVATED_WATCH" in process.env;
13
+ const { minify, mode, watch } = REACTIVATED_WATCH == true
14
+ ? { minify: false, watch: {}, mode: "development" }
15
+ : { minify: true, watch: undefined, mode: "production" };
16
+ export default function capacitorPlugin() {
17
+ return {
18
+ name: "capacitor-plugin",
19
+ writeBundle() {
20
+ if (watch == null) {
21
+ return;
22
+ }
23
+ const sourcePath = "static";
24
+ const targetPath = "capacitor/ios/App/App/public/static";
25
+ rmSync(targetPath, { force: true, recursive: true });
26
+ execSync(`cp -R ${sourcePath} ${targetPath}`);
27
+ console.log("Capacitor files copied");
28
+ },
29
+ };
30
+ }
10
31
  const base = process.env.BASE ?? "/";
11
32
  const identifiers = "short";
12
33
  const clientConfig = {
13
34
  define: define(),
35
+ mode,
14
36
  build: {
15
- minify: true,
37
+ minify,
38
+ watch,
16
39
  target: "esnext",
17
40
  sourcemap: true,
18
41
  emptyOutDir: true,
@@ -28,7 +51,7 @@ const clientConfig = {
28
51
  },
29
52
  },
30
53
  },
31
- plugins: [react(), vanillaExtractPlugin({ identifiers })],
54
+ plugins: [capacitorPlugin(), react(), vanillaExtractPlugin({ identifiers })],
32
55
  resolve: {
33
56
  alias: {
34
57
  "@client": path.resolve(process.cwd(), "./client"),
@@ -75,16 +98,18 @@ const rendererConfig = {
75
98
  base,
76
99
  };
77
100
  await build(clientConfig);
78
- await build(rendererConfig);
79
- // Currently, vanilla-extract plugins are not bundled even though we tell rollup
80
- // to bundle in the renderer build. So we do an esbuild pass after. Really clunky.
81
- await esbuild.build({
82
- sourcemap: true,
83
- entryPoints: ["./node_modules/_reactivated/renderer.mjs"],
84
- bundle: true,
85
- platform: "node",
86
- outfile: "./node_modules/_reactivated/renderer.js",
87
- });
88
- await fs.unlink("./node_modules/_reactivated/renderer.mjs");
89
- await fs.unlink("./node_modules/_reactivated/renderer.mjs.map");
101
+ if (watch == null) {
102
+ await build(rendererConfig);
103
+ // Currently, vanilla-extract plugins are not bundled even though we tell rollup
104
+ // to bundle in the renderer build. So we do an esbuild pass after. Really clunky.
105
+ await esbuild.build({
106
+ sourcemap: true,
107
+ entryPoints: ["./node_modules/_reactivated/renderer.mjs"],
108
+ bundle: true,
109
+ platform: "node",
110
+ outfile: "./node_modules/_reactivated/renderer.js",
111
+ });
112
+ await fs.unlink("./node_modules/_reactivated/renderer.mjs");
113
+ await fs.unlink("./node_modules/_reactivated/renderer.mjs.map");
114
+ }
90
115
  //# sourceMappingURL=build.client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.client.mjs","sourceRoot":"","sources":["../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0C,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAC;CACnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactivated",
3
- "version": "0.41.0",
3
+ "version": "0.41.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,6 +33,13 @@ fi
33
33
 
34
34
  if [ ! -d "$POSTGRESQL_DATA" ]; then
35
35
  initdb "$POSTGRESQL_DATA"
36
+
37
+ if [ -f "$EXTERNAL_PID" ]; then
38
+ pid_to_kill=$(cat "$EXTERNAL_PID")
39
+ kill -9 "$pid_to_kill" &>/dev/null || echo "No PostgresSQL process to kill"
40
+ fi
41
+
42
+ rm -rf "$TMP_ENV"
36
43
  NEED_DATABASE=true
37
44
  fi
38
45
 
@@ -4,18 +4,48 @@ import react from "@vitejs/plugin-react";
4
4
  import {vanillaExtractPlugin} from "@vanilla-extract/vite-plugin";
5
5
  import {InlineConfig, build} from "vite";
6
6
  import {builtinModules} from "node:module";
7
+ import {execSync} from "child_process";
7
8
  import path from "path";
9
+ import {existsSync, mkdirSync, rmSync} from "fs";
8
10
  import {define, Options} from "./conf.js";
9
11
  import * as esbuild from "esbuild";
10
12
  import {promises as fs} from "fs";
11
13
 
14
+ const REACTIVATED_WATCH = "REACTIVATED_WATCH" in process.env;
15
+
16
+ const {minify, mode, watch} =
17
+ REACTIVATED_WATCH == true
18
+ ? {minify: false, watch: {}, mode: "development"}
19
+ : {minify: true, watch: undefined, mode: "production"};
20
+
21
+ export default function capacitorPlugin() {
22
+ return {
23
+ name: "capacitor-plugin",
24
+
25
+ writeBundle() {
26
+ if (watch == null) {
27
+ return;
28
+ }
29
+
30
+ const sourcePath = "static";
31
+ const targetPath = "capacitor/ios/App/App/public/static";
32
+
33
+ rmSync(targetPath, {force: true, recursive: true});
34
+ execSync(`cp -R ${sourcePath} ${targetPath}`);
35
+ console.log("Capacitor files copied");
36
+ },
37
+ };
38
+ }
39
+
12
40
  const base = process.env.BASE ?? "/";
13
41
  const identifiers = "short";
14
42
 
15
43
  const clientConfig = {
16
44
  define: define(),
45
+ mode,
17
46
  build: {
18
- minify: true,
47
+ minify,
48
+ watch,
19
49
  target: "esnext",
20
50
  sourcemap: true,
21
51
  emptyOutDir: true,
@@ -31,8 +61,7 @@ const clientConfig = {
31
61
  },
32
62
  },
33
63
  },
34
-
35
- plugins: [react(), vanillaExtractPlugin({identifiers})],
64
+ plugins: [capacitorPlugin(), react(), vanillaExtractPlugin({identifiers})],
36
65
  resolve: {
37
66
  alias: {
38
67
  "@client": path.resolve(process.cwd(), "./client"),
@@ -87,17 +116,18 @@ export type ClientConfig = typeof clientConfig;
87
116
  export type RendererConfig = typeof rendererConfig;
88
117
 
89
118
  await build(clientConfig);
90
- await build(rendererConfig);
91
-
92
- // Currently, vanilla-extract plugins are not bundled even though we tell rollup
93
- // to bundle in the renderer build. So we do an esbuild pass after. Really clunky.
94
- await esbuild.build({
95
- sourcemap: true,
96
- entryPoints: ["./node_modules/_reactivated/renderer.mjs"],
97
- bundle: true,
98
- platform: "node",
99
- outfile: "./node_modules/_reactivated/renderer.js",
100
- });
101
-
102
- await fs.unlink("./node_modules/_reactivated/renderer.mjs");
103
- await fs.unlink("./node_modules/_reactivated/renderer.mjs.map");
119
+
120
+ if (watch == null) {
121
+ await build(rendererConfig);
122
+ // Currently, vanilla-extract plugins are not bundled even though we tell rollup
123
+ // to bundle in the renderer build. So we do an esbuild pass after. Really clunky.
124
+ await esbuild.build({
125
+ sourcemap: true,
126
+ entryPoints: ["./node_modules/_reactivated/renderer.mjs"],
127
+ bundle: true,
128
+ platform: "node",
129
+ outfile: "./node_modules/_reactivated/renderer.js",
130
+ });
131
+ await fs.unlink("./node_modules/_reactivated/renderer.mjs");
132
+ await fs.unlink("./node_modules/_reactivated/renderer.mjs.map");
133
+ }