Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build react/vue/elements icons #4

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/node_modules
/dist

.FIGMA_TOKEN
.FIGMA_TOKEN

vue/
react/
elements/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ To update the icons, run the following script. If it has a valid Figma access to
or

```bash
pnpm run import
pnpm import
```

### Local preview
You can open a local preview of the icons. Use this to verify that the icons looks as they should. Run the following command.

```bash
pnpm run preview
pnpm dev
```


16 changes: 16 additions & 0 deletions elements.eik.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as eik from '@eik/esbuild-plugin';
import esbuild from 'esbuild';

await eik.load();

await esbuild.build({
plugins: [eik.plugin()],
entryPoints: ['elements/index.js'],
bundle: true,
outfile: 'dist/elements/icons.js',
format: 'esm',
sourcemap: true,
target: 'es2017',
minify: true,
external: ['lit'],
});
35 changes: 29 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@
"description": "WARP's icon set",
"main": "index.js",
"files": [
"dist"
"dist",
"vue",
"react",
"elements"
],
"exports": {
".": "./index.js"
".": "./index.js",
"./react": "./react/index.js",
"./vue": "./vue/index.js",
"./elements": "./elements/index.js",
"./elements/*": "./elements/*.js",
"./package.json": "./package.json"
},
"scripts": {
"import": "node ./scripts/import.js",
"build": "node ./scripts/build.js",
"render": "node preview/render.js",
"dev": "vite",
"vite:build": "vite build",
"preview": "pnpm run build && vite build && vite preview"
"dev": "pnpm build && vite",
"build:react": "rimraf react && mkdir react && node ./scripts/output/react.js && node ./react.eik.js",
"build:vue": "rimraf vue && mkdir vue && node ./scripts/output/vue.js && node ./vue.eik.js",
"build:elements": "rimraf elements && mkdir elements && node ./scripts/output/elements.js && node ./elements.eik.js"
},
"license": "Apache-2.0",
"devDependencies": {
"@eik/esbuild-plugin": "^1.1.11",
"@sindresorhus/slugify": "^2.1.0",
"@warp-ds/uno": "^1.0.0",
"camelcase": "^8.0.0",
Expand All @@ -41,5 +50,19 @@
},
"publishConfig": {
"access": "public"
},
"eik": {
"server": "https://assets.finn.no",
"type": "package",
"files": {
"react": "./dist/react",
"vue": "./dist/vue",
"elements": "./dist/elements"
},
"import-map": [
"https://assets.finn.no/map/react/v2",
"https://assets.finn.no/map/vue/v1",
"https://assets.finn.no/map/custom-elements/v2"
]
BalbinaK marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading