@nativescript/template-blank-svelte-vision 8.6.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/.editorconfig ADDED
@@ -0,0 +1,19 @@
1
+ root = true
2
+
3
+ [*]
4
+ end_of_line = lf
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
7
+ charset = utf-8
8
+
9
+ [*.json]
10
+ indent_style = space
11
+ indent_size = 2
12
+
13
+ [*.js]
14
+ indent_style = space
15
+ indent_size = 2
16
+
17
+ [*.ts]
18
+ indent_style = space
19
+ indent_size = 2
package/.npmrc ADDED
@@ -0,0 +1,2 @@
1
+ # use legacy peer deps to avoid peer dependency resolution failures
2
+ legacy-peer-deps=true
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # NativeScript Core with Svelte Blank Template
2
+ App templates help you jump start your native cross-platform apps with built-in UI elements and best practices. Save time writing boilerplate code over and over again when you create new apps.
3
+
4
+ ## Quick Start
5
+ Execute the following command to create an app from this template:
6
+
7
+ ```
8
+ ns create my-blank-svelte --template @nativescript/template-blank-svelte
9
+ ```
10
+
11
+ > Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm](https://www.npmjs.com/package/@nativescript/template-blank-svelte).
12
+
13
+ If you want to create a new app that uses the source of the template from the `master` branch, you can execute the following:
14
+
15
+ ```
16
+ # clone nativescript-app-templates monorepo locally
17
+ git clone git@github.com:NativeScript/nativescript-app-templates.git
18
+
19
+ # create app template from local source (all templates are in the 'packages' subfolder of the monorepo)
20
+ ns create my-blank-svelte --template nativescript-app-templates/packages/template-blank-svelte
21
+ ```
22
+
23
+ **NB:** Please, have in mind that the master branch may refer to dependencies that are not on NPM yet!
24
+
25
+ ## Get Help
26
+ The NativeScript framework has a vibrant community that can help when you run into problems.
27
+
28
+ Try [joining the NativeScript community Discord](https://nativescript.org/discord). The Discord channel is a great place to get help troubleshooting problems, as well as connect with other NativeScript developers.
29
+
30
+ If you have found an issue with this template, please report the problem in the [NativeScript repository](https://github.com/NativeScript/NativeScript/issues).
31
+
32
+ ## Contributing
33
+
34
+ We love PRs, and accept them gladly. Feel free to propose changes and new ideas. We will review and discuss, so that they can be accepted and better integrated.
@@ -0,0 +1,65 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const { execSync } = require('child_process')
4
+
5
+ module.exports = function (hookArgs) {
6
+ const appRootFolder = hookArgs.projectDir
7
+ const toolsDir = path.join(appRootFolder, 'tools')
8
+ const vscodeDir = path.join(appRootFolder, '.vscode')
9
+ const srcGitignore = path.join(toolsDir, 'dot.gitignore')
10
+ const destGitignore = path.join(appRootFolder, '.gitignore')
11
+ const srcVscodeExtensions = path.join(toolsDir, 'vscode.extensions.json')
12
+ const destVscodeExtensions = path.join(vscodeDir, 'extensions.json')
13
+
14
+ try {
15
+ fs.mkdirSync(vscodeDir)
16
+ fs.copyFileSync(srcVscodeExtensions, destVscodeExtensions)
17
+ fs.copyFileSync(srcGitignore, destGitignore)
18
+ initWebpackConfig(appRootFolder)
19
+ } catch (error) {
20
+ console.log(error)
21
+ }
22
+ try {
23
+ deleteFolderSync(toolsDir)
24
+
25
+ const readme = path.join(appRootFolder, 'README.md')
26
+ fs.unlinkSync(readme)
27
+
28
+ deleteFolderSync(__dirname)
29
+ } catch (error) {
30
+ console.log(error)
31
+ }
32
+
33
+ function deleteFolderSync(folderPath) {
34
+ if (fs.statSync(folderPath).isDirectory()) {
35
+ fs.readdirSync(folderPath).forEach((file) => {
36
+ const content = path.join(folderPath, file)
37
+ const contentDirs = fs.statSync(content).isDirectory()
38
+
39
+ if (contentDirs) {
40
+ deleteFolderSync(content)
41
+ } else {
42
+ fs.unlinkSync(content)
43
+ }
44
+ })
45
+
46
+ fs.rmdirSync(folderPath)
47
+ }
48
+ }
49
+
50
+ function initWebpackConfig(appRootFolder) {
51
+ const binPath = path.resolve(
52
+ require
53
+ .resolve('@nativescript/webpack/package.json', {
54
+ paths: [appRootFolder],
55
+ })
56
+ .replace('package.json', 'dist/bin/index.js')
57
+ )
58
+
59
+ // init webpack config
60
+ execSync(`node "${binPath}" init`, {
61
+ cwd: appRootFolder,
62
+ stdio: 'inherit',
63
+ })
64
+ }
65
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@nativescript/template-blank-svelte-vision",
3
+ "main": "src/app.ts",
4
+ "version": "8.6.0",
5
+ "description": "Nativescript visionOS Starter with Svelte",
6
+ "author": "NativeScript Team <oss@nativescript.org>",
7
+ "license": "Apache-2.0",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "src",
13
+ "App_Resources",
14
+ "hooks",
15
+ "types",
16
+ "tools",
17
+ "!tools/assets",
18
+ ".editorconfig",
19
+ ".npmrc",
20
+ "svelte.config.js",
21
+ "tsconfig.json"
22
+ ],
23
+ "keywords": [
24
+ "nstudio",
25
+ "nativescript",
26
+ "mobile",
27
+ "{N}",
28
+ "svelte",
29
+ "svelte-native",
30
+ "visionOS",
31
+ "Vision Pro"
32
+ ],
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/NativeScript/nativescript-app-templates"
36
+ },
37
+ "homepage": "https://github.com/NativeScript/nativescript-app-templates",
38
+ "bugs": {
39
+ "url": "https://github.com/NativeScript/NativeScript/issues"
40
+ },
41
+ "dependencies": {
42
+ "@nativescript/core": "vision",
43
+ "@nativescript/theme": "~3.0.2",
44
+ "svelte-native": "~1.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@nativescript/types": "~8.5.0",
48
+ "@nativescript/webpack": "vision",
49
+ "svelte": "~3.44.0",
50
+ "svelte-loader": "^3.1.2",
51
+ "svelte-native-preprocessor": "^1.0.0",
52
+ "svelte-preprocess": "^4.7.0",
53
+ "typescript": "~4.8.4"
54
+ }
55
+ }
package/src/App.svelte ADDED
@@ -0,0 +1,7 @@
1
+ <frame>
2
+ <Home />
3
+ </frame>
4
+
5
+ <script lang="ts">
6
+ import Home from './components/Home.svelte'
7
+ </script>
package/src/app.css ADDED
@@ -0,0 +1,18 @@
1
+ @import '@nativescript/theme/css/core.css';
2
+ @import '@nativescript/theme/css/default.css';
3
+
4
+ .fab {
5
+ font-family: 'Font Awesome 5 Brands', 'fa-brands-400';
6
+ font-weight: 400;
7
+ }
8
+
9
+ .fas {
10
+ font-family: 'Font Awesome 5 Free', 'fa-solid-900';
11
+ font-weight: 900;
12
+ }
13
+
14
+ .far {
15
+ font-family: 'Font Awesome 5 Free', 'fa-regular-400';
16
+ font-weight: 400;
17
+ }
18
+
package/src/app.ts ADDED
@@ -0,0 +1,10 @@
1
+ /*
2
+ In NativeScript, the app.ts file is the entry point to your application.
3
+ You can use this file to perform app-level initialization, but the primary
4
+ purpose of the file is to pass control to the app’s first page.
5
+ */
6
+
7
+ import { svelteNativeNoFrame } from 'svelte-native'
8
+ import App from './App.svelte'
9
+
10
+ svelteNativeNoFrame(App, {})
@@ -0,0 +1,27 @@
1
+ <page>
2
+ <actionBar title="Home" />
3
+ <gridLayout>
4
+ <label class="info">
5
+ <formattedString>
6
+ <span class="fas" text="&#xf135;" />
7
+ <span text=" {message}" />
8
+ </formattedString>
9
+ </label>
10
+ </gridLayout>
11
+ </page>
12
+
13
+ <script lang="ts">
14
+ let message: string = "Blank Svelte Native App"
15
+ </script>
16
+
17
+ <style>
18
+ .info .fas {
19
+ color: #3A53FF;
20
+ }
21
+
22
+ .info {
23
+ font-size: 20;
24
+ horizontal-align: center;
25
+ vertical-align: center;
26
+ }
27
+ </style>
@@ -0,0 +1,34 @@
1
+ Font Awesome Free License
2
+ -------------------------
3
+
4
+ Font Awesome Free is free, open source, and GPL friendly. You can use it for
5
+ commercial projects, open source projects, or really almost whatever you want.
6
+ Full Font Awesome Free license: https://fontawesome.com/license/free.
7
+
8
+ # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
9
+ In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
10
+ packaged as SVG and JS file types.
11
+
12
+ # Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
13
+ In the Font Awesome Free download, the SIL OFL license applies to all icons
14
+ packaged as web and desktop font files.
15
+
16
+ # Code: MIT License (https://opensource.org/licenses/MIT)
17
+ In the Font Awesome Free download, the MIT license applies to all non-font and
18
+ non-icon files.
19
+
20
+ # Attribution
21
+ Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
22
+ Awesome Free files already contain embedded comments with sufficient
23
+ attribution, so you shouldn't need to do anything additional when using these
24
+ files normally.
25
+
26
+ We've kept attribution comments terse, so we ask that you do not actively work
27
+ to remove them from files, especially code. They're a great way for folks to
28
+ learn about Font Awesome.
29
+
30
+ # Brand Icons
31
+ All brand icons are trademarks of their respective owners. The use of these
32
+ trademarks does not indicate endorsement of the trademark holder by Font
33
+ Awesome, nor vice versa. **Please do not use brand logos for any purpose except
34
+ to represent the company, product, or service to which they refer.**
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ const sveltePreprocess = require('svelte-preprocess')
2
+ const svelteNativePreprocessor = require('svelte-native-preprocessor')
3
+
4
+ module.exports = {
5
+ compilerOptions: {
6
+ namespace: "foreign"
7
+ },
8
+ preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ]
9
+ }
@@ -0,0 +1,28 @@
1
+ # NativeScript
2
+ hooks/
3
+ node_modules/
4
+ platforms/
5
+
6
+ # Logs
7
+ logs
8
+ *.log
9
+ npm-debug.log*
10
+ yarn-debug.log*
11
+ yarn-error.log*
12
+
13
+ # General
14
+ .DS_Store
15
+ .AppleDouble
16
+ .LSOverride
17
+ .idea
18
+ .cloud
19
+ .project
20
+ tmp/
21
+ typings/
22
+
23
+ # Visual Studio Code
24
+ .vscode/*
25
+ !.vscode/settings.json
26
+ !.vscode/tasks.json
27
+ !.vscode/launch.json
28
+ !.vscode/extensions.json
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["nativescript.nativescript"]
3
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "target": "ES2020",
5
+ "module": "esnext",
6
+ "moduleResolution": "node",
7
+ "lib": ["dom", "ESNext"],
8
+ "sourceMap": true,
9
+ "noEmitHelpers": true,
10
+ "importHelpers": true,
11
+ "baseUrl": ".",
12
+ "paths": {
13
+ "~/*": ["src/*"],
14
+ "@/*": ["src/*"]
15
+ },
16
+ "typeRoots": ["types"],
17
+ "types": ["node"],
18
+ "allowSyntheticDefaultImports": true,
19
+ "esModuleInterop": true,
20
+ "experimentalDecorators": true,
21
+ "emitDecoratorMetadata": true,
22
+ "skipLibCheck": true
23
+ },
24
+ "include": ["src", "types"],
25
+ "exclude": ["node_modules", "platforms"]
26
+ }
@@ -0,0 +1 @@
1
+ /// <reference path="../node_modules/@nativescript/types/index.d.ts" />
@@ -0,0 +1,3 @@
1
+ declare module '*.svelte' {
2
+ export { SvelteComponent as default };
3
+ }