Skip to content

Commit

Permalink
chore: bootstrap viewer core
Browse files Browse the repository at this point in the history
  • Loading branch information
vsgoulart committed May 1, 2024
1 parent 35f0369 commit 3c27c63
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/form-js-viewer-core/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="@bpmn-io/form-js-viewer-core" />
<title>@bpmn-io/form-js-viewer-core</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module">
import { foo } from './src/index.js';

console.log(foo());
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions packages/form-js-viewer-core/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"declaration": true,
"useUnknownInCatchVariables": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules"]
}
35 changes: 35 additions & 0 deletions packages/form-js-viewer-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@bpmn-io/form-js-viewer-core",
"version": "1.8.6",
"description": "View forms - powered by bpmn.io",
"type": "module",
"publishConfig": {
"access": "public"
},
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/types/index.d.ts",
"scripts": {
"all": "run-s test build",
"build": "run-p bundle generate-types",
"bundle": "vite build",
"dev": "vite",
"generate-types": "tsc --allowJs --skipLibCheck --declaration --emitDeclarationOnly --outDir dist/types src/index.js && copyfiles --flat src/*.d.ts dist/types",
"test": "vitest",
"prepublishOnly": "npm run build"
},
"license": "SEE LICENSE IN LICENSE",
"repository": {
"type": "git",
"url": "git+https://github.com/bpmn-io/form-js.git",
"directory": "packages/form-js-viewer-core"
},
"author": {
"name": "bpmn.io contributors",
"url": "https://github.com/bpmn-io"
},
"sideEffects": false,
"files": [
"dist"
]
}
5 changes: 5 additions & 0 deletions packages/form-js-viewer-core/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function foo() {
return 'foo';
}

export { foo };
6 changes: 6 additions & 0 deletions packages/form-js-viewer-core/src/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../jsconfig.json",
"compilerOptions": {
"lib": ["ES2020", "DOM", "DOM.Iterable"]
}
}
9 changes: 9 additions & 0 deletions packages/form-js-viewer-core/test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"plugin:bpmn-io/mocha",
"plugin:prettier/recommended"
],
"globals": {
"vite": true
}
}
5 changes: 5 additions & 0 deletions packages/form-js-viewer-core/test/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { foo } from '@/index.js';

it('should pass a test', () => {
expect(foo()).toBe('foo');
});
11 changes: 11 additions & 0 deletions packages/form-js-viewer-core/test/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../jsconfig.json",
"compilerOptions": {
"lib": ["ES2020"],
"types": ["@types/node", "vitest/globals"],
"esModuleInterop": true,
"declaration": false,
"resolveJsonModule": true
},
"include": ["**/*.spec.js"]
}
22 changes: 22 additions & 0 deletions packages/form-js-viewer-core/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// vite.config.js
import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.js'),
fileName: 'index',
formats: ['es', 'cjs'],
},
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
test: {
globals: true,
files: ['test/**/*.spec.js'],
},
});

0 comments on commit 3c27c63

Please sign in to comment.