edge-functions 2.3.0-stage.2 → 2.3.0-stage.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.3.0-stage.3](https://github.com/aziontech/vulcan/compare/v2.3.0-stage.2...v2.3.0-stage.3) (2024-01-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * angular deliver preset ([#215](https://github.com/aziontech/vulcan/issues/215)) ([5bb2d77](https://github.com/aziontech/vulcan/commit/5bb2d77c5ca40ef688f50826a55bf384759b5a61))
7
+ * angular preset (deliver) ([f8c12b6](https://github.com/aziontech/vulcan/commit/f8c12b6c0e475a4ee77b127d9be3c2d3ac6b9e49))
8
+
1
9
  ## [2.3.0-stage.2](https://github.com/aziontech/vulcan/compare/v2.3.0-stage.1...v2.3.0-stage.2) (2024-01-18)
2
10
 
3
11
 
@@ -1,4 +1,6 @@
1
- import { exec, getPackageManager, Manifest } from '#utils';
1
+ import { exec, getPackageManager, Manifest, feedback } from '#utils';
2
+ import path from 'path';
3
+ import fs from 'fs-extra';
2
4
 
3
5
  const packageManager = await getPackageManager();
4
6
 
@@ -18,11 +20,39 @@ async function prebuild() {
18
20
 
19
21
  Manifest.setRoute({
20
22
  from: '/',
21
- to: '.edge/storage',
23
+ to: path.join('.edge', 'storage'),
22
24
  priority: 1,
23
25
  type: 'deliver',
24
26
  });
25
27
  Manifest.generate();
28
+
29
+ // Move the contents of the 'Browser' folder, which contains static files, to the root of the storage.
30
+ const oldPath = path.join(process.cwd(), '.edge', 'storage', 'browser');
31
+ const newPath = path.join(process.cwd(), '.edge', 'storage');
32
+
33
+ const files = await fs.readdir(oldPath);
34
+ await Promise.all(
35
+ files.map(async (file) => {
36
+ await fs.move(path.join(oldPath, file), path.join(newPath, file));
37
+ }),
38
+ );
39
+
40
+ // Remove the original folder
41
+ await fs.remove(oldPath);
42
+
43
+ // If the folder exists, it means that the application is using server-side rendering (SSR)
44
+ // functionalities. In this case, a warning message is logged.
45
+ const serverFolderPath = path.join(
46
+ process.cwd(),
47
+ '.edge',
48
+ 'storage',
49
+ 'server',
50
+ );
51
+ if (fs.existsSync(serverFolderPath)) {
52
+ feedback.prebuild.warn(
53
+ `It looks like you are using SSR functionalities. Server-side functionality will not work in 'deliver' mode.`,
54
+ );
55
+ }
26
56
  }
27
57
 
28
58
  export default prebuild;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "edge-functions",
3
3
  "type": "module",
4
- "version": "2.3.0-stage.2",
4
+ "version": "2.3.0-stage.3",
5
5
  "description": "Tool to launch and build JavaScript/Frameworks. This tool automates polyfills for Edge Computing and assists in creating Workers, notably for the Azion platform.",
6
6
  "main": "lib/main.js",
7
7
  "bin": {
@@ -62,6 +62,7 @@
62
62
  "events": "^3.3.0",
63
63
  "fast-glob": "^3.3.1",
64
64
  "form-data": "^4.0.0",
65
+ "fs-extra": "^11.2.0",
65
66
  "https-browserify": "^1.0.0",
66
67
  "inquirer": "^9.2.7",
67
68
  "install": "^0.13.0",