Skip to content

Commit 011794c

Browse files
committed
Add svelte and update configs
1 parent 3c5f31a commit 011794c

File tree

5 files changed

+327
-13
lines changed

5 files changed

+327
-13
lines changed

widget/.parcelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"transformers": {
4+
"*.svelte": [
5+
"parcel-transformer-svelte3-plus"
6+
]
7+
}
8+
}

widget/package.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,45 @@
77
"lint:eslint": "eslint ./src/**.ts",
88
"lint:tsc": "tsc --noEmit",
99
"lint": "yarn run lint:tsc && yarn run lint:eslint",
10+
"start": "parcel src/index.html --port 3000",
1011
"watch": "parcel watch ./src/widget.ts --dist-dir ../s3_file_field/static/s3_file_field/",
1112
"build:clean": "rimraf ../s3_file_field/static/s3_file_field",
1213
"build:compile": "parcel build ./src/widget.ts --dist-dir ../s3_file_field/static/s3_file_field/ --no-source-maps --no-cache",
1314
"build": "yarn run build:clean && yarn run build:compile"
1415
},
1516
"dependencies": {
16-
"django-s3-file-field": "file:../javascript-client"
17+
"django-s3-file-field": "file:../javascript-client",
18+
"svelte": "^4.2.0",
19+
"svelte-preprocess": "^5.0.4"
1720
},
1821
"devDependencies": {
1922
"@parcel/transformer-sass": "^2.2.1",
2023
"@tsconfig/recommended": "^1.0.1",
24+
"@tsconfig/svelte": "^5.0.2",
2125
"@typescript-eslint/eslint-plugin": "^5.10.0",
2226
"@typescript-eslint/parser": "^5.10.0",
2327
"buffer": "^5.5.0||^6.0.0",
2428
"eslint": "^8",
2529
"eslint-config-airbnb-typescript": "^17.0.0",
2630
"eslint-plugin-import": "^2.25.4",
2731
"parcel": "^2.2.1",
32+
"parcel-transformer-svelte3-plus": "^0.2.10",
2833
"process": "^0.11.10",
2934
"rimraf": "^3.0.2",
35+
"svelte-check": "^3.5.0",
3036
"typescript": "^5.1.6"
3137
},
3238
"browserslist": [
3339
"last 1 chrome version",
3440
"last 1 firefox version"
3541
],
42+
"@parcel/resolver-default": {
43+
"packageExports": true
44+
},
3645
"eslintConfig": {
46+
"env": {
47+
"node": true
48+
},
3749
"parser": "@typescript-eslint/parser",
3850
"parserOptions": {
3951
"project": "./tsconfig.json"
@@ -50,6 +62,20 @@
5062
],
5163
"rules": {
5264
"no-restricted-syntax": 0
53-
}
65+
},
66+
"settings": {
67+
"import/resolver": {
68+
"typescript": {}
69+
}
70+
},
71+
"overrides": [
72+
{
73+
"files": [
74+
"**/*.ts",
75+
"**/*.js",
76+
"**/*.svelte"
77+
]
78+
}
79+
]
5480
}
5581
}

widget/svelte.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const sveltePreprocess = require('svelte-preprocess')
2+
3+
module.exports = {
4+
preprocess: sveltePreprocess()
5+
}

widget/tsconfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"extends": "@tsconfig/recommended/tsconfig.json",
2+
"extends": "@tsconfig/svelte/tsconfig.json",
33
"include": [
4-
"src/**/*"
4+
"src/**/*",
5+
"src/**/*.ts",
6+
"src/**/*.js",
7+
"src/**/*.svelte"
58
]
69
}

0 commit comments

Comments
 (0)