@cedarjs/cli 6.0.0-canary.2877 → 6.0.0-canary.2880
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.
|
@@ -90,15 +90,20 @@ const handler = async ({ force }) => {
|
|
|
90
90
|
title: "Replacing Redwood's Error boundary",
|
|
91
91
|
task: async () => {
|
|
92
92
|
const contentLines = fs.readFileSync(rwPaths.web.app).toString().split("\n");
|
|
93
|
+
const webImportRe = /^import \{ FatalErrorBoundary, ((?:Cedar|Redwood)Provider) \} from '@cedarjs\/web'$/;
|
|
93
94
|
const webImportIndex = contentLines.findLastIndex(
|
|
94
|
-
(line) =>
|
|
95
|
-
line
|
|
96
|
-
)
|
|
95
|
+
(line) => webImportRe.test(line)
|
|
97
96
|
);
|
|
97
|
+
if (webImportIndex === -1) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
`Could not find "import { FatalErrorBoundary, CedarProvider } from '@cedarjs/web'" in web/src/App`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const providerName = contentLines[webImportIndex].match(webImportRe)?.[1];
|
|
98
103
|
contentLines.splice(
|
|
99
104
|
webImportIndex,
|
|
100
105
|
1,
|
|
101
|
-
|
|
106
|
+
`import { ${providerName} } from '@cedarjs/web'`
|
|
102
107
|
);
|
|
103
108
|
const boundaryOpenIndex = contentLines.findLastIndex(
|
|
104
109
|
(line) => line.includes("<FatalErrorBoundary page={FatalErrorPage}>")
|
|
@@ -54,7 +54,9 @@ async function handler({
|
|
|
54
54
|
insertComponent: {
|
|
55
55
|
name: "ChakraProvider",
|
|
56
56
|
props: { theme: "extendedTheme" },
|
|
57
|
-
|
|
57
|
+
// Older projects (created before CedarProvider replaced the
|
|
58
|
+
// deprecated RedwoodProvider) may still use RedwoodProvider.
|
|
59
|
+
within: "CedarProvider|RedwoodProvider",
|
|
58
60
|
insertBefore: "<ColorModeScript />"
|
|
59
61
|
},
|
|
60
62
|
imports: [
|
|
@@ -77,7 +77,9 @@ async function handler({
|
|
|
77
77
|
insertComponent: {
|
|
78
78
|
name: "MantineProvider",
|
|
79
79
|
props: { theme: "theme" },
|
|
80
|
-
|
|
80
|
+
// Older projects (created before CedarProvider replaced the
|
|
81
|
+
// deprecated RedwoodProvider) may still use RedwoodProvider.
|
|
82
|
+
within: "CedarProvider|RedwoodProvider"
|
|
81
83
|
},
|
|
82
84
|
imports: [
|
|
83
85
|
"import { MantineProvider } from '@mantine/core'",
|
package/dist/lib/extendFile.js
CHANGED
|
@@ -56,7 +56,7 @@ function insertComponent(content, {
|
|
|
56
56
|
"Exactly one of (around | within) must be defined. Choose one."
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
-
const target = around ?? within
|
|
59
|
+
const target = `(?:${around ?? within})`;
|
|
60
60
|
const findTagIndex = (regex) => content.findIndex((line) => regex.test(line));
|
|
61
61
|
let open = findTagIndex(new RegExp(`([^\\S\r
|
|
62
62
|
]*)<${target}\\s*(.*)\\s*>`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2880",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"@babel/preset-typescript": "7.29.7",
|
|
37
37
|
"@babel/traverse": "7.29.7",
|
|
38
38
|
"@babel/types": "7.29.7",
|
|
39
|
-
"@cedarjs/api-server": "6.0.0-canary.
|
|
40
|
-
"@cedarjs/babel-config": "6.0.0-canary.
|
|
41
|
-
"@cedarjs/cli-helpers": "6.0.0-canary.
|
|
42
|
-
"@cedarjs/internal": "6.0.0-canary.
|
|
43
|
-
"@cedarjs/prerender": "6.0.0-canary.
|
|
44
|
-
"@cedarjs/project-config": "6.0.0-canary.
|
|
45
|
-
"@cedarjs/structure": "6.0.0-canary.
|
|
46
|
-
"@cedarjs/telemetry": "6.0.0-canary.
|
|
47
|
-
"@cedarjs/utils": "6.0.0-canary.
|
|
48
|
-
"@cedarjs/vite": "6.0.0-canary.
|
|
49
|
-
"@cedarjs/web-server": "6.0.0-canary.
|
|
39
|
+
"@cedarjs/api-server": "6.0.0-canary.2880",
|
|
40
|
+
"@cedarjs/babel-config": "6.0.0-canary.2880",
|
|
41
|
+
"@cedarjs/cli-helpers": "6.0.0-canary.2880",
|
|
42
|
+
"@cedarjs/internal": "6.0.0-canary.2880",
|
|
43
|
+
"@cedarjs/prerender": "6.0.0-canary.2880",
|
|
44
|
+
"@cedarjs/project-config": "6.0.0-canary.2880",
|
|
45
|
+
"@cedarjs/structure": "6.0.0-canary.2880",
|
|
46
|
+
"@cedarjs/telemetry": "6.0.0-canary.2880",
|
|
47
|
+
"@cedarjs/utils": "6.0.0-canary.2880",
|
|
48
|
+
"@cedarjs/vite": "6.0.0-canary.2880",
|
|
49
|
+
"@cedarjs/web-server": "6.0.0-canary.2880",
|
|
50
50
|
"@listr2/prompt-adapter-enquirer": "4.3.0",
|
|
51
51
|
"@opentelemetry/api": "1.9.1",
|
|
52
52
|
"@opentelemetry/core": "1.30.1",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"yargs": "17.7.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
97
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2880",
|
|
98
98
|
"@prisma/dmmf": "7.8.0",
|
|
99
99
|
"@types/archiver": "^7.0.0",
|
|
100
100
|
"memfs": "4.64.0",
|