mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
Chore: Joplin generator: Remove @joplin/lib
dev dependency from generated projects (#10075)
This commit is contained in:
parent
b152732d7f
commit
238468ddaa
@ -677,6 +677,7 @@ packages/generator-joplin/generators/app/templates/api/noteListType.js
|
||||
packages/generator-joplin/generators/app/templates/api/types.js
|
||||
packages/generator-joplin/generators/app/templates/api_index.js
|
||||
packages/generator-joplin/generators/app/templates/src/index.js
|
||||
packages/generator-joplin/tools/updateCategories.js
|
||||
packages/htmlpack/src/index.js
|
||||
packages/lib/ArrayUtils.js
|
||||
packages/lib/AsyncActionQueue.js
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -657,6 +657,7 @@ packages/generator-joplin/generators/app/templates/api/noteListType.js
|
||||
packages/generator-joplin/generators/app/templates/api/types.js
|
||||
packages/generator-joplin/generators/app/templates/api_index.js
|
||||
packages/generator-joplin/generators/app/templates/src/index.js
|
||||
packages/generator-joplin/tools/updateCategories.js
|
||||
packages/htmlpack/src/index.js
|
||||
packages/lib/ArrayUtils.js
|
||||
packages/lib/AsyncActionQueue.js
|
||||
|
@ -24,7 +24,6 @@
|
||||
"ts-loader": "^9.3.1",
|
||||
"typescript": "^4.8.2",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"@joplin/lib": "~2.9"
|
||||
"webpack-cli": "^4.10.0"
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,10 @@ const CopyPlugin = require('copy-webpack-plugin');
|
||||
const tar = require('tar');
|
||||
const glob = require('glob');
|
||||
const execSync = require('child_process').execSync;
|
||||
const allPossibleCategories = require('@joplin/lib/pluginCategories.json');
|
||||
|
||||
// AUTO-GENERATED by updateCategories
|
||||
const allPossibleCategories = [{ 'name': 'appearance' }, { 'name': 'developer tools' }, { 'name': 'productivity' }, { 'name': 'themes' }, { 'name': 'integrations' }, { 'name': 'viewer' }, { 'name': 'search' }, { 'name': 'tags' }, { 'name': 'editor' }, { 'name': 'files' }, { 'name': 'personal knowledge management' }];
|
||||
// AUTO-GENERATED by updateCategories
|
||||
|
||||
const rootDir = path.resolve(__dirname);
|
||||
const userConfigFilename = './plugin.config.json';
|
||||
|
@ -9,7 +9,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"test-ci": "yarn test"
|
||||
"test-ci": "yarn test",
|
||||
"updateCategories": "ts-node tools/updateCategories.ts"
|
||||
},
|
||||
"files": [
|
||||
"generators"
|
||||
@ -29,7 +30,10 @@
|
||||
"yosay": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "29.7.0"
|
||||
"@joplin/lib": "~3.0",
|
||||
"@joplin/tools": "~3.0",
|
||||
"jest": "29.7.0",
|
||||
"ts-node": "10.9.2"
|
||||
},
|
||||
"repository": "https://github.com/laurent22/generator-joplin",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
|
20
packages/generator-joplin/tools/updateCategories.ts
Normal file
20
packages/generator-joplin/tools/updateCategories.ts
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
import { dirname } from 'path';
|
||||
import { insertContentIntoFile } from '@joplin/tools/tool-utils';
|
||||
const allCategories = require('@joplin/lib/pluginCategories.json');
|
||||
|
||||
const updateCategories = async () => {
|
||||
const buildScriptPath = `${dirname(__dirname)}/generators/app/templates/webpack.config.js`;
|
||||
|
||||
const possibleCategoriesJson = JSON.stringify(allCategories).replace(/["]/g, '\'');
|
||||
const possibleCategoriesLine = `const allPossibleCategories = ${possibleCategoriesJson};`;
|
||||
|
||||
await insertContentIntoFile(
|
||||
buildScriptPath,
|
||||
'// AUTO-GENERATED by updateCategories\n',
|
||||
'\n// AUTO-GENERATED by updateCategories',
|
||||
possibleCategoriesLine,
|
||||
);
|
||||
};
|
||||
|
||||
void updateCategories();
|
@ -13,3 +13,5 @@ cp "$LIB_DIR/services/plugins/api/types.ts" "$SCRIPT_DIR/generators/app/template
|
||||
cp "$LIB_DIR/services/plugins/api/noteListType.ts" "$SCRIPT_DIR/generators/app/templates/api/"
|
||||
cp "$SCRIPT_DIR/generators/app/templates/api_index.ts" "$SCRIPT_DIR/generators/app/templates/api/index.ts"
|
||||
rm -f "$SCRIPT_DIR/generators/app/templates/api/types.d.ts"
|
||||
|
||||
yarn updateCategories
|
@ -22406,9 +22406,12 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "generator-joplin@workspace:packages/generator-joplin"
|
||||
dependencies:
|
||||
"@joplin/lib": ~3.0
|
||||
"@joplin/tools": ~3.0
|
||||
chalk: 2.4.2
|
||||
jest: 29.7.0
|
||||
slugify: 1.6.6
|
||||
ts-node: 10.9.2
|
||||
yeoman-generator: 5.10.0
|
||||
yosay: 2.0.2
|
||||
languageName: unknown
|
||||
|
Loading…
Reference in New Issue
Block a user