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.
@@ -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
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "types": [
11
+ "node"
12
+ ]
13
+ }
14
+ }
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
+ });