Skip to content

Commit

Permalink
Refactor code directory structure to simplify paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Siilwyn committed Jul 27, 2023
1 parent 99e270d commit b0c293d
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 14 deletions.
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@
"type": "module",
"main": "./dist/main.cjs",
"exports": {
"import": "./src/main.mjs",
"import": "./src/core/main.mjs",
"require": "./dist/main.cjs"
},
"types": "./src/main.d.ts",
"types": "./src/core/main.d.ts",
"files": [
"src/main.mjs",
"src/main.d.ts",
"src/shorthand-data.mjs",
"src/bubble-sort.mjs",
"orders",
"dist"
"src/core/",
"src/orders/",
"dist/"
],
"scripts": {
"build": "rollup -c",
"preversion": "npm test",
"test": "uvu src .+\\.test\\.mjs",
"test:ci": "npm test && npm run lint -- --max-warnings 0",
"lint": "eslint src/*.mjs",
"lint": "eslint src/core/*.mjs",
"scrape": "node --experimental-import-meta-resolve src/property-scraper.mjs",
"prepack": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dynamicImportVars from '@rollup/plugin-dynamic-import-vars';

export default [
{
input: 'src/main.mjs',
input: 'src/core/main.mjs',
output: {
dir: 'dist',
format: 'cjs',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/property-scraper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ const cssProperties = Object.entries({ ...css.properties, ...css['at-rules']['fo
));

fs.writeFile(
'orders/alphabetical.mjs',
'src/orders/alphabetical.mjs',
`export const properties = ${JSON.stringify(cssProperties, null, 2)}\n`,
);
6 changes: 3 additions & 3 deletions src/property-scraper.test.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { promises as fs } from 'node:fs';
import { test } from 'uvu';
import * as assert from 'uvu/assert';
import { shorthandData } from './shorthand-data.mjs';
import { properties as sourceProperties } from '../orders/alphabetical.mjs';
import { shorthandData } from './core/shorthand-data.mjs';
import { properties as sourceProperties } from './orders/alphabetical.mjs';

const cssOrdersDir = './orders/';
const cssOrdersDir = './src/orders/';

test('CSS properties are up-to-date.', () => (
fs.readdir(cssOrdersDir).then(async (files) => {
Expand Down

0 comments on commit b0c293d

Please sign in to comment.