弃用yarn
This commit is contained in:
parent
147296e86a
commit
fca6b6d185
112
.pnp.cjs
generated
112
.pnp.cjs
generated
@ -46,6 +46,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["rollup", "npm:4.44.0"],\
|
||||
["rollup-plugin-postcss", "virtual:72ff44e1307b5c61447ede5ffc28ecacd700948466d7165d2b8899ff130869b2d667d50a2c66953dea1538a5d0a0d113cbca9e74c5d3de8af55596b6aff4d3a3#npm:4.0.2"],\
|
||||
["sass", "npm:1.89.2"],\
|
||||
["terser", "npm:5.43.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.8.3#~builtin<compat/typescript>::version=5.8.3&hash=bda367"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
@ -162,6 +163,67 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/gen-mapping", [\
|
||||
["npm:0.3.8", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-gen-mapping-npm-0.3.8-647be6e286-c0687b5227.zip/node_modules/@jridgewell/gen-mapping/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/gen-mapping", "npm:0.3.8"],\
|
||||
["@jridgewell/set-array", "npm:1.2.1"],\
|
||||
["@jridgewell/sourcemap-codec", "npm:1.5.0"],\
|
||||
["@jridgewell/trace-mapping", "npm:0.3.25"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/resolve-uri", [\
|
||||
["npm:3.1.2", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-resolve-uri-npm-3.1.2-5bc4245992-83b85f72c5.zip/node_modules/@jridgewell/resolve-uri/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/resolve-uri", "npm:3.1.2"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/set-array", [\
|
||||
["npm:1.2.1", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip/node_modules/@jridgewell/set-array/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/set-array", "npm:1.2.1"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/source-map", [\
|
||||
["npm:0.3.6", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-source-map-npm-0.3.6-fe0849eb05-c9dc7d8993.zip/node_modules/@jridgewell/source-map/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/source-map", "npm:0.3.6"],\
|
||||
["@jridgewell/gen-mapping", "npm:0.3.8"],\
|
||||
["@jridgewell/trace-mapping", "npm:0.3.25"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/sourcemap-codec", [\
|
||||
["npm:1.5.0", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-sourcemap-codec-npm-1.5.0-dfd9126d71-05df4f2538.zip/node_modules/@jridgewell/sourcemap-codec/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/sourcemap-codec", "npm:1.5.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@jridgewell/trace-mapping", [\
|
||||
["npm:0.3.25", {\
|
||||
"packageLocation": "./.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-9d3c40d225.zip/node_modules/@jridgewell/trace-mapping/",\
|
||||
"packageDependencies": [\
|
||||
["@jridgewell/trace-mapping", "npm:0.3.25"],\
|
||||
["@jridgewell/resolve-uri", "npm:3.1.2"],\
|
||||
["@jridgewell/sourcemap-codec", "npm:1.5.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@lezer/common", [\
|
||||
["npm:1.2.3", {\
|
||||
"packageLocation": "./.yarn/cache/@lezer-common-npm-1.2.3-ee9d05545d-9b5f52d949.zip/node_modules/@lezer/common/",\
|
||||
@ -687,6 +749,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["acorn", [\
|
||||
["npm:8.15.0", {\
|
||||
"packageLocation": "./.yarn/cache/acorn-npm-8.15.0-0764cf600e-309c6b49ae.zip/node_modules/acorn/",\
|
||||
"packageDependencies": [\
|
||||
["acorn", "npm:8.15.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["agent-base", [\
|
||||
["npm:7.1.3", {\
|
||||
"packageLocation": "./.yarn/cache/agent-base-npm-7.1.3-b2c16e72fb-87bb7ee54f.zip/node_modules/agent-base/",\
|
||||
@ -801,6 +872,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["buffer-from", [\
|
||||
["npm:1.1.2", {\
|
||||
"packageLocation": "./.yarn/cache/buffer-from-npm-1.1.2-03d2f20d7e-0448524a56.zip/node_modules/buffer-from/",\
|
||||
"packageDependencies": [\
|
||||
["buffer-from", "npm:1.1.2"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["bulma", [\
|
||||
["npm:1.0.4", {\
|
||||
"packageLocation": "./.yarn/cache/bulma-npm-1.0.4-dde5c31312-eabc92e6d5.zip/node_modules/bulma/",\
|
||||
@ -933,6 +1013,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]\
|
||||
]],\
|
||||
["commander", [\
|
||||
["npm:2.20.3", {\
|
||||
"packageLocation": "./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip/node_modules/commander/",\
|
||||
"packageDependencies": [\
|
||||
["commander", "npm:2.20.3"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}],\
|
||||
["npm:7.2.0", {\
|
||||
"packageLocation": "./.yarn/cache/commander-npm-7.2.0-19178180f8-53501cbeee.zip/node_modules/commander/",\
|
||||
"packageDependencies": [\
|
||||
@ -3098,6 +3185,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["rollup", "npm:4.44.0"],\
|
||||
["rollup-plugin-postcss", "virtual:72ff44e1307b5c61447ede5ffc28ecacd700948466d7165d2b8899ff130869b2d667d50a2c66953dea1538a5d0a0d113cbca9e74c5d3de8af55596b6aff4d3a3#npm:4.0.2"],\
|
||||
["sass", "npm:1.89.2"],\
|
||||
["terser", "npm:5.43.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.8.3#~builtin<compat/typescript>::version=5.8.3&hash=bda367"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
@ -3374,6 +3462,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["source-map-support", [\
|
||||
["npm:0.5.21", {\
|
||||
"packageLocation": "./.yarn/cache/source-map-support-npm-0.5.21-09ca99e250-43e98d700d.zip/node_modules/source-map-support/",\
|
||||
"packageDependencies": [\
|
||||
["source-map-support", "npm:0.5.21"],\
|
||||
["buffer-from", "npm:1.1.2"],\
|
||||
["source-map", "npm:0.6.1"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["sprintf-js", [\
|
||||
["npm:1.1.3", {\
|
||||
"packageLocation": "./.yarn/cache/sprintf-js-npm-1.1.3-b99efd75b2-a3fdac7b49.zip/node_modules/sprintf-js/",\
|
||||
@ -3543,6 +3642,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["terser", [\
|
||||
["npm:5.43.1", {\
|
||||
"packageLocation": "./.yarn/cache/terser-npm-5.43.1-4358d9add0-1d51747f45.zip/node_modules/terser/",\
|
||||
"packageDependencies": [\
|
||||
["terser", "npm:5.43.1"],\
|
||||
["@jridgewell/source-map", "npm:0.3.6"],\
|
||||
["acorn", "npm:8.15.0"],\
|
||||
["commander", "npm:2.20.3"],\
|
||||
["source-map-support", "npm:0.5.21"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["tinyglobby", [\
|
||||
["npm:0.2.14", {\
|
||||
"packageLocation": "./.yarn/cache/tinyglobby-npm-0.2.14-d4e4bcf80e-261e986e3f.zip/node_modules/tinyglobby/",\
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
{
|
||||
"name": "postjs",
|
||||
"packageManager": "yarn@3.2.0",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "dist/postjs.cjs.js",
|
||||
"module": "dist/post.esm.js",
|
||||
"browser": "dist/post.js",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"build": "npx rollup -c",
|
||||
"dev": "npx rollup -c -w",
|
||||
"test": "node test/test.js",
|
||||
"pretest": "npm run build"
|
||||
},
|
||||
@ -34,6 +33,8 @@
|
||||
"rollup": "^4.44.0",
|
||||
"rollup-plugin-postcss": "^4.0.2",
|
||||
"sass": "^1.89.2",
|
||||
"terser": "^5.43.1",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import postcss from 'rollup-plugin-postcss';
|
||||
import { terser } from 'terser';
|
||||
|
||||
const input = 'src/index.ts';
|
||||
const outputDir = 'dist';
|
||||
|
||||
export default [
|
||||
// ESM
|
||||
{
|
||||
input,
|
||||
output: {
|
||||
file: `${outputDir}/post.esm.js`,
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
postcss({
|
||||
extract: true,
|
||||
minimize: true,
|
||||
use: [
|
||||
['sass', { includePaths: ['./src/styles'] }]
|
||||
]
|
||||
})
|
||||
],
|
||||
external: [], // 所有依赖都内置
|
||||
},
|
||||
// CJS
|
||||
{
|
||||
input,
|
||||
output: {
|
||||
file: `${outputDir}/postjs.cjs.js`,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'default',
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
postcss({
|
||||
extract: true,
|
||||
minimize: true,
|
||||
use: [
|
||||
['sass', { includePaths: ['./src/styles'] }]
|
||||
]
|
||||
})
|
||||
],
|
||||
external: [],
|
||||
},
|
||||
// UMD
|
||||
{
|
||||
input,
|
||||
output: {
|
||||
file: `${outputDir}/post.js`,
|
||||
format: 'umd',
|
||||
name: 'postjs',
|
||||
sourcemap: true,
|
||||
exports: 'default',
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
postcss({
|
||||
extract: true,
|
||||
minimize: true,
|
||||
use: [
|
||||
['sass', { includePaths: ['./src/styles'] }]
|
||||
]
|
||||
})
|
||||
],
|
||||
external: [],
|
||||
},
|
||||
// UMD minified
|
||||
{
|
||||
input,
|
||||
output: {
|
||||
file: `${outputDir}/post.min.js`,
|
||||
format: 'umd',
|
||||
name: 'postjs',
|
||||
sourcemap: true,
|
||||
exports: 'default',
|
||||
plugins: [terser()],
|
||||
},
|
||||
plugins: [
|
||||
typescript(),
|
||||
postcss({
|
||||
extract: true,
|
||||
minimize: true,
|
||||
use: [
|
||||
['sass', { includePaths: ['./src/styles'] }]
|
||||
]
|
||||
}),
|
||||
terser()
|
||||
],
|
||||
external: [],
|
||||
}
|
||||
];
|
||||
@ -1,4 +1,5 @@
|
||||
import 'bulma/bulma.sass';
|
||||
import './styles/mystyles.scss'
|
||||
|
||||
export class PostSet {
|
||||
private divElement: HTMLDivElement | null;
|
||||
@ -10,10 +11,13 @@ export class PostSet {
|
||||
const elem = document.getElementById(divId);
|
||||
this.divElement = elem as HTMLDivElement | null;
|
||||
this.options = options;
|
||||
|
||||
this.divElement.style.position= 'relative';
|
||||
}
|
||||
|
||||
public generate_init_panel(): void {
|
||||
|
||||
const panelRoot = document.createElement('div');
|
||||
panelRoot.className = 'panelRoot';
|
||||
}
|
||||
|
||||
public getDivElement(): HTMLDivElement | null {
|
||||
@ -30,10 +34,10 @@ export class PostSet {
|
||||
this.divElement = elem as HTMLDivElement | null;
|
||||
}
|
||||
public getBaseUrl(): string {
|
||||
return this.baseurl;
|
||||
return this.options.baseurl;
|
||||
}
|
||||
public setBaseUrl(baseurl: string): void {
|
||||
this.baseurl = baseurl;
|
||||
this.options.baseurl = baseurl;
|
||||
}
|
||||
|
||||
public generate_const_baseurl(): void{
|
||||
|
||||
@ -1 +1,7 @@
|
||||
import { PostSet } from './PostSet';
|
||||
|
||||
const exports = {
|
||||
PostSet
|
||||
};
|
||||
|
||||
export default exports;
|
||||
|
||||
8
src/styles/mystyles.scss
Normal file
8
src/styles/mystyles.scss
Normal file
@ -0,0 +1,8 @@
|
||||
.panelRoot{
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user