create-nube-app 0.0.2
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/biome.json +12 -0
- package/index.js +3 -0
- package/package.json +27 -0
- package/src/index.ts +81 -0
- package/templates/minimal/README.md +11 -0
- package/templates/minimal/package-lock.json +1860 -0
- package/templates/minimal/package.json +13 -0
- package/templates/minimal/src/main.ts +7 -0
- package/templates/minimal/tsconfig.json +10 -0
- package/templates/minimal/tsup.config.js +14 -0
- package/templates/minimal-ui/README.md +11 -0
- package/templates/minimal-ui/package-lock.json +1042 -0
- package/templates/minimal-ui/package.json +17 -0
- package/templates/minimal-ui/src/main.ts +28 -0
- package/templates/minimal-ui/tsconfig.json +11 -0
- package/templates/minimal-ui/tsup.config.js +18 -0
- package/templates/minimal-ui-jsx/README.md +12 -0
- package/templates/minimal-ui-jsx/package-lock.json +1883 -0
- package/templates/minimal-ui-jsx/package.json +16 -0
- package/templates/minimal-ui-jsx/src/main.tsx +28 -0
- package/templates/minimal-ui-jsx/tsconfig.json +14 -0
- package/templates/minimal-ui-jsx/tsup.config.js +21 -0
- package/tsconfig.json +14 -0
- package/tsup.config.js +13 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "minimal-jsx-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsup"
|
|
7
|
+
},
|
|
8
|
+
"author": "Tiendanube / Nuvemshop",
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@tiendanube/nube-sdk-ui": "0.1.3-alpha",
|
|
11
|
+
"@tiendanube/nube-sdk-jsx": "0.1.0-alpha",
|
|
12
|
+
"@tiendanube/nube-sdk-types": "0.2.6-alpha",
|
|
13
|
+
"tsup": "^8.3.0",
|
|
14
|
+
"typescript": "^5.6.2"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NubeSDK } from "@tiendanube/nube-sdk-types";
|
|
2
|
+
import { Box, Field, Txt } from "@tiendanube/nube-sdk-jsx";
|
|
3
|
+
|
|
4
|
+
function MyComponent() {
|
|
5
|
+
return (
|
|
6
|
+
<Box width={100} height={200}>
|
|
7
|
+
<Txt>Hello!!</Txt>
|
|
8
|
+
<Field
|
|
9
|
+
id="myField"
|
|
10
|
+
label="Name"
|
|
11
|
+
name="Name"
|
|
12
|
+
onChange={(e) => {
|
|
13
|
+
console.log(`User name: ${e.value}`);
|
|
14
|
+
}}
|
|
15
|
+
/>
|
|
16
|
+
</Box>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function App(nube: NubeSDK) {
|
|
21
|
+
nube.send("ui:slot:set", () => ({
|
|
22
|
+
ui: {
|
|
23
|
+
slots: {
|
|
24
|
+
after_line_items: <MyComponent />,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2016",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"jsxImportSource": "@tiendanube/nube-sdk-jsx/dist",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"strict": true
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"./src/**/*"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["src/main.tsx"],
|
|
5
|
+
format: ["esm"],
|
|
6
|
+
target: "esnext",
|
|
7
|
+
clean: true,
|
|
8
|
+
minify: true,
|
|
9
|
+
bundle: true,
|
|
10
|
+
sourcemap: false,
|
|
11
|
+
splitting: false,
|
|
12
|
+
skipNodeModulesBundle: false,
|
|
13
|
+
esbuildOptions(options) {
|
|
14
|
+
options.alias = {
|
|
15
|
+
"@tiendanube/nube-sdk-jsx/dist/jsx-runtime": "@tiendanube/nube-sdk-jsx/jsx-runtime",
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
outExtension: ({ options }) => ({
|
|
19
|
+
js: options.minify ? ".min.js" : ".js"
|
|
20
|
+
})
|
|
21
|
+
});
|
package/tsconfig.json
ADDED
package/tsup.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// tsup.config.js
|
|
2
|
+
import { defineConfig } from 'tsup';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
entry: ['src/index.ts'], // ponto de entrada do seu projeto
|
|
6
|
+
format: ['esm'], // formatos de saída
|
|
7
|
+
bundle: false, // não agrupa os módulos em um único arquivo
|
|
8
|
+
minify: false, // desabilita a minificação
|
|
9
|
+
sourcemap: false, // gera sourcemaps para facilitar o debug
|
|
10
|
+
clean: true, // limpa a pasta de saída antes de cada build
|
|
11
|
+
target: 'node16', // define o alvo (ajuste conforme sua versão do Node)
|
|
12
|
+
dts: false, // gera arquivos de definição TypeScript (.d.ts)
|
|
13
|
+
});
|