-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Create Core-Plugin #281
base: main
Are you sure you want to change the base?
Create Core-Plugin #281
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ coverage | |
node_modules | ||
package-lock.json | ||
packages/**/dist | ||
packages/**/build | ||
tests/e2e/test-results |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,24 @@ export const createCliNamespace = (ctx: Ctx) => { | |
getAppName(ctx.appDir) | ||
) | ||
); | ||
fs.renameSync( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forgot to rename the extensions namespace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this to #283. |
||
path.join( | ||
ctx.appDir, | ||
"packages", | ||
"cli", | ||
"src", | ||
"extensions", | ||
"placeholder" | ||
), | ||
path.join( | ||
ctx.appDir, | ||
"packages", | ||
"cli", | ||
"src", | ||
"extensions", | ||
getAppName(ctx.appDir) | ||
) | ||
); | ||
}; | ||
|
||
const setWebPackagePrivateTrue = (ctx: Ctx) => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ | |
"clean": "rimraf build", | ||
"copy-templates": "copyfiles ./src/templates/* ./build/templates", | ||
"format": "prettier --plugin-search-dir . --write .", | ||
"build": "tsc -p tsconfig.json", | ||
"build": "npm run clean && run-s build:cli copy-templates", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forgot to copy the templates during the build step There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this to #283. |
||
"build:cli": "tsc -p tsconfig.json", | ||
"dev": "pnpm clean && pnpm copy-templates && run-p dev:watch-src dev:watch-templates", | ||
"dev:watch-src": "tsc -p tsconfig.json --watch", | ||
"dev:watch-templates": "npm-watch copy-templates" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "webstone-plugin-cli-core", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"private": true, | ||
"files": [ | ||
"build", | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rimraf build dist", | ||
"copy-templates": "copyfiles ./src/templates/* ./build/templates", | ||
"format": "prettier --plugin-search-dir . --write .", | ||
"build": "npm run clean && run-p build:cli build:lib copy-templates", | ||
"build:lib": "tsup src/lib/index.ts --format cjs --dts --clean --minify", | ||
"build:cli": "tsc -p tsconfig.json", | ||
"dev": "pnpm clean && pnpm copy-templates && run-p dev:watch-src dev:watch-templates dev:lib", | ||
"dev:watch-src": "tsc -p tsconfig.json --watch", | ||
"dev:watch-templates": "npm-watch copy-templates", | ||
"dev:lib": "npm run build:lib -- --watch src/lib" | ||
}, | ||
"keywords": [ | ||
"webstone", | ||
"plugin", | ||
"template" | ||
], | ||
"watch": { | ||
"copy-templates": { | ||
"patterns": [ | ||
"src/templates" | ||
], | ||
"extensions": "ejs" | ||
} | ||
}, | ||
"author": "Cahllagerfeld", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"copyfiles": "^2.4.1", | ||
"gluegun": "^5.1.2", | ||
"npm-run-all": "^4.1.5", | ||
"npm-watch": "^0.11.0", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"tsup": "^6.2.3", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { GluegunCommand } from 'gluegun'; | ||
|
||
const command: GluegunCommand = { | ||
name: 'hello', | ||
alias: ['h'], | ||
description: 'Hello World Command', | ||
hidden: false, | ||
dashed: false, | ||
run: async (toolbox) => { | ||
const { print } = toolbox; | ||
|
||
print.info(`Hello World`); | ||
} | ||
}; | ||
|
||
export default command; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { GluegunToolbox } from 'gluegun'; | ||
|
||
const extension = (toolbox: GluegunToolbox) => { | ||
const { print } = toolbox; | ||
|
||
toolbox.sayhello = () => { | ||
print.info('Hello from an extension!'); | ||
}; | ||
}; | ||
|
||
export default extension; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const test = 'dummy'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Template</h1> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"outDir": "./build", | ||
"module": "commonjs", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"allowSyntheticDefaultImports": true, | ||
"experimentalDecorators": true, | ||
"skipLibCheck": true, | ||
"declaration": true, | ||
"moduleResolution": "Node", | ||
"rootDir": "src", | ||
"declarationDir": "./build/types" | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["src/fixtures", "src/**/*.test.ts", "src/lib"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], | ||
plugins: ['svelte3', '@typescript-eslint'], | ||
ignorePatterns: ['*.cjs'], | ||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], | ||
settings: { | ||
'svelte3/typescript': () => require('typescript') | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020 | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
# Ignore files for PNPM, NPM and YARN | ||
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100, | ||
"plugins": ["prettier-plugin-svelte"], | ||
"pluginSearchDirs": ["."], | ||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# create-svelte | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
|
||
## Creating a project | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
|
||
## Developing | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
|
||
```bash | ||
npm run dev | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
|
||
## Building | ||
|
||
To create a production version of your app: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
You can preview the production build with `npm run preview`. | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "webstone-plugin-web-core", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "svelte-kit sync && svelte-package", | ||
"test": "playwright test", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --plugin-search-dir . --check . && eslint .", | ||
"format": "prettier --plugin-search-dir . --write ." | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.25.0", | ||
"@sveltejs/adapter-auto": "next", | ||
"@sveltejs/kit": "next", | ||
"@sveltejs/package": "next", | ||
"@typescript-eslint/eslint-plugin": "^5.27.0", | ||
"@typescript-eslint/parser": "^5.27.0", | ||
"eslint": "^8.16.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-svelte3": "^4.0.0", | ||
"prettier": "^2.6.2", | ||
"prettier-plugin-svelte": "^2.7.0", | ||
"svelte": "^3.44.0", | ||
"svelte-check": "^2.7.1", | ||
"svelte-preprocess": "^4.10.6", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.7.4", | ||
"vite": "^3.1.0" | ||
}, | ||
"type": "module", | ||
"private": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
webServer: { | ||
command: 'npm run build && npm run preview', | ||
port: 4173 | ||
} | ||
}; | ||
|
||
export default config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference types="@sveltejs/kit" /> | ||
|
||
// See https://kit.svelte.dev/docs/types#app | ||
// for information about these interfaces | ||
// and what to do when importing types | ||
declare namespace App { | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface Error {} | ||
// interface Platform {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body> | ||
<div>%sveltekit.body%</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Reexport your entry components here |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h1>Welcome to your library project</h1> | ||
<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p> | ||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import adapter from '@sveltejs/adapter-auto'; | ||
import preprocess from 'svelte-preprocess'; | ||
|
||
/** @type {import('@sveltejs/kit').Config} */ | ||
const config = { | ||
// Consult https://github.com/sveltejs/svelte-preprocess | ||
// for more information about preprocessors | ||
preprocess: preprocess(), | ||
|
||
kit: { | ||
adapter: adapter() | ||
} | ||
}; | ||
|
||
export default config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"extends": "./.svelte-kit/tsconfig.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true | ||
} | ||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias | ||
// | ||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes | ||
// from the referenced tsconfig.json - TypeScript does not merge them in | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { sveltekit } from '@sveltejs/kit/vite'; | ||
import type { UserConfig } from 'vite'; | ||
|
||
const config: UserConfig = { | ||
plugins: [sveltekit()] | ||
}; | ||
|
||
export default config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these packages, so they don't start the dev server with all packages, we can remove that filter again though :)