r count ui left"> + 22 - 0 app/backend/migrations/0024_points.py
Voir le fichier
@@ -0,0 +1,22 @@
1
+# Generated by Django 3.2.5 on 2021-07-19 08:11
2
+
3
+from django.db import migrations, models
4
+import django.db.models.deletion
5
+
6
+
7
+class Migration(migrations.Migration):
8
+
9
+    dependencies = [
10
+        ('backend', '0023_place'),
11
+    ]
12
+
13
+    operations = [
14
+        migrations.CreateModel(
15
+            name='Points',
16
+            fields=[
17
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18
+                ('dest', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dest', to='backend.place')),
19
+                ('src', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='src', to='backend.place')),
20
+            ],
21
+        ),
22
+    ]

+ 28 - 0
app/backend/migrations/0025_auto_20210721_1145.py

@@ -0,0 +1,28 @@
1
+# Generated by Django 3.2.5 on 2021-07-21 04:45
2
+
3
+from django.db import migrations
4
+import django_google_maps.fields
5
+
6
+
7
+class Migration(migrations.Migration):
8
+
9
+    dependencies = [
10
+        ('backend', '0024_points'),
11
+    ]
12
+
13
+    operations = [
14
+        migrations.RemoveField(
15
+            model_name='points',
16
+            name='src',
17
+        ),
18
+        migrations.AddField(
19
+            model_name='points',
20
+            name='address',
21
+            field=django_google_maps.fields.AddressField(max_length=200, null=True),
22
+        ),
23
+        migrations.AddField(
24
+            model_name='points',
25
+            name='geolocation',
26
+            field=django_google_maps.fields.GeoLocationField(max_length=100, null=True),
27
+        ),
28
+    ]

+ 23 - 0
app/backend/migrations/0026_auto_20210721_1218.py

@@ -0,0 +1,23 @@
1
+# Generated by Django 3.2.5 on 2021-07-21 05:18
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('backend', '0025_auto_20210721_1145'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AddField(
14
+            model_name='points',
15
+            name='distance',
16
+            field=models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True),
17
+        ),
18
+        migrations.AddField(
19
+            model_name='points',
20
+            name='duration',
21
+            field=models.CharField(blank=True, max_length=200, null=True),
22
+        ),
23
+    ]

+ 23 - 0
app/backend/migrations/0027_auto_20210721_1251.py

@@ -0,0 +1,23 @@
1
+# Generated by Django 3.2.5 on 2021-07-21 05:51
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('backend', '0026_auto_20210721_1218'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AddField(
14
+            model_name='points',
15
+            name='directions',
16
+            field=models.JSONField(blank=True, null=True),
17
+        ),
18
+        migrations.AlterField(
19
+            model_name='points',
20
+            name='distance',
21
+            field=models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True, verbose_name='Distance (km)'),
22
+        ),
23
+    ]

+ 18 - 0
app/backend/migrations/0028_place_title.py

@@ -0,0 +1,18 @@
1
+# Generated by Django 3.2.5 on 2021-07-21 10:11
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('backend', '0027_auto_20210721_1251'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AddField(
14
+            model_name='place',
15
+            name='title',
16
+            field=models.CharField(blank=True, max_length=200, null=True),
17
+        ),
18
+    ]

+ 20 - 0
app/backend/migrations/0029_importfile.py

@@ -0,0 +1,20 @@
1
+# Generated by Django 3.2.5 on 2021-07-22 08:04
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('backend', '0028_place_title'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.CreateModel(
14
+            name='ImportFile',
15
+            fields=[
16
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17
+                ('hospital_file', models.FileField(blank=True, upload_to='uploads/%Y/%m/%d/', verbose_name='Hospital (csv)')),
18
+            ],
19
+        ),
20
+    ]

backend/migrations/__init__.py → app/backend/migrations/__init__.py


backend/migrations/__pycache__/0001_initial.cpython-39.pyc → app/backend/migrations/__pycache__/0001_initial.cpython-39.pyc


backend/migrations/__pycache__/0002_hospital_geolocation.cpython-39.pyc → app/backend/migrations/__pycache__/0002_hospital_geolocation.cpython-39.pyc


backend/migrations/__pycache__/0003_alter_hospital_address.cpython-39.pyc → app/backend/migrations/__pycache__/0003_alter_hospital_address.cpython-39.pyc


backend/migrations/__pycache__/0004_alter_hospital_location.cpython-39.pyc → app/backend/migrations/__pycache__/0004_alter_hospital_location.cpython-39.pyc


backend/migrations/__pycache__/0005_hospital_address_text.cpython-39.pyc → app/backend/migrations/__pycache__/0005_hospital_address_text.cpython-39.pyc


backend/migrations/__pycache__/0006_bed_patient.cpython-39.pyc → app/backend/migrations/__pycache__/0006_bed_patient.cpython-39.pyc


backend/migrations/__pycache__/0007_auto_20210718_0246.cpython-39.pyc → app/backend/migrations/__pycache__/0007_auto_20210718_0246.cpython-39.pyc


backend/migrations/__pycache__/0007_auto_20210718_0249.cpython-39.pyc → app/backend/migrations/__pycache__/0007_auto_20210718_0249.cpython-39.pyc


backend/migrations/__pycache__/0008_alter_patient_prefix.cpython-39.pyc → app/backend/migrations/__pycache__/0008_alter_patient_prefix.cpython-39.pyc


backend/migrations/__pycache__/0008_auto_20210718_0659.cpython-39.pyc → app/backend/migrations/__pycache__/0008_auto_20210718_0659.cpython-39.pyc


backend/migrations/__pycache__/0009_auto_20210718_0702.cpython-39.pyc → app/backend/migrations/__pycache__/0009_auto_20210718_0702.cpython-39.pyc


backend/migrations/__pycache__/0010_auto_20210718_0711.cpython-39.pyc → app/backend/migrations/__pycache__/0010_auto_20210718_0711.cpython-39.pyc


backend/migrations/__pycache__/0010_auto_20210718_0713.cpython-39.pyc → app/backend/migrations/__pycache__/0010_auto_20210718_0713.cpython-39.pyc


backend/migrations/__pycache__/0011_auto_20210718_0722.cpython-39.pyc → app/backend/migrations/__pycache__/0011_auto_20210718_0722.cpython-39.pyc


backend/migrations/__pycache__/0012_patient_comment.cpython-39.pyc → app/backend/migrations/__pycache__/0012_patient_comment.cpython-39.pyc


backend/migrations/__pycache__/0013_patientlog.cpython-39.pyc → app/backend/migrations/__pycache__/0013_patientlog.cpython-39.pyc


backend/migrations/__pycache__/0014_alter_patientlog_bed.cpython-39.pyc → app/backend/migrations/__pycache__/0014_alter_patientlog_bed.cpython-39.pyc


backend/migrations/__pycache__/0015_alter_patientlog_bed.cpython-39.pyc → app/backend/migrations/__pycache__/0015_alter_patientlog_bed.cpython-39.pyc


backend/migrations/__pycache__/0016_auto_20210718_1031.cpython-39.pyc → app/backend/migrations/__pycache__/0016_auto_20210718_1031.cpython-39.pyc


backend/migrations/__pycache__/0017_ambulance_driver.cpython-39.pyc → app/backend/migrations/__pycache__/0017_ambulance_driver.cpython-39.pyc


backend/migrations/__pycache__/0018_ambulance_color.cpython-39.pyc → app/backend/migrations/__pycache__/0018_ambulance_color.cpython-39.pyc


backend/migrations/__pycache__/0019_ambulanceticket.cpython-39.pyc → app/backend/migrations/__pycache__/0019_ambulanceticket.cpython-39.pyc


backend/migrations/__pycache__/0020_driver_status.cpython-39.pyc → app/backend/migrations/__pycache__/0020_driver_status.cpython-39.pyc


backend/migrations/__pycache__/0021_auto_20210719_0014.cpython-39.pyc → app/backend/migrations/__pycache__/0021_auto_20210719_0014.cpython-39.pyc


backend/migrations/__pycache__/0022_auto_20210719_0024.cpython-39.pyc → app/backend/migrations/__pycache__/0022_auto_20210719_0024.cpython-39.pyc


backend/migrations/__pycache__/0023_place.cpython-39.pyc → app/backend/migrations/__pycache__/0023_place.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0024_points.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0025_auto_20210721_1145.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0026_auto_20210721_1218.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0027_auto_20210721_1251.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0028_place_title.cpython-39.pyc


BIN
app/backend/migrations/__pycache__/0029_importfile.cpython-39.pyc


backend/migrations/__pycache__/__init__.cpython-39.pyc → app/backend/migrations/__pycache__/__init__.cpython-39.pyc


+ 96 - 0
backend/models.py

@@ -8,6 +8,13 @@ from smart_selects.db_fields import (
8 8
     ChainedManyToManyField,
9 9
     GroupedForeignKey,
10 10
 )
11
+import googlemaps
12
+from django.contrib.gis.geos import fromstr
13
+
14
+from django.conf import settings
15
+import csv
16
+
17
+gmaps = googlemaps.Client(key=settings.GOOGLE_MAPS_API_KEY)
11 18
 # Create your models here.
12 19
 GENDER_CHOICES = (
13 20
     ('นางสาว','นางสาว'),
@@ -122,9 +129,66 @@ class Patient(models.Model):
122 129
     comment  = models.TextField(blank=True, null=True)
123 130
     #test
124 131
     def __str__(self):
132
+        #self.nearby()
125 133
         return f"{self.first_name} {self.last_name}"
126 134
 
135
+
136
+    def nearby(self):
137
+        r = gmaps.places_nearby(location=(self.geolocation.lat, self.geolocation.lon), type="hospital", radius=10000)
138
+        bd = ""
139
+        for r0 in r['results']:
140
+            openh = "-"
141
+            if 'opening_hours' in r0:
142
+                openh = r0['opening_hours']['open_now']
143
+            else:
144
+                openh = "-"
145
+
146
+            bd += f"<tr><td>{r0['name']}</td><td>{openh}</td><td>{r0['vicinity']}</td></tr>"
147
+
148
+        rt = f'''
149
+<br>
150
+        <table><thead><tr><th>Name</th><th>Opening Hours</th><th>Vicinity</th></tr></thead>
151
+        <tbody>
152
+            {bd}
153
+        </tbody>
154
+        </table>
155
+        '''
156
+        return rt
157
+
158
+
159
+
160
+class ImportFile(models.Model):
161
+    hospital_file  = models.FileField(upload_to="uploads/%Y/%m/%d/", blank=True, verbose_name="Hospital (csv)")
162
+
163
+    def save(self, *args, **kwargs):
164
+        super(ImportFile, self).save(*args, **kwargs)
165
+
166
+        with self.hospital_file.open('r') as csv_file:
167
+            csv_reader = csv.reader(csv_file, delimiter=',')
168
+            Hospital.objects.all().delete()
169
+            line_count = 0
170
+
171
+            for r in csv_reader:
172
+                if line_count > 0:
173
+                    print(r)
174
+                    print(f"{r[7]},{r[6]}")
175
+                    try:
176
+                        gp = map_fields.GeoPt(lat=float(r[6]), lon=float(r[7]))
177
+
178
+                        location = fromstr(f'POINT({r[7]} {r[6]})', srid=4326)
179
+                        print(location)
180
+                        h = Hospital(title=r[3], address_text=r[5], geolocation=gp, address=r[3])
181
+                        h.save()
182
+                    except Exception as e:
183
+                        print(e)
184
+
185
+                line_count += 1
186
+
187
+
188
+
127 189
 class Place(models.Model):
190
+    #title  = models.Char
191
+    title = models.CharField(max_length=200, blank=True, null=True)
128 192
     address = map_fields.AddressField(max_length=200)
129 193
     geolocation = map_fields.GeoLocationField(max_length=100)
130 194
 
@@ -133,6 +197,36 @@ class Place(models.Model):
133 197
 
134 198
     more_info  = models.JSONField(null=True, blank=True)
135 199
 
200
+    def __str__(self):
201
+        return f"{self.address} ({self.geolocation})"
202
+class Points(models.Model):
203
+    #src  = models.ForeignKey(Place, on_delete=models.SET_NULL, null=True, blank=False, related_name='src')
204
+    dest  = models.ForeignKey(Place, on_delete=models.SET_NULL, null=True, blank=False, related_name='dest')
205
+    address = map_fields.AddressField(max_length=200, null=True)
206
+    geolocation = map_fields.GeoLocationField(max_length=100, null=True)
207
+
208
+    distance = models.DecimalField(null=True, blank=True, decimal_places=2, max_digits=7, verbose_name="Distance (km)")
209
+    duration = models.CharField(max_length=200, null=True, blank=True)
210
+
211
+    directions  = models.JSONField(null=True, blank=True)
212
+
213
+    def save(self, *args, **kwargs):
214
+        geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')
215
+        print(geocode_result)
216
+        print(self.geolocation)
217
+        origin = [(self.geolocation.lat, self.geolocation.lon)]
218
+        dest = [(self.dest.geolocation.lat, self.dest.geolocation.lon)]
219
+        dst = gmaps.distance_matrix(origin, dest)
220
+        dirs = gmaps.directions(origin[0], dest[0])
221
+        self.directions = dirs
222
+        print(dirs)
223
+        self.distance = dst['rows'][0]['elements'][0]['distance']['value'] / 1000
224
+        self.duration = dst['rows'][0]['elements'][0]['duration']['text']
225
+        print(dst)
226
+        super(Points, self).save(*args, **kwargs)
227
+
228
+
229
+
136 230
 class Hospital(models.Model):
137 231
     title = models.CharField(max_length=200)
138 232
     location = models.PointField(blank=True, null=True)
@@ -190,3 +284,5 @@ class PatientLog(models.Model):
190 284
     updated_at = models.DateTimeField(auto_now=True)
191 285
 
192 286
 
287
+
288
+

+ 7 - 0
app/backend/templates/backend/import_file.html

@@ -0,0 +1,7 @@
1
+{% extends "base.html" %}
2
+
3
+{% block title %}My amazing blog{% endblock %}
4
+
5
+{% block content %}
6
+Import File
7
+{% endblock %}

+ 8 - 0
app/backend/templates/backend/index.html

@@ -0,0 +1,8 @@
1
+{% extends "base.html" %}
2
+
3
+{% block title %}My amazing blog{% endblock %}
4
+
5
+{% block content %}
6
+Hello world
7
+<a href="{% url "import_file" %}">Import</a>
8
+{% endblock %}

backend/tests.py → app/backend/tests.py


+ 1 - 0
backend/urls.py

@@ -4,4 +4,5 @@ from . import views
4 4
 
5 5
 urlpatterns = [
6 6
     path('', views.index, name='index'),
7
+    path('import_file', views.import_file, name='import_file'),
7 8
 ]

+ 11 - 0
app/backend/views.py

@@ -0,0 +1,11 @@
1
+from django.shortcuts import render
2
+
3
+# Create your views here.
4
+from django.http import HttpResponse
5
+
6
+
7
+def index(request):
8
+    return render(request, 'backend/index.html')
9
+
10
+def import_file(request):
11
+    return render(request, 'backend/import_file.html')

manage.py → app/manage.py


uploads/2021/07/18/67224.jpg → app/media/uploads/2021/07/18/67224.jpg


Fichier diff supprimé car celui-ci est trop grand
+ 10715 - 0
app/media/uploads/2021/07/22/citizeninfo_health_20200314.csv


Fichier diff supprimé car celui-ci est trop grand
+ 10715 - 0
app/media/uploads/2021/07/22/citizeninfo_health_20200314_W9jk8Vu.csv


+ 1 - 0
requirements.txt

@@ -5,3 +5,4 @@ django-smart-selects
5 5
 django-colorfield
6 6
 googlemaps
7 7
 django-json-widget
8
+django-import-export

backend/__init__.py → app/shaqfindbed/__init__.py


shaqfindbed/__pycache__/__init__.cpython-39.pyc → app/shaqfindbed/__pycache__/__init__.cpython-39.pyc


BIN
app/shaqfindbed/__pycache__/settings.cpython-39.pyc


BIN
shaqfindbed/__pycache__/urls.cpython-39.pyc


shaqfindbed/__pycache__/wsgi.cpython-39.pyc → app/shaqfindbed/__pycache__/wsgi.cpython-39.pyc


shaqfindbed/asgi.py → app/shaqfindbed/asgi.py


+ 3 - 2
shaqfindbed/settings.py

@@ -33,12 +33,13 @@ ALLOWED_HOSTS = []
33 33
 # Application definition
34 34
 
35 35
 INSTALLED_APPS = [
36
+    'django.contrib.staticfiles',
36 37
     'django.contrib.admin',
37 38
     'django.contrib.auth',
38 39
     'django.contrib.contenttypes',
39 40
     'django.contrib.sessions',
40 41
     'django.contrib.messages',
41
-    'django.contrib.staticfiles',
42
+    'import_export',
42 43
     'django_google_maps',
43 44
     'django.contrib.gis',
44 45
     'smart_selects',
@@ -62,7 +63,7 @@ ROOT_URLCONF = 'shaqfindbed.urls'
62 63
 TEMPLATES = [
63 64
     {
64 65
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
65
-        'DIRS': [],
66
+        'DIRS': [os.path.join(BASE_DIR, 'templates')],
66 67
         'APP_DIRS': True,
67 68
         'OPTIONS': {
68 69
             'context_processors': [

+ 1 - 1
shaqfindbed/urls.py

@@ -23,7 +23,7 @@ urlpatterns = [
23 23
     path('backend/', include('backend.urls')),
24 24
     path('admin/', admin.site.urls),
25 25
     url(r'^chaining/', include('smart_selects.urls')),
26
-]
26
+] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
27 27
 
28 28
 if settings.DEBUG:
29 29
     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

shaqfindbed/wsgi.py → app/shaqfindbed/wsgi.py


BIN
app/static/.DS_Store


BIN
app/static/admin/.DS_Store


staticfile/admin/css/autocomplete.css → app/static/admin/css/autocomplete.css


+ 0 - 0
staticfile/admin/css/base.css


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff

tmt/tiger_frontend - Gogs: Simplico Git Service

説明なし

golf 77628cf8bf first comm 3 年 前
..
lib 77628cf8bf first comm 3 年 前
LICENSE 77628cf8bf first comm 3 年 前
README.md 77628cf8bf first comm 3 年 前
index.js 77628cf8bf first comm 3 年 前
package.json 77628cf8bf first comm 3 年 前

README.md

postcss-import

Build Version postcss compatibility

PostCSS plugin to transform @import rules by inlining content.

This plugin can consume local files, node modules or web_modules. To resolve path of an @import rule, it can look into root directory (by default process.cwd()), web_modules, node_modules or local modules. When importing a module, it will look for index.css or file referenced in package.json in the style or main fields. You can also provide manually multiples paths where to look at.

Notes:

  • This plugin should probably be used as the first plugin of your list. This way, other plugins will work on the AST as if there were only a single file to process, and will probably work as you can expect.
  • This plugin works great with postcss-url plugin, which will allow you to adjust assets url() (or even inline them) after inlining imported files.
  • In order to optimize output, this plugin will only import a file once on a given scope (root, media query...). Tests are made from the path & the content of imported files (using a hash table). If this behavior is not what you want, look at skipDuplicates option
  • If you are looking for Glob Imports, you can use postcss-import-ext-glob to extend postcss-import.
  • Imports which are not modified (by options.filter or because they are remote imports) are moved to the top of the output.
  • This plugin attempts to follow the CSS @import spec; @import statements must precede all other statements (besides @charset).

Installation

$ npm install -D postcss-import

Usage

Unless your stylesheet is in the same place where you run postcss (process.cwd()), you will need to use from option to make relative imports work.

// dependencies
const fs = require("fs")
const postcss = require("postcss")
const atImport = require("postcss-import")

// css to be processed
const css = fs.readFileSync("css/input.css", "utf8")

// process css
postcss()
  .use(atImport())
  .process(css, {
    // `from` option is needed here
    from: "css/input.css"
  })
  .then((result) => {
    const output = result.css

    console.log(output)
  })

css/input.css:

/* can consume `node_modules`, `web_modules` or local modules */
@import "cssrecipes-defaults"; /* == @import "../node_modules/cssrecipes-defaults/index.css"; */
@import "normalize.css"; /* == @import "../node_modules/normalize.css/normalize.css"; */

@import "foo.css"; /* relative to css/ according to `from` option above */

@import "bar.css" (min-width: 25em);

@import 'baz.css' layer(baz-layer);

body {
  background: black;
}

will give you:

/* ... content of ../node_modules/cssrecipes-defaults/index.css */
/* ... content of ../node_modules/normalize.css/normalize.css */

/* ... content of css/foo.css */

@media (min-width: 25em) {
/* ... content of css/bar.css */
}

@layer baz-layer {
/* ... content of css/baz.css */
}

body {
  background: black;
}

Checkout the tests for more examples.

Options

filter

Type: Function
Default: () => true

Only transform imports for which the test function returns true. Imports for which the test function returns false will be left as is. The function gets the path to import as an argument and should return a boolean.

root

Type: String
Default: process.cwd() or dirname of the postcss from

Define the root where to resolve path (eg: place where node_modules are). Should not be used that much.
Note: nested @import will additionally benefit of the relative dirname of imported files.

path

Type: String|Array
Default: []

A string or an array of paths in where to look for files.

plugins

Type: Array
Default: undefined

An array of plugins to be applied on each imported files.

resolve

Type: Function
Default: null

You can provide a custom path resolver with this option. This function gets (id, basedir, importOptions) arguments and should return a path, an array of paths or a promise resolving to the path(s). If you do not return an absolute path, your path will be resolved to an absolute path using the default resolver. You can use resolve for this.

load

Type: Function
Default: null

You can overwrite the default loading way by setting this option. This function gets (filename, importOptions) arguments and returns content or promised content.

skipDuplicates

Type: Boolean
Default: true

By default, similar files (based on the same content) are being skipped. It's to optimize output and skip similar files like normalize.css for example. If this behavior is not what you want, just set this option to false to disable it.

addModulesDirectories

Type: Array
Default: []

An array of folder names to add to Node's resolver. Values will be appended to the default resolve directories: ["node_modules", "web_modules"].

This option is only for adding additional directories to default resolver. If you provide your own resolver via the resolve configuration option above, then this value will be ignored.

nameLayer

Type: Function Default: null

You can provide a custom naming function for anonymous layers (@import 'baz.css' layer;). This function gets (index, rootFilename) arguments and should return a unique string.

This option only influences imports without a layer name. Without this option the plugin will warn on anonymous layers.

Example with some options

const postcss = require("postcss")
const atImport = require("postcss-import")

postcss()
  .use(atImport({
    path: ["src/css"],
  }))
  .process(cssString)
  .then((result) => {
    const { css } = result
  })

dependency Message Support

postcss-import adds a message to result.messages for each @import. Messages are in the following format:

{
  type: 'dependency',
  file: absoluteFilePath,
  parent: fileContainingTheImport
}

This is mainly for use by postcss runners that implement file watching.


CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ npm test).

Changelog

License