-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d51ec1
commit d2e7423
Showing
19 changed files
with
214 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# NativeScript | ||
hooks/ | ||
node_modules/ | ||
platforms/ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.idea | ||
.cloud | ||
.project | ||
tmp/ | ||
typings/ | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
legacy-peer-deps=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"installDependencies": true, | ||
"compileTrigger": "save", | ||
"startCommand": "setup-nativescript-stackblitz && ns preview" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NativeScriptConfig } from '@nativescript/core'; | ||
|
||
export default { | ||
id: 'org.nativescript.app', | ||
appPath: 'src', | ||
appResourcesPath: 'App_Resources', | ||
android: { | ||
v8Flags: '--expose_gc', | ||
markingMode: 'none', | ||
}, | ||
} as NativeScriptConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "stackblitz-nativescript-solid", | ||
"main": "src/app.js", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": {}, | ||
"dependencies": { | ||
"@nativescript-community/solid-js": "^0.0.6", | ||
"@nativescript/core": "~8.7.0", | ||
"dominative": "^0.1.3", | ||
"solid-js": "^1.8.16", | ||
"undom-ng": "^1.1.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.4", | ||
"@babel/preset-env": "^7.24.4", | ||
"@babel/preset-typescript": "^7.24.1", | ||
"@nativescript/preview-cli": "^1.0.13", | ||
"@nativescript/stackblitz": "0.0.8", | ||
"@nativescript/tailwind": "~2.1.0", | ||
"@nativescript/webpack": "~5.0.0", | ||
"babel": "^6.23.0", | ||
"babel-loader": "^9.1.3", | ||
"babel-preset-solid": "^1.8.8", | ||
"solid-refresh": "^0.7.5", | ||
"tailwindcss": "~3.4.3" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
.h-center { | ||
/* {N} specific css */ | ||
horizontal-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Application } from '@nativescript/core'; | ||
import { render } from '@nativescript-community/solid-js'; | ||
|
||
import { App } from './app.jsx'; | ||
|
||
document.body.actionBarHidden = false; | ||
render(App, document.body); | ||
|
||
const create = () => document; | ||
|
||
Application.run({ create }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createSignal } from 'solid-js'; | ||
import { Component } from './component.jsx'; | ||
|
||
document.body.actionBarHidden = false; | ||
|
||
const App = () => { | ||
const [count, setCount] = createSignal(0); | ||
const increment = () => { | ||
setCount((c) => c + 1); | ||
}; | ||
return ( | ||
<> | ||
<actionbar title="Hello, SolidJS!"></actionbar> | ||
<stacklayout> | ||
<label class="text-center text-2xl my-4"> | ||
You have tapped {count()} time{count() === 1 ? '' : 's'} | ||
</label> | ||
{ | ||
// use 'on:___' instead of 'on___' for event handlers | ||
// See https://github.com/SudoMaker/dominative-solid#event-handling for detail | ||
} | ||
<button | ||
class="rounded-full bg-blue-500 text-white text-xl p-2 w-[300]" | ||
on:tap={increment} | ||
> | ||
Tap me! | ||
</button> | ||
<Component count={count} /> | ||
</stacklayout> | ||
</> | ||
); | ||
}; | ||
|
||
export { App }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const Component = (props) => { | ||
const { count } = props; | ||
return ( | ||
<label | ||
text={`${count()} tap${count() === 1 ? '' : 's'}`} | ||
on:tap={() => { | ||
alert(`You have tapped ${count()} time${count() === 1 ? '' : 's'}`); | ||
}} | ||
class="text-center text-2xl my-6 text-green-500" | ||
/> | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: ['./src/**/*.{css,xml,html,vue,svelte,ts,tsx,jsx}'], | ||
// use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported. | ||
darkMode: ['class', '.ns-dark'], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
corePlugins: { | ||
preflight: false, // disables browser-specific resets | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const webpack = require('@nativescript/webpack'); | ||
|
||
module.exports = (env) => { | ||
webpack.init(env); | ||
|
||
return webpack.resolveConfig(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters