@modern-js/sandpack-react 3.0.0-alpha.1 → 3.0.0
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 +4 -0
- package/dist/cjs/templates/mwa.js +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/templates/index.mjs +2 -2
- package/dist/esm/templates/mwa.mjs +3 -3
- package/dist/esm-node/index.mjs +1 -0
- package/dist/esm-node/templates/common.mjs +1 -0
- package/dist/esm-node/templates/index.mjs +1 -0
- package/dist/esm-node/templates/mwa.mjs +3 -2
- package/package.json +9 -16
package/CHANGELOG.md
CHANGED
|
@@ -29,12 +29,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const external_common_js_namespaceObject = require("./common.js");
|
|
30
30
|
const MWAFiles = {
|
|
31
31
|
...external_common_js_namespaceObject.commonFiles,
|
|
32
|
-
".browserslistrc": "chrome >=
|
|
32
|
+
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
33
33
|
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
34
34
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
35
35
|
"biome.json": '{\n "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",\n "vcs": {\n "enabled": true,\n "defaultBranch": "main",\n "clientKind": "git",\n "useIgnoreFile": true\n },\n "formatter": {\n "enabled": true,\n "indentStyle": "space"\n },\n "javascript": {\n "formatter": {\n "quoteStyle": "single",\n "arrowParentheses": "asNeeded",\n "jsxQuoteStyle": "double",\n "lineWidth": 80\n }\n },\n "linter": {\n "enabled": true,\n "rules": {\n "recommended": true,\n "suspicious": {\n "noDuplicateFontNames": "off"\n }\n }\n },\n "organizeImports": {\n "enabled": true\n },\n "files": {\n "ignoreUnknown": true,\n "ignore": [".vscode/**/*", "node_modules/**/*", "dist/**/*"]\n }\n}\n',
|
|
36
36
|
"modern.config.ts": "import { appTools, defineConfig } from '@modern-js/app-tools';\n\n// https://modernjs.dev/en/configure/app/usage\nexport default defineConfig({\n plugins: [appTools()],\n});\n",
|
|
37
|
-
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0
|
|
37
|
+
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0",\n "react": "^19.2.3",\n "react-dom": "^19.2.0"\n },\n "devDependencies": {\n "@modern-js/app-tools": "3.0.0",\n "@modern-js/tsconfig": "3.0.0",\n "@biomejs/biome": "1.9.4",\n "typescript": "~5.7.3",\n "@types/node": "^20",\n "@types/react": "^19.1.8",\n "@types/react-dom": "^19.1.6",\n "lint-staged": "~15.4.0",\n "simple-git-hooks": "^2.11.1",\n "rimraf": "^6.0.1"\n }\n}\n',
|
|
38
38
|
"tsconfig.json": "{\n \"extends\": \"@modern-js/tsconfig/base\",\n \"compilerOptions\": {\n \"declaration\": false,\n \"jsx\": \"preserve\",\n \"baseUrl\": \"./\",\n \"paths\": {\n \"@/*\": [\"./src/*\"],\n \"@shared/*\": [\"./shared/*\"]\n }\n },\n \"include\": [\"src\", \"shared\", \"config\", \"modern.config.ts\"],\n \"exclude\": [\"**/node_modules\"]\n}\n",
|
|
39
39
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n",
|
|
40
40
|
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\n\nexport default defineRuntimeConfig({});\n",
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { OpenInCodeSandboxButton, SandpackCodeEditor, SandpackFileExplorer, SandpackLayout, SandpackProvider } from "@codesandbox/sandpack-react";
|
|
3
|
-
import { ModernTemplates } from "./templates";
|
|
3
|
+
import { ModernTemplates } from "./templates/index.mjs";
|
|
4
4
|
function fileterFiles(files, removeFiles) {
|
|
5
5
|
if (0 === removeFiles.length) return files;
|
|
6
6
|
const result = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as __rspack_external__mwa_mjs_5d9bbc8d from "./mwa.mjs";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
3
|
"./mwa" (module) {
|
|
4
|
-
module.exports =
|
|
4
|
+
module.exports = __rspack_external__mwa_mjs_5d9bbc8d;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
7
|
var __webpack_module_cache__ = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { commonFiles } from "./common";
|
|
1
|
+
import { commonFiles } from "./common.mjs";
|
|
2
2
|
const MWAFiles = {
|
|
3
3
|
...commonFiles,
|
|
4
|
-
".browserslistrc": "chrome >=
|
|
4
|
+
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
5
5
|
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
6
6
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
7
7
|
"biome.json": '{\n "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",\n "vcs": {\n "enabled": true,\n "defaultBranch": "main",\n "clientKind": "git",\n "useIgnoreFile": true\n },\n "formatter": {\n "enabled": true,\n "indentStyle": "space"\n },\n "javascript": {\n "formatter": {\n "quoteStyle": "single",\n "arrowParentheses": "asNeeded",\n "jsxQuoteStyle": "double",\n "lineWidth": 80\n }\n },\n "linter": {\n "enabled": true,\n "rules": {\n "recommended": true,\n "suspicious": {\n "noDuplicateFontNames": "off"\n }\n }\n },\n "organizeImports": {\n "enabled": true\n },\n "files": {\n "ignoreUnknown": true,\n "ignore": [".vscode/**/*", "node_modules/**/*", "dist/**/*"]\n }\n}\n',
|
|
8
8
|
"modern.config.ts": "import { appTools, defineConfig } from '@modern-js/app-tools';\n\n// https://modernjs.dev/en/configure/app/usage\nexport default defineConfig({\n plugins: [appTools()],\n});\n",
|
|
9
|
-
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0
|
|
9
|
+
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0",\n "react": "^19.2.3",\n "react-dom": "^19.2.0"\n },\n "devDependencies": {\n "@modern-js/app-tools": "3.0.0",\n "@modern-js/tsconfig": "3.0.0",\n "@biomejs/biome": "1.9.4",\n "typescript": "~5.7.3",\n "@types/node": "^20",\n "@types/react": "^19.1.8",\n "@types/react-dom": "^19.1.6",\n "lint-staged": "~15.4.0",\n "simple-git-hooks": "^2.11.1",\n "rimraf": "^6.0.1"\n }\n}\n',
|
|
10
10
|
"tsconfig.json": "{\n \"extends\": \"@modern-js/tsconfig/base\",\n \"compilerOptions\": {\n \"declaration\": false,\n \"jsx\": \"preserve\",\n \"baseUrl\": \"./\",\n \"paths\": {\n \"@/*\": [\"./src/*\"],\n \"@shared/*\": [\"./shared/*\"]\n }\n },\n \"include\": [\"src\", \"shared\", \"config\", \"modern.config.ts\"],\n \"exclude\": [\"**/node_modules\"]\n}\n",
|
|
11
11
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n",
|
|
12
12
|
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\n\nexport default defineRuntimeConfig({});\n",
|
package/dist/esm-node/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "node:module";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { OpenInCodeSandboxButton, SandpackCodeEditor, SandpackFileExplorer, SandpackLayout, SandpackProvider } from "@codesandbox/sandpack-react";
|
|
3
4
|
import { ModernTemplates } from "./templates/index.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "node:module";
|
|
1
2
|
const commonFiles = {
|
|
2
3
|
".codesandbox/environment.json": "{\n \"nodeVersion\": 18\n}\n",
|
|
3
4
|
".codesandbox/tasks.json": "{\n \"$schema\": \"https://codesandbox.io/schemas/tasks.json\",\n \"setupTasks\": [\n {\n \"name\": \"Installing Dependencies\",\n \"command\": \"pnpm install\"\n }\n ],\n \"tasks\": {\n \"start\": {\n \"name\": \"Application\",\n \"command\": \"pnpm run start\",\n \"runAtStart\": true,\n \"restartOn\": {\n \"files\": [\"pnpm-lock.yaml\"]\n }\n }\n }\n}\n"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import "node:module";
|
|
1
2
|
import { commonFiles } from "./common.mjs";
|
|
2
3
|
const MWAFiles = {
|
|
3
4
|
...commonFiles,
|
|
4
|
-
".browserslistrc": "chrome >=
|
|
5
|
+
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
5
6
|
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
6
7
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
7
8
|
"biome.json": '{\n "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",\n "vcs": {\n "enabled": true,\n "defaultBranch": "main",\n "clientKind": "git",\n "useIgnoreFile": true\n },\n "formatter": {\n "enabled": true,\n "indentStyle": "space"\n },\n "javascript": {\n "formatter": {\n "quoteStyle": "single",\n "arrowParentheses": "asNeeded",\n "jsxQuoteStyle": "double",\n "lineWidth": 80\n }\n },\n "linter": {\n "enabled": true,\n "rules": {\n "recommended": true,\n "suspicious": {\n "noDuplicateFontNames": "off"\n }\n }\n },\n "organizeImports": {\n "enabled": true\n },\n "files": {\n "ignoreUnknown": true,\n "ignore": [".vscode/**/*", "node_modules/**/*", "dist/**/*"]\n }\n}\n',
|
|
8
9
|
"modern.config.ts": "import { appTools, defineConfig } from '@modern-js/app-tools';\n\n// https://modernjs.dev/en/configure/app/usage\nexport default defineConfig({\n plugins: [appTools()],\n});\n",
|
|
9
|
-
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0
|
|
10
|
+
"package.json": '{\n "name": "modern-app",\n "version": "0.1.0",\n "scripts": {\n "reset": "npx rimraf node_modules ./**/node_modules",\n "dev": "modern dev",\n "build": "modern build",\n "serve": "modern serve",\n "lint": "biome check",\n "prepare": "simple-git-hooks"\n },\n "engines": {\n "node": ">=20"\n },\n "lint-staged": {\n "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [\n "biome check --files-ignore-unknown=true"\n ]\n },\n "simple-git-hooks": {\n "pre-commit": "npx lint-staged"\n },\n "dependencies": {\n "@modern-js/runtime": "3.0.0",\n "react": "^19.2.3",\n "react-dom": "^19.2.0"\n },\n "devDependencies": {\n "@modern-js/app-tools": "3.0.0",\n "@modern-js/tsconfig": "3.0.0",\n "@biomejs/biome": "1.9.4",\n "typescript": "~5.7.3",\n "@types/node": "^20",\n "@types/react": "^19.1.8",\n "@types/react-dom": "^19.1.6",\n "lint-staged": "~15.4.0",\n "simple-git-hooks": "^2.11.1",\n "rimraf": "^6.0.1"\n }\n}\n',
|
|
10
11
|
"tsconfig.json": "{\n \"extends\": \"@modern-js/tsconfig/base\",\n \"compilerOptions\": {\n \"declaration\": false,\n \"jsx\": \"preserve\",\n \"baseUrl\": \"./\",\n \"paths\": {\n \"@/*\": [\"./src/*\"],\n \"@shared/*\": [\"./shared/*\"]\n }\n },\n \"include\": [\"src\", \"shared\", \"config\", \"modern.config.ts\"],\n \"exclude\": [\"**/node_modules\"]\n}\n",
|
|
11
12
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n",
|
|
12
13
|
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\n\nexport default defineRuntimeConfig({});\n",
|
package/package.json
CHANGED
|
@@ -15,19 +15,13 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.0.0
|
|
19
|
-
"jsnext:source": "./src/index.ts",
|
|
18
|
+
"version": "3.0.0",
|
|
20
19
|
"types": "./dist/types/index.d.ts",
|
|
21
20
|
"main": "./dist/cjs/index.js",
|
|
22
21
|
"module": "./dist/esm/index.mjs",
|
|
23
22
|
"exports": {
|
|
24
23
|
".": {
|
|
25
24
|
"types": "./dist/types/index.d.ts",
|
|
26
|
-
"jsnext:source": "./src/index.ts",
|
|
27
|
-
"node": {
|
|
28
|
-
"import": "./dist/esm-node/index.mjs",
|
|
29
|
-
"require": "./dist/cjs/index.js"
|
|
30
|
-
},
|
|
31
25
|
"default": "./dist/esm/index.mjs"
|
|
32
26
|
}
|
|
33
27
|
},
|
|
@@ -41,23 +35,22 @@
|
|
|
41
35
|
"dependencies": {
|
|
42
36
|
"@codesandbox/sandpack-react": "^2.20.0",
|
|
43
37
|
"@swc/helpers": "^0.5.17",
|
|
44
|
-
"react": "^19.2.
|
|
45
|
-
"react-dom": "^19.2.
|
|
38
|
+
"react": "^19.2.4",
|
|
39
|
+
"react-dom": "^19.2.4"
|
|
46
40
|
},
|
|
47
41
|
"devDependencies": {
|
|
48
|
-
"@modern-js/codesmith-api-handlebars": "2.6.
|
|
49
|
-
"@modern-js/codesmith-utils": "2.6.
|
|
50
|
-
"@rslib/core": "0.19.
|
|
42
|
+
"@modern-js/codesmith-api-handlebars": "2.6.9",
|
|
43
|
+
"@modern-js/codesmith-utils": "2.6.9",
|
|
44
|
+
"@rslib/core": "0.19.4",
|
|
51
45
|
"@types/node": "^20",
|
|
52
|
-
"@types/react": "^19.2.
|
|
46
|
+
"@types/react": "^19.2.10",
|
|
53
47
|
"@types/react-dom": "^19.2.3",
|
|
54
48
|
"@types/recursive-readdir": "^2.2.4",
|
|
55
49
|
"recursive-readdir": "^2.2.3",
|
|
56
50
|
"ts-node": "^10.9.2",
|
|
57
51
|
"typescript": "^5",
|
|
58
|
-
"@modern-js/create": "3.0.0
|
|
59
|
-
"@modern-js/rslib": "2.68.10"
|
|
60
|
-
"@scripts/jest-config": "2.66.0"
|
|
52
|
+
"@modern-js/create": "3.0.0",
|
|
53
|
+
"@modern-js/rslib": "2.68.10"
|
|
61
54
|
},
|
|
62
55
|
"sideEffects": false,
|
|
63
56
|
"publishConfig": {
|