create-napps 0.0.3 → 0.0.4
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/app-extensions/index.ts +3 -0
- package/templates/app-extensions/napps.config.json +17 -0
- package/templates/app-extensions/package-lock.json +373 -0
- package/templates/app-extensions/package.json +18 -0
- package/templates/app-extensions/src/extension.ts +3 -0
- package/templates/app-extensions/tsconfig.json +25 -0
- package/templates/app-extensions/vite.config.ts +14 -0
- package/templates/pdp-template/dist/component-extension.es.js +1 -1
package/dist/index.js
CHANGED
|
@@ -80,4 +80,4 @@ Instructions:
|
|
|
80
80
|
`:``}renderCurrentInput(){return`
|
|
81
81
|
Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(s.radioOn):s.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),ke=g(((e,t)=>{let n=b(),r=Y(),{style:i,clear:a}=J(),{erase:o,cursor:s}=C();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
82
82
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
83
|
-
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),Ae=g(((e,t)=>{t.exports={TextPrompt:me(),SelectPrompt:he(),TogglePrompt:ge(),DatePrompt:Ee(),NumberPrompt:De(),MultiselectPrompt:Z(),AutocompletePrompt:Oe(),AutocompleteMultiselectPrompt:Q(),ConfirmPrompt:ke()}})),je=g((e=>{let t=e,n=Ae(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),Me=g(((e,t)=>{let n=je(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),Ne=v(g(((e,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?W():Me()}))(),1);const Pe=[{value:`pdp-template`,title:`Product layout`,description:`A template for creating a PDP Component extension`}],Fe=/^[a-z0-9-]+$/,Ie=process.cwd(),$=async(e,t)=>{let r=await c(e);for(let s of r){let r=n.join(e,s),c=n.join(t,s);(await a(r)).isDirectory()?(await o(c),await $(r,c)):await i(r,c)}},Le=async(e,t)=>{let r=n.join(e,`package.json`);try{let e=await s(r,`utf8`),n=JSON.parse(e);n.name=t,await l(r,JSON.stringify(n,null,2),`utf8`)}catch(e){console.log(e.message)}},Re=async(e,t)=>{let r=n.join(e,`napps.config.json`);try{let e=await s(r,`utf8`),n=JSON.parse(e);n.projectName=t,await l(r,JSON.stringify(n,null,2),`utf8`)}catch(e){console.log(e.message)}};(async()=>{try{let{projectName:e,template:i}=await(0,Ne.default)([{type:`select`,name:`template`,message:`Select template`,choices:Pe},{type:`text`,name:`projectName`,message:`Enter your project name`,initial:`my-project`,format:e=>e.toLowerCase().split(` `).join(`-`),validate:e=>Fe.test(e)?!0:`Project name should not contain special characters except hyphen (-)`}]),a=n.join(Ie,e),o=n.resolve(t(import.meta.url),`../../templates`,`${i}`);if(console.log(a),!r.existsSync(a))console.log(`Creating directory...`),r.mkdirSync(a,{recursive:!0}),await $(o,a),await Le(a,e),await Re(a,e),console.log(`Finished generating your project ${e}`),console.log(`cd ${e}`),console.log(`yarn/npm install`);else throw Error(`Target directory already exist!`)}catch(e){console.log(e.message)}})();export{};
|
|
83
|
+
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),Ae=g(((e,t)=>{t.exports={TextPrompt:me(),SelectPrompt:he(),TogglePrompt:ge(),DatePrompt:Ee(),NumberPrompt:De(),MultiselectPrompt:Z(),AutocompletePrompt:Oe(),AutocompleteMultiselectPrompt:Q(),ConfirmPrompt:ke()}})),je=g((e=>{let t=e,n=Ae(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),Me=g(((e,t)=>{let n=je(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e)if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),m){for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch{f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),Ne=v(g(((e,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?W():Me()}))(),1);const Pe=[{value:`pdp-template`,title:`Product layout`,description:`A template for creating a PDP Component extension`},{value:`app-extensions`,title:`App Extensions`,description:`A template for creating app extensions`}],Fe=/^[a-z0-9-]+$/,Ie=process.cwd(),$=async(e,t)=>{let r=await c(e);for(let s of r){let r=n.join(e,s),c=n.join(t,s);(await a(r)).isDirectory()?(await o(c),await $(r,c)):await i(r,c)}},Le=async(e,t)=>{let r=n.join(e,`package.json`);try{let e=await s(r,`utf8`),n=JSON.parse(e);n.name=t,await l(r,JSON.stringify(n,null,2),`utf8`)}catch(e){console.log(e.message)}},Re=async(e,t)=>{let r=n.join(e,`napps.config.json`);try{let e=await s(r,`utf8`),n=JSON.parse(e);n.projectName=t,await l(r,JSON.stringify(n,null,2),`utf8`)}catch(e){console.log(e.message)}};(async()=>{try{let{projectName:e,template:i}=await(0,Ne.default)([{type:`select`,name:`template`,message:`Select template`,choices:Pe},{type:`text`,name:`projectName`,message:`Enter your project name`,initial:`my-project`,format:e=>e.toLowerCase().split(` `).join(`-`),validate:e=>Fe.test(e)?!0:`Project name should not contain special characters except hyphen (-)`}]),a=n.join(Ie,e),o=n.resolve(t(import.meta.url),`../../templates`,`${i}`);if(console.log(a),!r.existsSync(a))console.log(`Creating directory...`),r.mkdirSync(a,{recursive:!0}),await $(o,a),await Le(a,e),await Re(a,e),console.log(`Finished generating your project ${e}`),console.log(`cd ${e}`),console.log(`yarn/npm install`);else throw Error(`Target directory already exist!`)}catch(e){console.log(e.message)}})();export{};
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "Product formater",
|
|
3
|
+
"supportedPdpComponents": [],
|
|
4
|
+
"supportedHomeComponents": [],
|
|
5
|
+
"supportedShopBuilderComponents": [],
|
|
6
|
+
"extensions": [
|
|
7
|
+
{
|
|
8
|
+
"packageName": "d5tps6cauagvctt5gpq0",
|
|
9
|
+
"name": "Product formater",
|
|
10
|
+
"renderer": "product-formater",
|
|
11
|
+
"extensionType": "extension",
|
|
12
|
+
"settings": []
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"identifier": "d5tps64auagvctt5gppg",
|
|
16
|
+
"components": []
|
|
17
|
+
}
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pdp-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "pdp-template",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"component-extension": "file:../../../component-extension"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"typescript": "~5.9.3",
|
|
15
|
+
"vite": "npm:rolldown-vite@7.2.5"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"../../../component-extension": {
|
|
19
|
+
"version": "1.0.0",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "~5.9.3",
|
|
22
|
+
"vite": "npm:rolldown-vite@7.2.5",
|
|
23
|
+
"vite-plugin-dts": "^4.5.4"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"node_modules/@oxc-project/runtime": {
|
|
27
|
+
"version": "0.97.0",
|
|
28
|
+
"dev": true,
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"node_modules/@oxc-project/types": {
|
|
35
|
+
"version": "0.97.0",
|
|
36
|
+
"dev": true,
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"funding": {
|
|
39
|
+
"url": "https://github.com/sponsors/Boshen"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
|
43
|
+
"version": "1.0.0-beta.50",
|
|
44
|
+
"cpu": [
|
|
45
|
+
"x64"
|
|
46
|
+
],
|
|
47
|
+
"dev": true,
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"optional": true,
|
|
50
|
+
"os": [
|
|
51
|
+
"linux"
|
|
52
|
+
],
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"node_modules/@rolldown/binding-linux-x64-musl": {
|
|
58
|
+
"version": "1.0.0-beta.50",
|
|
59
|
+
"cpu": [
|
|
60
|
+
"x64"
|
|
61
|
+
],
|
|
62
|
+
"dev": true,
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"optional": true,
|
|
65
|
+
"os": [
|
|
66
|
+
"linux"
|
|
67
|
+
],
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"node_modules/@rolldown/pluginutils": {
|
|
73
|
+
"version": "1.0.0-beta.50",
|
|
74
|
+
"dev": true,
|
|
75
|
+
"license": "MIT"
|
|
76
|
+
},
|
|
77
|
+
"node_modules/component-extension": {
|
|
78
|
+
"resolved": "../../../component-extension",
|
|
79
|
+
"link": true
|
|
80
|
+
},
|
|
81
|
+
"node_modules/detect-libc": {
|
|
82
|
+
"version": "2.1.2",
|
|
83
|
+
"dev": true,
|
|
84
|
+
"license": "Apache-2.0",
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=8"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"node_modules/fdir": {
|
|
90
|
+
"version": "6.5.0",
|
|
91
|
+
"dev": true,
|
|
92
|
+
"license": "MIT",
|
|
93
|
+
"engines": {
|
|
94
|
+
"node": ">=12.0.0"
|
|
95
|
+
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"picomatch": "^3 || ^4"
|
|
98
|
+
},
|
|
99
|
+
"peerDependenciesMeta": {
|
|
100
|
+
"picomatch": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"node_modules/lightningcss": {
|
|
106
|
+
"version": "1.30.2",
|
|
107
|
+
"dev": true,
|
|
108
|
+
"license": "MPL-2.0",
|
|
109
|
+
"dependencies": {
|
|
110
|
+
"detect-libc": "^2.0.3"
|
|
111
|
+
},
|
|
112
|
+
"engines": {
|
|
113
|
+
"node": ">= 12.0.0"
|
|
114
|
+
},
|
|
115
|
+
"funding": {
|
|
116
|
+
"type": "opencollective",
|
|
117
|
+
"url": "https://opencollective.com/parcel"
|
|
118
|
+
},
|
|
119
|
+
"optionalDependencies": {
|
|
120
|
+
"lightningcss-android-arm64": "1.30.2",
|
|
121
|
+
"lightningcss-darwin-arm64": "1.30.2",
|
|
122
|
+
"lightningcss-darwin-x64": "1.30.2",
|
|
123
|
+
"lightningcss-freebsd-x64": "1.30.2",
|
|
124
|
+
"lightningcss-linux-arm-gnueabihf": "1.30.2",
|
|
125
|
+
"lightningcss-linux-arm64-gnu": "1.30.2",
|
|
126
|
+
"lightningcss-linux-arm64-musl": "1.30.2",
|
|
127
|
+
"lightningcss-linux-x64-gnu": "1.30.2",
|
|
128
|
+
"lightningcss-linux-x64-musl": "1.30.2",
|
|
129
|
+
"lightningcss-win32-arm64-msvc": "1.30.2",
|
|
130
|
+
"lightningcss-win32-x64-msvc": "1.30.2"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"node_modules/lightningcss-linux-x64-gnu": {
|
|
134
|
+
"version": "1.30.2",
|
|
135
|
+
"cpu": [
|
|
136
|
+
"x64"
|
|
137
|
+
],
|
|
138
|
+
"dev": true,
|
|
139
|
+
"license": "MPL-2.0",
|
|
140
|
+
"optional": true,
|
|
141
|
+
"os": [
|
|
142
|
+
"linux"
|
|
143
|
+
],
|
|
144
|
+
"engines": {
|
|
145
|
+
"node": ">= 12.0.0"
|
|
146
|
+
},
|
|
147
|
+
"funding": {
|
|
148
|
+
"type": "opencollective",
|
|
149
|
+
"url": "https://opencollective.com/parcel"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"node_modules/lightningcss-linux-x64-musl": {
|
|
153
|
+
"version": "1.30.2",
|
|
154
|
+
"cpu": [
|
|
155
|
+
"x64"
|
|
156
|
+
],
|
|
157
|
+
"dev": true,
|
|
158
|
+
"license": "MPL-2.0",
|
|
159
|
+
"optional": true,
|
|
160
|
+
"os": [
|
|
161
|
+
"linux"
|
|
162
|
+
],
|
|
163
|
+
"engines": {
|
|
164
|
+
"node": ">= 12.0.0"
|
|
165
|
+
},
|
|
166
|
+
"funding": {
|
|
167
|
+
"type": "opencollective",
|
|
168
|
+
"url": "https://opencollective.com/parcel"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"node_modules/nanoid": {
|
|
172
|
+
"version": "3.3.11",
|
|
173
|
+
"dev": true,
|
|
174
|
+
"funding": [
|
|
175
|
+
{
|
|
176
|
+
"type": "github",
|
|
177
|
+
"url": "https://github.com/sponsors/ai"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"license": "MIT",
|
|
181
|
+
"bin": {
|
|
182
|
+
"nanoid": "bin/nanoid.cjs"
|
|
183
|
+
},
|
|
184
|
+
"engines": {
|
|
185
|
+
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"node_modules/picocolors": {
|
|
189
|
+
"version": "1.1.1",
|
|
190
|
+
"dev": true,
|
|
191
|
+
"license": "ISC"
|
|
192
|
+
},
|
|
193
|
+
"node_modules/picomatch": {
|
|
194
|
+
"version": "4.0.3",
|
|
195
|
+
"dev": true,
|
|
196
|
+
"license": "MIT",
|
|
197
|
+
"engines": {
|
|
198
|
+
"node": ">=12"
|
|
199
|
+
},
|
|
200
|
+
"funding": {
|
|
201
|
+
"url": "https://github.com/sponsors/jonschlinkert"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"node_modules/postcss": {
|
|
205
|
+
"version": "8.5.6",
|
|
206
|
+
"dev": true,
|
|
207
|
+
"funding": [
|
|
208
|
+
{
|
|
209
|
+
"type": "opencollective",
|
|
210
|
+
"url": "https://opencollective.com/postcss/"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "tidelift",
|
|
214
|
+
"url": "https://tidelift.com/funding/github/npm/postcss"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"type": "github",
|
|
218
|
+
"url": "https://github.com/sponsors/ai"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"license": "MIT",
|
|
222
|
+
"dependencies": {
|
|
223
|
+
"nanoid": "^3.3.11",
|
|
224
|
+
"picocolors": "^1.1.1",
|
|
225
|
+
"source-map-js": "^1.2.1"
|
|
226
|
+
},
|
|
227
|
+
"engines": {
|
|
228
|
+
"node": "^10 || ^12 || >=14"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"node_modules/rolldown": {
|
|
232
|
+
"version": "1.0.0-beta.50",
|
|
233
|
+
"dev": true,
|
|
234
|
+
"license": "MIT",
|
|
235
|
+
"dependencies": {
|
|
236
|
+
"@oxc-project/types": "=0.97.0",
|
|
237
|
+
"@rolldown/pluginutils": "1.0.0-beta.50"
|
|
238
|
+
},
|
|
239
|
+
"bin": {
|
|
240
|
+
"rolldown": "bin/cli.mjs"
|
|
241
|
+
},
|
|
242
|
+
"engines": {
|
|
243
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
244
|
+
},
|
|
245
|
+
"optionalDependencies": {
|
|
246
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.50",
|
|
247
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.50",
|
|
248
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.50",
|
|
249
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.50",
|
|
250
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.50",
|
|
251
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.50",
|
|
252
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.50",
|
|
253
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.50",
|
|
254
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.50",
|
|
255
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.50",
|
|
256
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.50",
|
|
257
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.50",
|
|
258
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.50",
|
|
259
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.50"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"node_modules/source-map-js": {
|
|
263
|
+
"version": "1.2.1",
|
|
264
|
+
"dev": true,
|
|
265
|
+
"license": "BSD-3-Clause",
|
|
266
|
+
"engines": {
|
|
267
|
+
"node": ">=0.10.0"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"node_modules/tinyglobby": {
|
|
271
|
+
"version": "0.2.15",
|
|
272
|
+
"dev": true,
|
|
273
|
+
"license": "MIT",
|
|
274
|
+
"dependencies": {
|
|
275
|
+
"fdir": "^6.5.0",
|
|
276
|
+
"picomatch": "^4.0.3"
|
|
277
|
+
},
|
|
278
|
+
"engines": {
|
|
279
|
+
"node": ">=12.0.0"
|
|
280
|
+
},
|
|
281
|
+
"funding": {
|
|
282
|
+
"url": "https://github.com/sponsors/SuperchupuDev"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"node_modules/typescript": {
|
|
286
|
+
"version": "5.9.3",
|
|
287
|
+
"dev": true,
|
|
288
|
+
"license": "Apache-2.0",
|
|
289
|
+
"bin": {
|
|
290
|
+
"tsc": "bin/tsc",
|
|
291
|
+
"tsserver": "bin/tsserver"
|
|
292
|
+
},
|
|
293
|
+
"engines": {
|
|
294
|
+
"node": ">=14.17"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"node_modules/vite": {
|
|
298
|
+
"name": "rolldown-vite",
|
|
299
|
+
"version": "7.2.5",
|
|
300
|
+
"dev": true,
|
|
301
|
+
"license": "MIT",
|
|
302
|
+
"dependencies": {
|
|
303
|
+
"@oxc-project/runtime": "0.97.0",
|
|
304
|
+
"fdir": "^6.5.0",
|
|
305
|
+
"lightningcss": "^1.30.2",
|
|
306
|
+
"picomatch": "^4.0.3",
|
|
307
|
+
"postcss": "^8.5.6",
|
|
308
|
+
"rolldown": "1.0.0-beta.50",
|
|
309
|
+
"tinyglobby": "^0.2.15"
|
|
310
|
+
},
|
|
311
|
+
"bin": {
|
|
312
|
+
"vite": "bin/vite.js"
|
|
313
|
+
},
|
|
314
|
+
"engines": {
|
|
315
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
316
|
+
},
|
|
317
|
+
"funding": {
|
|
318
|
+
"url": "https://github.com/vitejs/vite?sponsor=1"
|
|
319
|
+
},
|
|
320
|
+
"optionalDependencies": {
|
|
321
|
+
"fsevents": "~2.3.3"
|
|
322
|
+
},
|
|
323
|
+
"peerDependencies": {
|
|
324
|
+
"@types/node": "^20.19.0 || >=22.12.0",
|
|
325
|
+
"esbuild": "^0.25.0",
|
|
326
|
+
"jiti": ">=1.21.0",
|
|
327
|
+
"less": "^4.0.0",
|
|
328
|
+
"sass": "^1.70.0",
|
|
329
|
+
"sass-embedded": "^1.70.0",
|
|
330
|
+
"stylus": ">=0.54.8",
|
|
331
|
+
"sugarss": "^5.0.0",
|
|
332
|
+
"terser": "^5.16.0",
|
|
333
|
+
"tsx": "^4.8.1",
|
|
334
|
+
"yaml": "^2.4.2"
|
|
335
|
+
},
|
|
336
|
+
"peerDependenciesMeta": {
|
|
337
|
+
"@types/node": {
|
|
338
|
+
"optional": true
|
|
339
|
+
},
|
|
340
|
+
"esbuild": {
|
|
341
|
+
"optional": true
|
|
342
|
+
},
|
|
343
|
+
"jiti": {
|
|
344
|
+
"optional": true
|
|
345
|
+
},
|
|
346
|
+
"less": {
|
|
347
|
+
"optional": true
|
|
348
|
+
},
|
|
349
|
+
"sass": {
|
|
350
|
+
"optional": true
|
|
351
|
+
},
|
|
352
|
+
"sass-embedded": {
|
|
353
|
+
"optional": true
|
|
354
|
+
},
|
|
355
|
+
"stylus": {
|
|
356
|
+
"optional": true
|
|
357
|
+
},
|
|
358
|
+
"sugarss": {
|
|
359
|
+
"optional": true
|
|
360
|
+
},
|
|
361
|
+
"terser": {
|
|
362
|
+
"optional": true
|
|
363
|
+
},
|
|
364
|
+
"tsx": {
|
|
365
|
+
"optional": true
|
|
366
|
+
},
|
|
367
|
+
"yaml": {
|
|
368
|
+
"optional": true
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "textblock",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@napps/component-extension": "^1.0.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"typescript": "~5.9.3",
|
|
16
|
+
"vite": "^8.0.0-beta.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"types": ["vite/client"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": false,
|
|
21
|
+
"erasableSyntaxOnly": false,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
build: {
|
|
5
|
+
// Specify that this is a library build
|
|
6
|
+
lib: {
|
|
7
|
+
entry: 'index.ts',
|
|
8
|
+
name: 'ComponentExtension',
|
|
9
|
+
fileName: (format) => `component-extension.${format}.js`,
|
|
10
|
+
formats: ['es'],
|
|
11
|
+
},
|
|
12
|
+
target: 'es2020',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -52,7 +52,7 @@ var ComponentInstance = class {
|
|
|
52
52
|
}
|
|
53
53
|
}, CustomTextBlockComponent = class extends TextBlockComponent {
|
|
54
54
|
async onComponentCreated() {
|
|
55
|
-
this.updateState("Custom Text Block Component Initialized from typescript");
|
|
55
|
+
this.updateState("Custom Text Block Component Initialized from typescript 6");
|
|
56
56
|
let e = await productService.getProductById("9097715679480"), i = JSON.stringify(e);
|
|
57
57
|
this.updateState(i);
|
|
58
58
|
let a = await (await fetch("https://napps-mobile-app-teste.myshopify.com/api/2025-10/graphql.json", {
|